From 3450daa1ad45b1d7039067fb3701121ea85e6a68 Mon Sep 17 00:00:00 2001 From: Andy Kwok Date: Thu, 6 Feb 2025 20:20:01 -0800 Subject: [PATCH] Build: Centralise dependencies version - Pt1 (#3294) * Centralise dep versions --------- Signed-off-by: Andy Kwok --- async-query/build.gradle | 6 +++--- build.gradle | 13 ++++++++++++- common/build.gradle | 10 +++++----- core/build.gradle | 10 +++++----- datasources/build.gradle | 8 ++++---- integ-test/build.gradle | 6 +++--- legacy/build.gradle | 8 ++++---- opensearch/build.gradle | 8 ++++---- plugin/build.gradle | 7 +++---- ppl/build.gradle | 4 ++-- prometheus/build.gradle | 8 ++++---- protocol/build.gradle | 6 +++--- spark/build.gradle | 6 +++--- sql/build.gradle | 6 +++--- 14 files changed, 58 insertions(+), 48 deletions(-) diff --git a/async-query/build.gradle b/async-query/build.gradle index fba74aa216..6ca61dd8b5 100644 --- a/async-query/build.gradle +++ b/async-query/build.gradle @@ -28,13 +28,13 @@ dependencies { implementation group: 'org.json', name: 'json', version: '20231013' api group: 'com.amazonaws', name: 'aws-java-sdk-emr', version: "${aws_java_sdk_version}" api group: 'com.amazonaws', name: 'aws-java-sdk-emrserverless', version: "${aws_java_sdk_version}" - implementation group: 'commons-io', name: 'commons-io', version: '2.14.0' + implementation group: 'commons-io', name: 'commons-io', version: "${commons_io_version}" testImplementation(platform("org.junit:junit-bom:5.9.3")) testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' - testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0' + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${mockito_version}" testCompileOnly('junit:junit:4.13.1') { exclude group: 'org.hamcrest', module: 'hamcrest-core' diff --git a/build.gradle b/build.gradle index 702d6f478a..33ac741673 100644 --- a/build.gradle +++ b/build.gradle @@ -49,8 +49,19 @@ buildscript { getPrometheusBinaryLocation = { -> return "https://github.com/prometheus/prometheus/releases/download/v${prometheus_binary_version}/prometheus-${prometheus_binary_version}."+ getOSFamilyType() + "-" + getArchType() + ".tar.gz" } + // TODO: Migrate following to Gradle version catalog || Read from OpenSearch BOM in the future. + // See: https://github.com/opensearch-project/sql/issues/3257 aws_java_sdk_version = "1.12.651" guava_version = "32.1.3-jre" + resilience4j_version = "1.5.0" + hamcrest_version = "2.1" + mockito_version = "5.7.0" + commons_io_version = "2.14.0" + commons_text_version = "1.10.0" + commons_lang3_version = "3.12.0" + // enforce 1.13, https://www.whitesourcesoftware.com/vulnerability-database/WS-2019-0379 + commons_codec_version = "1.13" + commons_logging_version = "1.2" } repositories { @@ -192,7 +203,7 @@ configurations.all { resolutionStrategy.force 'junit:junit:4.13.2' exclude group: "commons-logging", module: "commons-logging" // enforce 1.1.3, https://www.whitesourcesoftware.com/vulnerability-database/WS-2019-0379 - resolutionStrategy.force 'commons-codec:commons-codec:1.13' + resolutionStrategy.force "commons-codec:commons-codec:${commons_codec_version}" resolutionStrategy.force "com.google.guava:guava:${guava_version}" } diff --git a/common/build.gradle b/common/build.gradle index 15c48dd6b3..171e9accb3 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -36,8 +36,8 @@ dependencies { api "org.antlr:antlr4-runtime:4.7.1" api group: 'com.google.guava', name: 'guava', version: "${guava_version}" api group: 'org.apache.logging.log4j', name: 'log4j-core', version:"${versions.log4j}" - api group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' - api group: 'org.apache.commons', name: 'commons-text', version: '1.10.0' + api group: 'org.apache.commons', name: 'commons-lang3', version: "${commons_lang3_version}" + api group: 'org.apache.commons', name: 'commons-text', version: "${commons_text_version}" api group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.12.0' implementation 'com.github.babbel:okhttp-aws-signer:1.0.2' api group: 'com.amazonaws', name: 'aws-java-sdk-core', version: "${aws_java_sdk_version}" @@ -47,10 +47,10 @@ dependencies { testImplementation group: 'junit', name: 'junit', version: '4.13.2' testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1' testImplementation group: 'com.google.guava', name: 'guava', version: "${guava_version}" - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}" testImplementation('org.junit.jupiter:junit-jupiter:5.9.3') - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' - testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0' + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${mockito_version}" testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.12.0' } diff --git a/core/build.gradle b/core/build.gradle index c596251342..c583c9c646 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -47,8 +47,8 @@ pitest { dependencies { api group: 'com.google.guava', name: 'guava', version: "${guava_version}" - api group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' - api group: 'org.apache.commons', name: 'commons-text', version: '1.10.0' + api group: 'org.apache.commons', name: 'commons-lang3', version: "${commons_lang3_version}" + api group: 'org.apache.commons', name: 'commons-text', version: "${commons_text_version}" api group: 'com.facebook.presto', name: 'presto-matching', version: '0.240' api group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' api "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" @@ -60,9 +60,9 @@ dependencies { implementation "com.github.seancfoley:ipaddress:5.4.2" testImplementation('org.junit.jupiter:junit-jupiter:5.9.3') - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' - testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}" + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${mockito_version}" } spotless { diff --git a/datasources/build.gradle b/datasources/build.gradle index 1d1127ad0d..1c99c5c524 100644 --- a/datasources/build.gradle +++ b/datasources/build.gradle @@ -21,7 +21,7 @@ dependencies { implementation group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}" implementation group: 'org.opensearch', name: 'opensearch-x-content', version: "${opensearch_version}" implementation group: 'org.opensearch', name: 'common-utils', version: "${opensearch_build}" - implementation group: 'commons-io', name: 'commons-io', version: '2.14.0' + implementation group: 'commons-io', name: 'commons-io', version: "${commons_io_version}" // FIXME. upgrade aws-encryption-sdk-java once the bouncycastle dependency update to 1.78. implementation ('com.amazonaws:aws-encryption-sdk-java:2.4.1') { exclude group: 'org.bouncycastle', module: 'bcprov-ext-jdk18on' @@ -33,9 +33,9 @@ dependencies { testImplementation group: 'junit', name: 'junit', version: '4.13.2' testImplementation('org.junit.jupiter:junit-jupiter:5.9.3') testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.14.9' - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' - testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}" + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${mockito_version}" testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3' } diff --git a/integ-test/build.gradle b/integ-test/build.gradle index 91ecaa0f6f..4ef4b81151 100644 --- a/integ-test/build.gradle +++ b/integ-test/build.gradle @@ -156,9 +156,9 @@ loggerUsageCheck.enabled = false configurations.all { resolutionStrategy.force 'junit:junit:4.13.2' - resolutionStrategy.force "commons-logging:commons-logging:1.2" + resolutionStrategy.force "commons-logging:commons-logging:${commons_logging_version}" // enforce 1.1.3, https://www.whitesourcesoftware.com/vulnerability-database/WS-2019-0379 - resolutionStrategy.force 'commons-codec:commons-codec:1.13' + resolutionStrategy.force "commons-codec:commons-codec:${commons_codec_version}" resolutionStrategy.force "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" resolutionStrategy.force "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}" resolutionStrategy.force "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${versions.jackson}" @@ -183,7 +183,7 @@ dependencies { testImplementation group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}" testImplementation group: 'org.opensearch.client', name: 'opensearch-rest-client', version: "${opensearch_version}" testImplementation group: 'org.opensearch.driver', name: 'opensearch-sql-jdbc', version: System.getProperty("jdbcDriverVersion", '1.2.0.0') - testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.1' + testImplementation group: 'org.hamcrest', name: 'hamcrest', version: "${hamcrest_version}" implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version:"${versions.log4j}" testImplementation project(':opensearch-sql-plugin') testImplementation project(':legacy') diff --git a/legacy/build.gradle b/legacy/build.gradle index e3ddf27066..cb5afb3111 100644 --- a/legacy/build.gradle +++ b/legacy/build.gradle @@ -103,14 +103,14 @@ dependencies { implementation group: "org.opensearch.plugin", name: 'parent-join-client', version: "${opensearch_version}" implementation group: "org.opensearch.plugin", name: 'reindex-client', version: "${opensearch_version}" constraints { - implementation('commons-codec:commons-codec:1.13') { + implementation("commons-codec:commons-codec:${commons_codec_version}") { because 'https://www.whitesourcesoftware.com/vulnerability-database/WS-2019-0379' } } implementation group: 'com.google.guava', name: 'guava', version: "${guava_version}" implementation group: 'org.json', name: 'json', version:'20231013' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' - implementation group: 'org.apache.commons', name: 'commons-text', version: '1.10.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: "${commons_lang3_version}" + implementation group: 'org.apache.commons', name: 'commons-text', version: "${commons_text_version}" implementation group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}" // add geo module as dependency. https://github.com/opensearch-project/OpenSearch/pull/4180/. implementation group: 'org.opensearch.plugin', name: 'geo', version: "${opensearch_version}" @@ -124,7 +124,7 @@ dependencies { compileOnly group: 'javax.servlet', name: 'servlet-api', version:'2.5' testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version:'2.2' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" testImplementation group: 'junit', name: 'junit', version: '4.13.2' } diff --git a/opensearch/build.gradle b/opensearch/build.gradle index 97d6148641..14b80eda8d 100644 --- a/opensearch/build.gradle +++ b/opensearch/build.gradle @@ -33,7 +33,7 @@ plugins { dependencies { api project(':core') api group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}" - implementation "io.github.resilience4j:resilience4j-retry:1.5.0" + implementation "io.github.resilience4j:resilience4j-retry:${resilience4j_version}" implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${versions.jackson}" implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${versions.jackson_databind}" implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: "${versions.jackson}" @@ -47,9 +47,9 @@ dependencies { testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.9.3') testRuntimeOnly('org.junit.platform:junit-platform-launcher:1.9.3') - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' - testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}" + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${mockito_version}" testImplementation group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}" testImplementation group: 'org.opensearch.test', name: 'framework', version: "${opensearch_version}" } diff --git a/plugin/build.gradle b/plugin/build.gradle index 9df3d3dd48..639ff88ef8 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -96,11 +96,10 @@ thirdPartyAudit.enabled = false configurations.all { // conflict with spring-jcl - resolutionStrategy.force "commons-logging:commons-logging:1.2" + resolutionStrategy.force "commons-logging:commons-logging:${commons_logging_version}" // enforce 2.12.6, https://github.com/opensearch-project/sql/issues/424 resolutionStrategy.force "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - // enforce 1.1.3, https://www.whitesourcesoftware.com/vulnerability-database/WS-2019-0379 - resolutionStrategy.force 'commons-codec:commons-codec:1.13' + resolutionStrategy.force "commons-codec:commons-codec:${commons_codec_version}" resolutionStrategy.force "com.google.guava:guava:${guava_version}" resolutionStrategy.force 'com.google.guava:failureaccess:1.0.2' resolutionStrategy.force "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}" @@ -165,7 +164,7 @@ dependencies { api project(':async-query') testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.14.9' - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}" testImplementation group: 'org.mockito', name: 'mockito-core', version: "${versions.mockito}" testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${versions.mockito}" testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3' diff --git a/ppl/build.gradle b/ppl/build.gradle index 2a3d6bdbf9..4405a7ebc6 100644 --- a/ppl/build.gradle +++ b/ppl/build.gradle @@ -56,8 +56,8 @@ dependencies { api project(':protocol') testImplementation group: 'junit', name: 'junit', version: '4.13.2' - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}" + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" testImplementation(testFixtures(project(":core"))) } diff --git a/prometheus/build.gradle b/prometheus/build.gradle index 7a3b3f7af6..5060ed6f10 100644 --- a/prometheus/build.gradle +++ b/prometheus/build.gradle @@ -18,16 +18,16 @@ dependencies { implementation project(':datasources') implementation group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}" - implementation "io.github.resilience4j:resilience4j-retry:1.5.0" + implementation "io.github.resilience4j:resilience4j-retry:${resilience4j_version}" implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${versions.jackson}" implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${versions.jackson_databind}" implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: "${versions.jackson}" implementation group: 'org.json', name: 'json', version: '20231013' testImplementation('org.junit.jupiter:junit-jupiter:5.9.3') - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' - testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}" + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${mockito_version}" testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.12.0' } diff --git a/protocol/build.gradle b/protocol/build.gradle index b5d7929041..4feb93b20e 100644 --- a/protocol/build.gradle +++ b/protocol/build.gradle @@ -39,9 +39,9 @@ dependencies { implementation project(':opensearch') testImplementation('org.junit.jupiter:junit-jupiter:5.9.3') - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' - testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}" + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${mockito_version}" } configurations.all { diff --git a/spark/build.gradle b/spark/build.gradle index 103c017791..deae891166 100644 --- a/spark/build.gradle +++ b/spark/build.gradle @@ -21,13 +21,13 @@ dependencies { implementation group: 'org.json', name: 'json', version: '20231013' api group: 'com.amazonaws', name: 'aws-java-sdk-emr', version: "${aws_java_sdk_version}" api group: 'com.amazonaws', name: 'aws-java-sdk-emrserverless', version: "${aws_java_sdk_version}" - implementation group: 'commons-io', name: 'commons-io', version: '2.14.0' + implementation group: 'commons-io', name: 'commons-io', version: "${commons_io_version}" testImplementation(platform("org.junit:junit-bom:5.9.3")) testCompileOnly('org.junit.jupiter:junit-jupiter') - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' - testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0' + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${mockito_version}" testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") { exclude group: 'org.hamcrest', module: 'hamcrest-core' diff --git a/sql/build.gradle b/sql/build.gradle index 10bb4b24bb..c771b5af5c 100644 --- a/sql/build.gradle +++ b/sql/build.gradle @@ -53,9 +53,9 @@ dependencies { api project(':protocol') testImplementation('org.junit.jupiter:junit-jupiter:5.9.3') - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0' - testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.7.0' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrest_version}" + testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: "${mockito_version}" testImplementation(testFixtures(project(":core"))) }