1
1
2
- allprojects {
2
+ subprojects {
3
3
4
4
apply plugin : ' maven-publish'
5
5
apply plugin : ' java-library'
6
6
apply plugin : ' signing'
7
7
8
8
group = ' org.conductoross'
9
- def conductorVersion = System . getenv(' CONDUCTOR_VERSION' )
10
- if (conductorVersion) {
11
- println " Inferred version from env variable 'CONDUCTOR_VERSION': $conductorVersion "
12
- version = conductorVersion
13
- }
14
9
15
10
publishing {
16
11
publications {
17
12
mavenJava(MavenPublication ) {
18
13
from components. java
14
+ versionMapping {
15
+ usage(' java-api' ) {
16
+ fromResolutionOf(' runtimeClasspath' )
17
+ }
18
+ usage(' java-runtime' ) {
19
+ fromResolutionResult()
20
+ }
21
+ }
19
22
pom {
20
23
name = ' Conductor OSS'
21
24
description = ' Conductor OSS build.'
@@ -44,8 +47,7 @@ allprojects {
44
47
45
48
repositories {
46
49
maven {
47
- println " Publishing to Sonatype Repository"
48
- url = " https://s01.oss.sonatype.org/${ project.version.endsWith('-SNAPSHOT') ? "content/repositories/snapshots/" : "service/local/staging/deploy/maven2/"} "
50
+ url = " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
49
51
credentials {
50
52
username project. properties. username
51
53
password project. properties. password
@@ -56,14 +58,17 @@ allprojects {
56
58
57
59
signing {
58
60
def signingKeyId = findProperty(' signingKeyId' )
59
- def signingKey = findProperty(' signingKey' )
60
- def signingPassword = findProperty(' signingPassword' )
61
- System . out. println (" signingKeyId: " + signingKeyId)
62
- if (signingKeyId && signingKey && signingPassword) {
63
- useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
61
+ if (signingKeyId) {
62
+ println ' Signing artifacts with keys'
63
+ def signingKey = findProperty(' signingKey' )
64
+ def signingPassword = findProperty(' signingPassword' )
65
+ if (signingKeyId && signingKey && signingPassword) {
66
+ useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
67
+ }
68
+
69
+ sign publishing. publications
64
70
}
65
71
66
- sign publishing. publications
67
72
}
68
73
69
74
}
0 commit comments