Skip to content

Commit

Permalink
Stop using servicetalk-dependencies internally (#3055)
Browse files Browse the repository at this point in the history
Motivation:

Gradle interprets `*.module` files differently than the `pom.xml`.
Because every module currently depends on `servicetalk-dependencies`,
users pulled its `dependencyConstraints` in their build configurations
with any servicetalk module as transitive dependency and got unintended
changes for other dependencies.

For example, `servicetalk-annotations` that has only jsr305 as a 3-party
dependency still forces upgrade of jackson, protobuf, log4j, netty, and
jersey for users because it depends on `servicetalk-dependencies`.

Modifications:

- Remove `servicetalk-dependencies` from every module, instead define
every necessary dependency by its version number or import only
required boms;
- Update `servicetalk-dependencies` to include missed dependencies:
opentelemetry, instrumentation, resilience4j;
- Correct dependencies for all `-jersery3` modules to keep only what
they use;
- Move all `platform` dependencies from the top to their corresponding
scope;
- Regenerate lock files;

Result:

Users don't get unintended dependency upgrades because of the `*.module`
file handling.
  • Loading branch information
idelpivnitskiy authored Sep 9, 2024
1 parent 249efc7 commit 9e310cc
Show file tree
Hide file tree
Showing 189 changed files with 401 additions and 1,122 deletions.
4 changes: 1 addition & 3 deletions servicetalk-annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
implementation platform(project(":servicetalk-dependencies"))

implementation "com.google.code.findbugs:jsr305"
implementation "com.google.code.findbugs:jsr305:$jsr305Version"
}
5 changes: 0 additions & 5 deletions servicetalk-annotations/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor
7 changes: 3 additions & 4 deletions servicetalk-benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ plugins {
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
implementation platform(project(":servicetalk-dependencies"))

implementation platform("io.netty:netty-bom:$nettyVersion")
implementation project(":servicetalk-annotations")
implementation project(":servicetalk-buffer-netty")
implementation project(":servicetalk-concurrent-api")
Expand All @@ -33,9 +32,9 @@ dependencies {
implementation project(":servicetalk-transport-netty-internal")
implementation project(":servicetalk-loadbalancer")
implementation project(":servicetalk-data-jackson")
implementation "com.google.code.findbugs:jsr305"
implementation "com.google.code.findbugs:jsr305:$jsr305Version"
implementation "io.netty:netty-codec-http"
implementation "org.openjdk.jmh:jmh-core"
implementation "org.openjdk.jmh:jmh-core:$jmhCoreVersion"

testImplementation testFixtures(project(":servicetalk-concurrent-internal"))
testImplementation project(":servicetalk-concurrent-internal")
Expand Down
3 changes: 0 additions & 3 deletions servicetalk-benchmarks/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ com.fasterxml.jackson.core:jackson-core:2.16.2=compileClasspath,runtimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.16.2=compileClasspath,runtimeClasspath
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.netty.incubator:netty-incubator-transport-classes-io_uring:0.0.25.Final=runtimeClasspath
io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.25.Final=runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
Expand All @@ -31,8 +30,6 @@ io.netty:netty-transport-native-unix-common:4.1.113.Final=compileClasspath,runti
io.netty:netty-transport:4.1.113.Final=compileClasspath,runtimeClasspath
net.sf.jopt-simple:jopt-simple:5.0.4=compileClasspath,runtimeClasspath
org.apache.commons:commons-math3:3.6.1=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
org.jctools:jctools-core:4.0.3=runtimeClasspath
org.openjdk.jmh:jmh-core:1.37=compileClasspath,runtimeClasspath
org.slf4j:slf4j-api:1.7.36=runtimeClasspath
Expand Down
13 changes: 4 additions & 9 deletions servicetalk-buffer-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,15 @@
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
implementation platform(project(":servicetalk-dependencies"))
testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")

implementation project(":servicetalk-annotations")
implementation "com.google.code.findbugs:jsr305:$jsr305Version"

implementation "com.google.code.findbugs:jsr305"

testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.jupiter:junit-jupiter-params"
testImplementation "org.hamcrest:hamcrest:$hamcrestVersion"
testImplementation "org.mockito:mockito-core:$mockitoCoreVersion"

testFixturesImplementation platform(project(":servicetalk-dependencies"))
testFixturesImplementation project(":servicetalk-annotations")
testFixturesImplementation "com.google.code.findbugs:jsr305"
testFixturesImplementation "org.hamcrest:hamcrest:$hamcrestVersion"
testFixturesApi "org.hamcrest:hamcrest:$hamcrestVersion"
testFixturesImplementation "com.google.code.findbugs:jsr305:$jsr305Version"
}
5 changes: 0 additions & 5 deletions servicetalk-buffer-api/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor
9 changes: 4 additions & 5 deletions servicetalk-buffer-netty/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
api platform(project(":servicetalk-dependencies"))
testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")

api platform("io.netty:netty-bom:$nettyVersion")
api project(":servicetalk-buffer-api")
api "io.netty:netty-buffer"

implementation project(":servicetalk-annotations")
implementation project(":servicetalk-utils-internal")
implementation "com.google.code.findbugs:jsr305"
implementation "org.slf4j:slf4j-api"
implementation "com.google.code.findbugs:jsr305:$jsr305Version"
implementation "org.slf4j:slf4j-api:$slf4jVersion"

testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")
testImplementation project(":servicetalk-test-resources")
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.jupiter:junit-jupiter-params"
Expand Down
4 changes: 0 additions & 4 deletions servicetalk-buffer-netty/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.113.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.113.Final=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
org.jctools:jctools-core:4.0.3=runtimeClasspath
org.slf4j:slf4j-api:1.7.36=compileClasspath,runtimeClasspath
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor
7 changes: 3 additions & 4 deletions servicetalk-capacity-limiter-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
implementation platform(project(":servicetalk-dependencies"))
api project(":servicetalk-context-api")

implementation project(":servicetalk-annotations")
implementation project(":servicetalk-utils-internal")
implementation "com.google.code.findbugs:jsr305"
implementation "org.slf4j:slf4j-api"
implementation "com.google.code.findbugs:jsr305:$jsr305Version"
implementation "org.slf4j:slf4j-api:$slf4jVersion"

testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")
testImplementation testFixtures(project(":servicetalk-concurrent-internal"))
testImplementation project(":servicetalk-test-resources")
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.hamcrest:hamcrest"
testImplementation "org.hamcrest:hamcrest:$hamcrestVersion"
}
5 changes: 0 additions & 5 deletions servicetalk-capacity-limiter-api/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
org.jctools:jctools-core:4.0.3=runtimeClasspath
org.slf4j:slf4j-api:1.7.36=compileClasspath,runtimeClasspath
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor
5 changes: 0 additions & 5 deletions servicetalk-circuit-breaker-api/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=runtimeClasspath
io.netty:netty-bom:4.1.113.Final=runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=runtimeClasspath
empty=annotationProcessor,compileClasspath,spotbugsPlugins,testAnnotationProcessor
6 changes: 2 additions & 4 deletions servicetalk-circuit-breaker-resilience4j/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
implementation platform(project(":servicetalk-dependencies"))

