/
publish.gradle
75 lines (64 loc) · 1.73 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* Configuration for publishing to Maven Central
*/
apply plugin: 'maven-publish'
apply plugin: 'java-library'
apply plugin: 'signing'
configurations {
testArtifacts
}
java {
withJavadocJar()
withSourcesJar()
}
task testJar(type: Jar, group: 'Build') {
description = 'Assembles a jar archive containing the test classes.'
from sourceSets.test.output
archiveClassifier = 'test'
}
artifacts {
testArtifacts testJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact testJar
pom {
name = 'Caffeine cache'
description = 'A high performance caching library'
url = 'https://github.com/ben-manes/caffeine'
inceptionYear = '2014'
scm {
url = 'https://github.com/ben-manes/caffeine'
connection = 'scm:git:https://github.com/ben-manes/caffeine.git'
developerConnection = 'scm:git:ssh://git@github.com/ben-manes/caffeine.git'
}
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id = 'ben-manes'
name = 'Ben Manes'
email = 'ben.manes@gmail.com'
roles = [ 'owner', 'developer' ]
}
}
}
}
}
}
signing {
// https://github.com/gradle/gradle/issues/11387
required { false }
def signingKey = findProperty("signingKey")
def signingKeyId = findProperty("signingKeyId")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.mavenJava
}