Skip to content

Commit

Permalink
fix: servicetalk-data-jackson dependency scopes (#2198)
Browse files Browse the repository at this point in the history
Motivation:
The `servicetalk-data-jackson-jersey` module exposes types that are
located in the `servicetalk-data-jackson` module. Similarly, the
`servicetalk-data-jackson` module exposes types that are in the
`servicetalk-serializer-api` and `servicetalk-serialization-api` modules.
Dependencies that contain types exposed in a module's API should be imported using `api` scope but currently these dependencies are imported using only `implementation` scope. Attempting to use the types results in a `ClassNotFoundException`.

Modifications:
- Change `servicetalk-data-jackson` to an `api` dependency of `servicetalk-data-jackson-jersey`
- Change `servicetalk-serializer-api` and `servicetalk-serialization-api` to `api` dependencies of `servicetalk-data-jackson`

Result:
Consumers of the `servicetalk-data-jackson-jersey` and `servicetalk-data-jackson` modules will be able to reference all types exposed in these modules' APIs without class not found errors or the need to explicitly import `servicetalk-data-jackson`, `servicetalk-serializer-api` or `servicetalk-serialization-api` modules.
  • Loading branch information
eddie4941 authored Apr 19, 2022
1 parent 42b1c49 commit dc03468
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion servicetalk-data-jackson-jersey/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ dependencies {
testImplementation enforcedPlatform("org.glassfish.jersey:jersey-bom:$jerseyVersion")
testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")

api project(":servicetalk-data-jackson")
api "jakarta.ws.rs:jakarta.ws.rs-api:$jaxRsVersion" // MediaType, Feature
api "org.glassfish.jersey.core:jersey-common" // AutoDiscoverable

implementation project(":servicetalk-annotations")
implementation project(":servicetalk-buffer-netty")
implementation project(":servicetalk-concurrent-api-internal")
implementation project(":servicetalk-concurrent-internal")
implementation project(":servicetalk-data-jackson")
implementation project(":servicetalk-http-api")
implementation project(":servicetalk-http-router-jersey")
implementation project(":servicetalk-http-router-jersey-internal")
Expand Down
6 changes: 2 additions & 4 deletions servicetalk-data-jackson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library"
dependencies {
testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")

api project(":servicetalk-serialization-api")
api project(":servicetalk-serializer-api")
api "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
api project(":servicetalk-buffer-api")
api project(":servicetalk-concurrent-api")

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

testImplementation testFixtures(project(":servicetalk-concurrent-api"))
Expand Down

0 comments on commit dc03468

Please sign in to comment.