api project(":servicetalk-circuit-breaker-api")
api "io.github.resilience4j:resilience4j-circuitbreaker:${resilience4jVersion}"
api "io.github.resilience4j:resilience4j-circuitbreaker:$resilience4jVersion"

implementation project(":servicetalk-annotations")

testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.hamcrest:hamcrest"
testImplementation "org.hamcrest:hamcrest:$hamcrestVersion"
}
7 changes: 1 addition & 6 deletions servicetalk-circuit-breaker-resilience4j/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.github.resilience4j:resilience4j-circuitbreaker:1.7.1=compileClasspath,runtimeClasspath
io.github.resilience4j:resilience4j-core:1.7.1=compileClasspath,runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
io.vavr:vavr-match:0.10.2=compileClasspath,runtimeClasspath
io.vavr:vavr:0.10.2=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
org.slf4j:slf4j-api:1.7.36=runtimeClasspath
org.slf4j:slf4j-api:1.7.30=runtimeClasspath
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor
8 changes: 3 additions & 5 deletions servicetalk-client-api-internal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
implementation platform(project(":servicetalk-dependencies"))
testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")

api project(":servicetalk-client-api")
api project(":servicetalk-concurrent-api")

implementation project(":servicetalk-annotations")
implementation project(":servicetalk-concurrent-api-internal")
implementation project(":servicetalk-concurrent-internal")
implementation "com.google.code.findbugs:jsr305"
implementation "org.slf4j:slf4j-api"
implementation "com.google.code.findbugs:jsr305:$jsr305Version"
implementation "org.slf4j:slf4j-api:$slf4jVersion"

testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")
testImplementation testFixtures(project(":servicetalk-concurrent-api"))
testImplementation testFixtures(project(":servicetalk-concurrent-internal"))
testImplementation project(":servicetalk-test-resources")
Expand Down
5 changes: 0 additions & 5 deletions servicetalk-client-api-internal/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
org.jctools:jctools-core:4.0.3=runtimeClasspath
org.slf4j:slf4j-api:1.7.36=compileClasspath,runtimeClasspath
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor
8 changes: 3 additions & 5 deletions servicetalk-client-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
api platform(project(":servicetalk-dependencies"))
testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")

api project(":servicetalk-concurrent-api")
api project(":servicetalk-transport-api")

implementation project(":servicetalk-annotations")
implementation project(":servicetalk-concurrent-api-internal")
implementation project(":servicetalk-concurrent-internal")
implementation "com.google.code.findbugs:jsr305"
implementation "org.slf4j:slf4j-api"
implementation "com.google.code.findbugs:jsr305:$jsr305Version"
implementation "org.slf4j:slf4j-api:$slf4jVersion"

testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")
testImplementation testFixtures(project(":servicetalk-concurrent-api"))
testImplementation testFixtures(project(":servicetalk-concurrent-internal"))
testImplementation project(":servicetalk-concurrent-test-internal")
Expand Down
5 changes: 0 additions & 5 deletions servicetalk-client-api/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
org.jctools:jctools-core:4.0.3=runtimeClasspath
org.slf4j:slf4j-api:1.7.36=compileClasspath,runtimeClasspath
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor
8 changes: 3 additions & 5 deletions servicetalk-concurrent-api-internal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
implementation platform(project(":servicetalk-dependencies"))
testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")

api project(":servicetalk-concurrent-api")
api project(":servicetalk-oio-api")

testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")
implementation project(":servicetalk-annotations")
implementation project(":servicetalk-buffer-api") // Buffer based Concurrent conversions
implementation project(":servicetalk-concurrent-api")
implementation project(":servicetalk-concurrent-internal")
implementation project(":servicetalk-utils-internal")
implementation "com.google.code.findbugs:jsr305"
implementation "org.slf4j:slf4j-api"
implementation "com.google.code.findbugs:jsr305:$jsr305Version"
implementation "org.slf4j:slf4j-api:$slf4jVersion"

testImplementation testFixtures(project(":servicetalk-concurrent-api"))
testImplementation testFixtures(project(":servicetalk-concurrent-internal"))
Expand Down
5 changes: 0 additions & 5 deletions servicetalk-concurrent-api-internal/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
org.jctools:jctools-core:4.0.3=runtimeClasspath
org.slf4j:slf4j-api:1.7.36=compileClasspath,runtimeClasspath
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor
6 changes: 2 additions & 4 deletions servicetalk-concurrent-api-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@
apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

dependencies {
implementation platform(project(":servicetalk-dependencies"))
testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")

api project(":servicetalk-concurrent-api")

implementation project(":servicetalk-annotations")
implementation project(":servicetalk-concurrent-internal")
implementation project(":servicetalk-concurrent-test-internal")
implementation project(":servicetalk-utils-internal")
implementation "com.google.code.findbugs:jsr305"
implementation "com.google.code.findbugs:jsr305:$jsr305Version"

testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")
testImplementation testFixtures(project(":servicetalk-concurrent-internal"))
testImplementation testFixtures(project(":servicetalk-concurrent-api"))
testImplementation project(":servicetalk-test-resources")
Expand Down
5 changes: 0 additions & 5 deletions servicetalk-concurrent-api-test/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson:jackson-bom:2.16.2=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.protobuf:protobuf-bom:3.25.3=compileClasspath,runtimeClasspath
io.netty:netty-bom:4.1.113.Final=compileClasspath,runtimeClasspath
org.apache.logging.log4j:log4j-bom:2.23.1=compileClasspath,runtimeClasspath
org.glassfish.jersey:jersey-bom:2.41=compileClasspath,runtimeClasspath
org.jctools:jctools-core:4.0.3=runtimeClasspath
org.slf4j:slf4j-api:1.7.36=runtimeClasspath
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor
Loading

0 comments on commit 9e310cc

Please sign in to comment.