From a3168e3a2f63c00fbe2fbb9ffa4f9e842dd6ae7e Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 4 Nov 2024 10:31:31 +0000 Subject: [PATCH] Centralize dependency management of Commons Compress Closes gh-39368 --- spring-boot-project/spring-boot-parent/build.gradle | 7 +++++++ .../spring-boot-buildpack-platform/build.gradle | 13 +------------ .../spring-boot-gradle-plugin/build.gradle | 13 +------------ .../spring-boot-loader-tools/build.gradle | 8 +------- 4 files changed, 10 insertions(+), 31 deletions(-) diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index bb7b21099eee..bfa6e0092a93 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -33,6 +33,13 @@ bom { ] } } + library("Commons Compress", "1.21") { + group("org.apache.commons") { + modules = [ + "commons-compress" + ] + } + } library("Commons FileUpload", "1.5") { group("commons-fileupload") { modules = [ diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle index ae3cb4dc163e..43e107f410d2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle @@ -19,17 +19,6 @@ configurations.all { if (dependency.requested.group.equals("org.springframework")) { dependency.useVersion("$springFramework60xVersion") } - // We manage the version of commons-compress here rather than - // in spring-boot-parent to minimize conflicts with Testcontainers - if (dependency.requested.group.equals("org.apache.commons") - && dependency.requested.name.equals("commons-compress")) { - dependency.useVersion("$commonsCompressVersion") - } - // Downgrade Testcontainers for compatibility with the managed - // version of Commons Compress. - if (dependency.requested.group.equals("org.testcontainers")) { - dependency.useVersion("1.19.3") - } } } } @@ -38,7 +27,7 @@ dependencies { api("com.fasterxml.jackson.core:jackson-databind") api("com.fasterxml.jackson.module:jackson-module-parameter-names") api("net.java.dev.jna:jna-platform") - api("org.apache.commons:commons-compress:$commonsCompressVersion") + api("org.apache.commons:commons-compress") api("org.apache.httpcomponents.client5:httpclient5") api("org.springframework:spring-core") api("org.tomlj:tomlj:1.0.0") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle index 6408d4167ad5..9f54ca0afe8b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle @@ -59,17 +59,6 @@ configurations { if (dependency.requested.group.equals("org.springframework")) { dependency.useVersion("$springFramework60xVersion") } - // We manage the version of commons-compress here rather than - // in spring-boot-parent to minimize conflicts with Testcontainers - if (dependency.requested.group.equals("org.apache.commons") - && dependency.requested.name.equals("commons-compress")) { - dependency.useVersion("$commonsCompressVersion") - } - // Downgrade Testcontainers for compatibility with the managed - // version of Commons Compress. - if (dependency.requested.group.equals("org.testcontainers")) { - dependency.useVersion("1.19.3") - } } } } @@ -93,7 +82,7 @@ dependencies { implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform")) implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools")) implementation("io.spring.gradle:dependency-management-plugin") - implementation("org.apache.commons:commons-compress:$commonsCompressVersion") + implementation("org.apache.commons:commons-compress") implementation("org.springframework:spring-core") optional("org.graalvm.buildtools:native-gradle-plugin") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle index d61acca5692a..4ce98c43d6c5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle @@ -28,19 +28,13 @@ configurations { if (dependency.requested.group.equals("org.springframework")) { dependency.useVersion("$springFramework60xVersion") } - // We manage the version of commons-compress here rather than - // in spring-boot-parent to minimize conflicts with Testcontainers - if (dependency.requested.group.equals("org.apache.commons") - && dependency.requested.name.equals("commons-compress")) { - dependency.useVersion("$commonsCompressVersion") - } } } } } dependencies { - api("org.apache.commons:commons-compress:$commonsCompressVersion") + api("org.apache.commons:commons-compress") api("org.springframework:spring-core") compileOnly("ch.qos.logback:logback-classic")