-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathjava-publication.gradle
More file actions
99 lines (87 loc) · 2.56 KB
/
java-publication.gradle
File metadata and controls
99 lines (87 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
apply plugin: "java"
def licenseSpec = copySpec {
from project.rootDir
include "LICENSE"
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
with licenseSpec
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from tasks.javadoc
with licenseSpec
}
jar {
with licenseSpec
}
artifacts {
archives jar, javadocJar, sourcesJar
}
apply plugin: "maven-publish" //https://docs.gradle.org/current/userguide/publishing_maven.html
publishing {
publications {
javaLibrary(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifactId = project.archivesBaseName
pom {
name = artifactId
description = "A library for analyzing, processing, and rewriting views defined in the Hive Metastore, and sharing them across multiple execution engines"
url = "https://github.com/linkedin/coral"
licenses {
license {
name = 'The MIT License'
url = 'https://github.com/linkedin/coral/blob/master/LICENSE'
distribution = 'repo'
}
}
developers {
[
'wmoustafa:Walaa Eldin Moustafa',
'khaitranq:Khai Tranh',
'funcheetah:Wenye Zhang',
'shardulm94:Shardul Mahadik',
'hotsushi:Sushant Raikar'
].each { devData ->
developer {
def devInfo = devData.split(':')
id = devInfo[0]
name = devInfo[1]
url = 'https://github.com/' + devInfo[0]
roles = ["Core developer"]
}
}
}
scm {
url = 'https://github.com/linkedin/coral.git'
}
issueManagement {
url = 'https://github.com/linkedin/coral/issues'
system = 'GitHub issues'
}
ciManagement {
url = 'https://github.com/linkedin/coral/actions'
system = 'GitHub Actions'
}
}
}
}
//useful for testing - running "publish" will create artifacts/pom in a local dir
repositories {
maven {
url = "$rootProject.buildDir/repo"
}
}
}
//fleshes out problems with Maven pom generation when building
tasks.build.dependsOn("publishJavaLibraryPublicationToMavenLocal")
apply plugin: 'signing' //https://docs.gradle.org/current/userguide/signing_plugin.html
signing {
if (System.getenv("PGP_KEY")) {
useInMemoryPgpKeys(System.getenv("PGP_KEY"), System.getenv("PGP_PWD"))
sign publishing.publications.javaLibrary
}
}