Skip to content

Commit 84ae902

Browse files
authored
Change Jackson dependency to get version from core to avoid jar hell (#997)
* Change Jackson dependency to get version from core to avoid jar hell Signed-off-by: Daniel Widdis <[email protected]> * Remove unneded line Signed-off-by: Daniel Widdis <[email protected]> --------- Signed-off-by: Daniel Widdis <[email protected]>
1 parent 33579a3 commit 84ae902

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

build.gradle

+5-13
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import java.nio.file.Files
22
import org.opensearch.gradle.testclusters.OpenSearchCluster
33
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask
44
import org.opensearch.gradle.test.RestIntegTestTask
5+
import org.opensearch.gradle.VersionProperties
56
import java.util.concurrent.Callable
67
import java.nio.file.Paths
78

@@ -35,9 +36,7 @@ buildscript {
3536

3637
isSameMajorVersion = opensearch_version.split("\\.")[0] == bwcVersionShort.split("\\.")[0]
3738
swaggerVersion = "2.1.24"
38-
jacksonVersion = "2.18.1"
3939
swaggerCoreVersion = "2.2.28"
40-
4140
}
4241

4342
repositories {
@@ -189,16 +188,10 @@ dependencies {
189188
implementation "io.swagger.parser.v3:swagger-parser-core:${swaggerVersion}"
190189
implementation "io.swagger.parser.v3:swagger-parser:${swaggerVersion}"
191190
implementation "io.swagger.parser.v3:swagger-parser-v3:${swaggerVersion}"
192-
// Declare and force Jackson dependencies for tests
193-
testImplementation("com.fasterxml.jackson.core:jackson-databind") {
194-
version { strictly("${jacksonVersion}") }
195-
}
196-
testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") {
197-
version { strictly("${jacksonVersion}") }
198-
}
199-
testImplementation("com.fasterxml.jackson.core:jackson-annotations") {
200-
version { strictly("${jacksonVersion}") }
201-
}
191+
// Declare Jackson dependencies for tests (from OpenSearch version catalog)
192+
testImplementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
193+
testImplementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
194+
testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson_databind}"
202195

203196
// ZipArchive dependencies used for integration tests
204197
zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${opensearch_build}"
@@ -209,7 +202,6 @@ dependencies {
209202
configurations.all {
210203
resolutionStrategy {
211204
force("com.google.guava:guava:33.4.0-jre") // CVE for 31.1, keep to force transitive dependencies
212-
force("com.fasterxml.jackson.core:jackson-core:${jacksonVersion}") // Dependency Jar Hell
213205
force("org.apache.httpcomponents.core5:httpcore5:5.3.2") // Dependency Jar Hell
214206
}
215207
}

0 commit comments

Comments
 (0)