Skip to content

Commit 9ee4a22

Browse files
committed
Maven Dependency Improvements
Previously, an update the build system resulted in the Maven dependencies being aggressively calculated, before each project add dependencies to itself. This change updates the ordering of this calculation such that it happens after each project configures itself. In addition, this change goes through each project and ensures that the dependencies are scoped appropriately in order to achieve the a minimal and accurate Maven POM. [#463][#498]
1 parent 5fedb1d commit 9ee4a22

File tree

10 files changed

+44
-38
lines changed

10 files changed

+44
-38
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repositories {
2727
}
2828
2929
dependencies {
30-
compile 'io.rsocket:reactivesocket:0.9.20'
30+
implementation 'io.rsocket:reactivesocket:0.9.20'
3131
}
3232
```
3333

artifactory.gradle

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,26 @@
1515
*/
1616

1717
if (project.hasProperty('bintrayUser') && project.hasProperty('bintrayKey')) {
18-
artifactory {
19-
publish {
20-
contextUrl = 'https://oss.jfrog.org'
21-
22-
repository {
23-
repoKey = 'oss-snapshot-local'
24-
25-
// Credentials for oss.jfrog.org are a user's Bintray credentials
26-
username = project.property('bintrayUser')
27-
password = project.property('bintrayKey')
28-
}
29-
}
30-
}
3118

3219
subprojects {
3320
plugins.withId('com.jfrog.artifactory') {
34-
artifactoryPublish {
35-
publications('maven')
21+
artifactory {
22+
publish {
23+
contextUrl = 'https://oss.jfrog.org'
24+
25+
repository {
26+
repoKey = 'oss-snapshot-local'
27+
28+
// Credentials for oss.jfrog.org are a user's Bintray credentials
29+
username = project.property('bintrayUser')
30+
password = project.property('bintrayKey')
31+
}
32+
33+
defaults {
34+
publications('maven')
35+
}
36+
}
3637
}
3738
}
3839
}
39-
}
40+
}

rsocket-core/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,20 @@ plugins {
2727
dependencies {
2828
api 'io.netty:netty-buffer'
2929
api 'io.projectreactor:reactor-core'
30-
api 'io.projectreactor.addons:reactor-extra'
3130

32-
implementation 'com.google.code.findbugs:jsr305'
33-
implementation 'org.jctools:jctools-core'
31+
implementation 'io.projectreactor.addons:reactor-extra'
3432
implementation 'org.slf4j:slf4j-api'
3533

34+
compileOnly 'com.google.code.findbugs:jsr305'
35+
compileOnly 'org.jctools:jctools-core'
36+
3637
testImplementation 'io.projectreactor:reactor-test'
3738
testImplementation 'org.assertj:assertj-core'
3839
testImplementation 'org.junit.jupiter:junit-jupiter-api'
3940
testImplementation 'org.mockito:mockito-core'
4041

4142
testRuntimeOnly 'ch.qos.logback:logback-classic'
43+
testRuntimeOnly 'org.jctools:jctools-core'
4244
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
4345

4446
// TODO: Remove after JUnit5 migration
@@ -53,6 +55,8 @@ jar {
5355
}
5456

5557
shadowJar {
58+
configurations = [project.configurations.compileOnly]
59+
5660
dependencies {
5761
include(dependency('org.jctools:jctools-core'))
5862
}

rsocket-core/src/test/java/io/rsocket/util/DefaultPayloadTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.hamcrest.Matchers.*;
2121

2222
import io.rsocket.Payload;
23-
import javax.annotation.Nullable;
2423
import org.junit.Test;
2524

2625
public class DefaultPayloadTest {
@@ -34,7 +33,7 @@ public void testReuse() {
3433
assertDataAndMetadata(p, DATA_VAL, METADATA_VAL);
3534
}
3635

37-
public void assertDataAndMetadata(Payload p, String dataVal, @Nullable String metadataVal) {
36+
public void assertDataAndMetadata(Payload p, String dataVal, String metadataVal) {
3837
assertThat("Unexpected data.", p.getDataUtf8(), equalTo(dataVal));
3938
if (metadataVal == null) {
4039
assertThat("Non-null metadata", p.hasMetadata(), equalTo(false));

rsocket-examples/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ plugins {
1919
}
2020

2121
dependencies {
22-
compile project(':rsocket-core')
23-
compile project(':rsocket-transport-local')
24-
compile project(':rsocket-transport-netty')
22+
implementation project(':rsocket-core')
23+
implementation project(':rsocket-transport-local')
24+
implementation project(':rsocket-transport-netty')
2525

26-
testCompile project(':rsocket-test')
27-
testCompile 'org.junit.jupiter:junit-jupiter-api'
28-
testCompile 'org.mockito:mockito-core'
26+
testImplementation project(':rsocket-test')
27+
testImplementation 'org.junit.jupiter:junit-jupiter-api'
28+
testImplementation 'org.mockito:mockito-core'
2929

3030
// TODO: Remove after JUnit5 migration
3131
testCompileOnly 'junit:junit'
32-
testCompile 'org.hamcrest:hamcrest-library'
32+
testImplementation 'org.hamcrest:hamcrest-library'
3333
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
3434
}
3535

rsocket-load-balancer/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ plugins {
2222
}
2323

2424
dependencies {
25-
implementation project(':rsocket-core')
25+
api project(':rsocket-core')
26+
2627
implementation 'org.slf4j:slf4j-api'
2728

2829
testImplementation project(':rsocket-test')

rsocket-micrometer/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ plugins {
2222
}
2323

2424
dependencies {
25-
implementation project(':rsocket-core')
26-
implementation 'com.google.code.findbugs:jsr305'
27-
implementation 'io.micrometer:micrometer-core'
25+
api project(':rsocket-core')
26+
api 'io.micrometer:micrometer-core'
27+
2828
implementation 'org.slf4j:slf4j-api'
2929

30+
compileOnly 'com.google.code.findbugs:jsr305'
3031

3132
testImplementation project(':rsocket-test')
3233
testImplementation 'io.projectreactor:reactor-test'

rsocket-transport-aeron/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ plugins {
2222
}
2323

2424
dependencies {
25+
api project(':rsocket-core')
2526
api 'io.aeron:aeron-all'
2627

27-
implementation project(':rsocket-core')
2828
implementation 'org.slf4j:slf4j-api'
2929

3030
testImplementation project(':rsocket-test')

rsocket-transport-local/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ plugins {
2222
}
2323

2424
dependencies {
25-
implementation project(':rsocket-core')
26-
implementation 'com.google.code.findbugs:jsr305'
25+
api project(':rsocket-core')
26+
27+
compileOnly 'com.google.code.findbugs:jsr305'
2728

2829
testImplementation project(':rsocket-test')
2930
testImplementation 'io.projectreactor:reactor-test'

rsocket-transport-netty/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ plugins {
2222
}
2323

2424
dependencies {
25+
api project(':rsocket-core')
2526
api 'io.projectreactor.ipc:reactor-netty'
2627

27-
implementation project(':rsocket-core')
28-
2928
testImplementation project(':rsocket-test')
3029
testImplementation 'org.junit.jupiter:junit-jupiter-api'
3130

0 commit comments

Comments
 (0)