-
Notifications
You must be signed in to change notification settings - Fork 47
/
publish.gradle
57 lines (50 loc) · 1.72 KB
/
publish.gradle
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
if (project.hasProperty('SONATYPE_USERNAME') && project.hasProperty('SONATYPE_PASSWORD')) {
apply plugin: 'maven-publish'
apply plugin: 'signing'
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
}
publishing {
publications {
jar(MavenPublication) {
from components.java
artifact sourceJar
artifact javadocJar
pom {
name = project.name
description = POM_DESCRIPTION
url = POM_PROJECT_URL
scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEVELOPER_CONNECTION
}
licenses {
license {
name = POM_LICENSE
url = POM_LICENSE_URL
}
}
developers {
developer {
id = POM_DEVELOPER_ID
name = POM_DEVELOPER_NAME
email = POM_DEVELOPER_EMAIL
organization = POM_DEVELOPER_ORGANIZATION
organizationUrl = POM_DEVELOPER_ORGANIZATION_URL
}
}
}
}
}
}
signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications
}
}