Skip to content

Commit 5bcbf30

Browse files
bclozelStephane Maldini
authored andcommitted
Fix Gradle publication configuration (#698)
Prior to this change, the Gradle publication configuration would be applied to the wrong level of projects (subprojects of subprojects!), resulting in no artifacts being published to the repository. This commit updates the JFrog artifactory Gradle plugin version and fixes the application of the publication configuration to align with what's been done with artifactory and bintray configurations. Signed-off-by: Brian Clozel <bclozel@pivotal.io>
1 parent c4c8d22 commit 5bcbf30

File tree

3 files changed

+65
-61
lines changed

3 files changed

+65
-61
lines changed

build.gradle

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ plugins {
1818
id 'com.gradle.build-scan' version '2.4.2'
1919

2020
id 'com.github.sherter.google-java-format' version '0.8' apply false
21-
id 'com.jfrog.artifactory' version '4.7.3' apply false
21+
id 'com.jfrog.artifactory' version '4.9.10' apply false
2222
id 'com.jfrog.bintray' version '1.8.4' apply false
2323
id 'me.champeau.gradle.jmh' version '0.4.8' apply false
2424
id 'io.spring.dependency-management' version '1.0.7.RELEASE' apply false
@@ -28,7 +28,6 @@ plugins {
2828
subprojects {
2929
apply plugin: 'io.spring.dependency-management'
3030
apply plugin: 'com.github.sherter.google-java-format'
31-
apply from: "${rootDir}/gradle/publications.gradle"
3231

3332
ext['reactor-bom.version'] = 'Dysprosium-RELEASE'
3433
ext['logback.version'] = '1.2.3'
@@ -132,19 +131,23 @@ subprojects {
132131
from javadoc.destinationDir
133132
}
134133

135-
publishing {
136-
publications {
137-
maven(MavenPublication) {
138-
from components.java
139-
artifact sourcesJar
140-
artifact javadocJar
134+
plugins.withType(MavenPublishPlugin) {
135+
publishing {
136+
publications {
137+
maven(MavenPublication) {
138+
from components.java
139+
artifact sourcesJar
140+
artifact javadocJar
141+
}
141142
}
142143
}
143144
}
144145
}
145146

146147
}
147148

149+
apply from: "${rootDir}/gradle/publications.gradle"
150+
148151
buildScan {
149152
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
150153
termsOfServiceAgree = 'yes'

gradle/artifactory.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (project.hasProperty('bintrayUser') && project.hasProperty('bintrayKey')) {
3131
}
3232

3333
defaults {
34-
publications('maven')
34+
publications(publishing.publications.maven)
3535
}
3636
}
3737
}

gradle/publications.gradle

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,62 @@
1-
apply plugin: "maven-publish"
21
apply from: "${rootDir}/gradle/artifactory.gradle"
32
apply from: "${rootDir}/gradle/bintray.gradle"
43

5-
plugins.withType(MavenPublishPlugin) {
6-
publishing {
7-
publications {
8-
maven(MavenPublication) {
9-
pom {
10-
name = project.name
11-
groupId = 'io.rsocket'
12-
description = project.description
13-
url = 'http://rsocket.io'
14-
licenses {
15-
license {
16-
name = "The Apache Software License, Version 2.0"
17-
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
18-
distribution = "repo"
4+
subprojects {
5+
plugins.withType(MavenPublishPlugin) {
6+
publishing {
7+
publications {
8+
maven(MavenPublication) {
9+
pom {
10+
name = project.name
11+
groupId = 'io.rsocket'
12+
description = project.description
13+
url = 'http://rsocket.io'
14+
licenses {
15+
license {
16+
name = "The Apache Software License, Version 2.0"
17+
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
18+
distribution = "repo"
19+
}
1920
}
20-
}
21-
developers {
22-
developer {
23-
id = 'robertroeser'
24-
name = 'Robert Roeser'
25-
email = 'robert@netifi.com'
26-
}
27-
developer {
28-
id = 'rdegnan'
29-
name = 'Ryland Degnan'
30-
email = 'ryland@netifi.com'
31-
}
32-
developer {
33-
id = 'yschimke'
34-
name = 'Yuri Schimke'
35-
email = 'yuri@schimke.ee'
36-
}
37-
developer {
38-
id = 'OlegDokuka'
39-
name = 'Oleh Dokuka'
40-
email = 'oleh@netifi.com'
21+
developers {
22+
developer {
23+
id = 'robertroeser'
24+
name = 'Robert Roeser'
25+
email = 'robert@netifi.com'
26+
}
27+
developer {
28+
id = 'rdegnan'
29+
name = 'Ryland Degnan'
30+
email = 'ryland@netifi.com'
31+
}
32+
developer {
33+
id = 'yschimke'
34+
name = 'Yuri Schimke'
35+
email = 'yuri@schimke.ee'
36+
}
37+
developer {
38+
id = 'OlegDokuka'
39+
name = 'Oleh Dokuka'
40+
email = 'oleh@netifi.com'
41+
}
42+
developer {
43+
id = 'mostroverkhov'
44+
name = 'Maksym Ostroverkhov'
45+
email = 'm.ostroverkhov@gmail.com'
46+
}
4147
}
42-
developer {
43-
id = 'mostroverkhov'
44-
name = 'Maksym Ostroverkhov'
45-
email = 'm.ostroverkhov@gmail.com'
46-
}
47-
}
48-
scm {
49-
connection = 'scm:git:https://github.com/rsocket/rsocket-java.git'
50-
developerConnection = 'scm:git:https://github.com/rsocket/rsocket-java.git'
51-
url = 'https://github.com/rsocket/rsocket-java'
52-
}
53-
versionMapping {
54-
usage('java-api') {
55-
fromResolutionResult()
48+
scm {
49+
connection = 'scm:git:https://github.com/rsocket/rsocket-java.git'
50+
developerConnection = 'scm:git:https://github.com/rsocket/rsocket-java.git'
51+
url = 'https://github.com/rsocket/rsocket-java'
5652
}
57-
usage('java-runtime') {
58-
fromResolutionResult()
53+
versionMapping {
54+
usage('java-api') {
55+
fromResolutionResult()
56+
}
57+
usage('java-runtime') {
58+
fromResolutionResult()
59+
}
5960
}
6061
}
6162
}

0 commit comments

Comments
 (0)