Skip to content

Commit

Permalink
Fix "older Jackson versions" tests in :nessie-client (#7820)
Browse files Browse the repository at this point in the history
The "older Jackson version" tests all run with the _latest_ Jackson version, because a `platform()` dependency takes precedence over "normal" version constraints, but a `version { strictly(...) }` can override a `platform()`.

This change updates the dependency decls for older Jackson versions.

Before this change:
```
$ ./gradlew :nessie-client:dependencies --configuration testJackson_2_11_4RuntimeClasspath
...
testJackson_2_11_4RuntimeClasspath - Runtime classpath of source set 'test jackson 2 11 4'.
+--- project :nessie-model
|    +--- com.fasterxml.jackson:jackson-bom:2.16.0
|    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.16.0 (c)
|    |    +--- com.fasterxml.jackson.core:jackson-core:2.16.0 (c)
|    |    \--- com.fasterxml.jackson.core:jackson-databind:2.16.0 (c)
|    +--- com.fasterxml.jackson.core:jackson-databind -> 2.16.0
|    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.16.0
|    |    |    \--- com.fasterxml.jackson:jackson-bom:2.16.0 (*)
|    |    +--- com.fasterxml.jackson.core:jackson-core:2.16.0
|    |    |    \--- com.fasterxml.jackson:jackson-bom:2.16.0 (*)
|    |    \--- com.fasterxml.jackson:jackson-bom:2.16.0 (*)
|    \--- com.fasterxml.jackson.core:jackson-annotations -> 2.16.0 (*)
+--- com.fasterxml.jackson:jackson-bom:2.16.0 (*)
+--- com.fasterxml.jackson.core:jackson-core -> 2.16.0 (*)
+--- com.fasterxml.jackson.core:jackson-databind -> 2.16.0 (*)
+--- com.fasterxml.jackson.core:jackson-annotations -> 2.16.0 (*)
```

After this change:
```
$ ./gradlew :nessie-client:dependencies --configuration testJackson_2_11_4RuntimeClasspath
...
testJackson_2_11_4RuntimeClasspath - Runtime classpath of source set 'test jackson 2 11 4'.
+--- project :nessie-model
|    +--- com.fasterxml.jackson:jackson-bom:2.16.0
|    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.16.0 -> 2.11.4 (c)
|    |    +--- com.fasterxml.jackson.core:jackson-core:2.16.0 -> 2.11.4 (c)
|    |    \--- com.fasterxml.jackson.core:jackson-databind:2.16.0 -> 2.11.4 (c)
|    +--- com.fasterxml.jackson.core:jackson-databind -> 2.11.4
|    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.11.4
|    |    \--- com.fasterxml.jackson.core:jackson-core:2.11.4
|    \--- com.fasterxml.jackson.core:jackson-annotations -> 2.11.4
+--- com.fasterxml.jackson:jackson-bom:2.16.0 (*)
+--- com.fasterxml.jackson.core:jackson-core -> 2.11.4
+--- com.fasterxml.jackson.core:jackson-databind -> 2.11.4 (*)
+--- com.fasterxml.jackson.core:jackson-annotations -> 2.11.4
```
  • Loading branch information
snazy authored Dec 7, 2023
1 parent ed196b1 commit 6ddc5b4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions api/client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ val jacksonTestVersions =
fun JvmComponentDependencies.forJacksonVersion(jacksonVersion: String) {
implementation(project())

implementation("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
implementation("com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion")
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
implementation("com.fasterxml.jackson.core:jackson-core") { version { strictly(jacksonVersion) } }
implementation("com.fasterxml.jackson.core:jackson-annotations") {
version { strictly(jacksonVersion) }
}
implementation("com.fasterxml.jackson.core:jackson-databind") {
version { strictly(jacksonVersion) }
}
}

@Suppress("UnstableApiUsage")
Expand Down

0 comments on commit 6ddc5b4

Please sign in to comment.