From 30966d6be53a99e7af880d7a11603d57cdc98da7 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Wed, 9 Oct 2024 17:29:24 -0700 Subject: [PATCH] Force tests jackson dependencies to 2.18 (#911) * Force tests jackson dependencies to 2.18 Signed-off-by: Owais * Replaced version with variable Signed-off-by: Owais --------- Signed-off-by: Owais --- build.gradle | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index e5bc757b..ba4515da 100644 --- a/build.gradle +++ b/build.gradle @@ -189,9 +189,16 @@ dependencies { implementation "io.swagger.parser.v3:swagger-parser-core:${swaggerVersion}" implementation "io.swagger.parser.v3:swagger-parser:${swaggerVersion}" implementation "io.swagger.parser.v3:swagger-parser-v3:${swaggerVersion}" - implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}" - implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}" + // Declare and force Jackson dependencies for tests + testImplementation("com.fasterxml.jackson.core:jackson-databind") { + version { strictly("${jacksonVersion}") } + } + testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") { + version { strictly("${jacksonVersion}") } + } + testImplementation("com.fasterxml.jackson.core:jackson-annotations") { + version { strictly("${jacksonVersion}") } + } // ZipArchive dependencies used for integration tests zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${opensearch_build}" @@ -202,7 +209,7 @@ dependencies { configurations.all { resolutionStrategy { force("com.google.guava:guava:33.3.1-jre") // CVE for 31.1, keep to force transitive dependencies - force("com.fasterxml.jackson.core:jackson-core:2.18.0") // Dependency Jar Hell + force("com.fasterxml.jackson.core:jackson-core:${jacksonVersion}") // Dependency Jar Hell force("org.apache.httpcomponents.core5:httpcore5:5.3") // Dependency Jar Hell } }