From 6fceab2c90aab00d9908004faa82ea87640fbe3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Wed, 7 May 2025 11:47:52 -0700 Subject: [PATCH] Replace spring-jcl with vanilla commons-logging See gh-45487 Co-authored-by: Phillip Webb --- ...eckClasspathForProhibitedDependencies.java | 4 +- buildSrc/src/test/resources/bom.gradle | 12 ++---- .../build.gradle | 21 +++------- .../spring-boot-actuator/build.gradle | 8 +--- .../spring-boot-autoconfigure/build.gradle | 32 ++++----------- .../spring-boot-dependencies/build.gradle | 39 +++++++++---------- .../spring-boot-docs/build.gradle | 13 ++----- .../spring-boot-starter-artemis/build.gradle | 4 +- .../build.gradle | 5 +-- .../spring-boot-test/build.gradle | 5 +-- .../spring-boot-testcontainers/build.gradle | 12 ++---- .../build.gradle | 4 +- .../spring-boot-gradle-plugin/build.gradle | 4 +- .../boot/maven/JarIntegrationTests.java | 21 +++++----- .../boot/maven/TestRunIntegrationTests.java | 4 +- .../boot/maven/WarIntegrationTests.java | 10 ++--- spring-boot-project/spring-boot/build.gradle | 8 +--- .../spring-boot-smoke-test-kafka/build.gradle | 4 +- .../spring-boot-smoke-test-test/build.gradle | 5 +-- 19 files changed, 70 insertions(+), 145 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java index 70d39f01946..25a4f76dc5c 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ import org.gradle.api.tasks.TaskAction; public abstract class CheckClasspathForProhibitedDependencies extends DefaultTask { private static final Set PROHIBITED_GROUPS = Set.of("org.codehaus.groovy", "org.eclipse.jetty.toolchain", - "commons-logging", "org.apache.geronimo.specs", "com.sun.activation"); + "org.apache.geronimo.specs", "com.sun.activation"); private static final Set PERMITTED_JAVAX_GROUPS = Set.of("javax.batch", "javax.cache", "javax.money"); diff --git a/buildSrc/src/test/resources/bom.gradle b/buildSrc/src/test/resources/bom.gradle index 03d7288b155..d38d7219da2 100644 --- a/buildSrc/src/test/resources/bom.gradle +++ b/buildSrc/src/test/resources/bom.gradle @@ -7,18 +7,14 @@ bom { "activemq-broker", "activemq-camel", "activemq-client", - "activemq-console" { - exclude group: "commons-logging", module: "commons-logging" - }, + "activemq-console", "activemq-http", "activemq-jaas", "activemq-jdbc-store", "activemq-jms-pool", "activemq-kahadb-store", "activemq-karaf", - "activemq-leveldb-store" { - exclude group: "commons-logging", module: "commons-logging" - }, + "activemq-leveldb-store", "activemq-log4j-appender", "activemq-mqtt", "activemq-openwire-generator", @@ -30,9 +26,7 @@ bom { "activemq-run", "activemq-runtime-config", "activemq-shiro", - "activemq-spring" { - exclude group: "commons-logging", module: "commons-logging" - }, + "activemq-spring", "activemq-stomp", "activemq-web" ] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index cdea05e055d..91d4c30dbf1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -51,7 +51,6 @@ dependencies { optional("io.micrometer:micrometer-registry-otlp") optional("io.micrometer:micrometer-registry-prometheus") optional("io.micrometer:micrometer-registry-stackdriver") { - exclude group: "commons-logging", module: "commons-logging" exclude group: "javax.annotation", module: "javax.annotation-api" } optional("io.micrometer:micrometer-registry-signalfx") @@ -71,9 +70,7 @@ dependencies { optional("javax.cache:cache-api") optional("org.apache.activemq:activemq-broker") optional("org.apache.activemq:activemq-client") - optional("org.apache.commons:commons-dbcp2") { - exclude group: "commons-logging", module: "commons-logging" - } + optional("org.apache.commons:commons-dbcp2") optional("org.apache.kafka:kafka-clients") optional("org.apache.kafka:kafka-streams") optional("org.apache.logging.log4j:log4j-api") @@ -87,9 +84,7 @@ dependencies { optional("org.eclipse.jetty:jetty-server") { exclude group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api" } - optional("org.elasticsearch.client:elasticsearch-rest-client") { - exclude group: "commons-logging", module: "commons-logging" - } + optional("org.elasticsearch.client:elasticsearch-rest-client") optional("org.flywaydb:flyway-core") optional("org.glassfish.jersey.core:jersey-server") optional("org.glassfish.jersey.containers:jersey-container-servlet-core") @@ -121,9 +116,7 @@ dependencies { optional("org.springframework.data:spring-data-ldap") optional("org.springframework.data:spring-data-mongodb") optional("org.springframework.data:spring-data-redis") - optional("org.springframework.data:spring-data-elasticsearch") { - exclude group: "commons-logging", module: "commons-logging" - } + optional("org.springframework.data:spring-data-elasticsearch") optional("org.springframework.graphql:spring-graphql") optional("org.springframework.integration:spring-integration-core") optional("org.springframework.kafka:spring-kafka") @@ -145,12 +138,8 @@ dependencies { testImplementation("io.undertow:undertow-core") testImplementation("io.undertow:undertow-servlet") testImplementation("jakarta.xml.bind:jakarta.xml.bind-api") - testImplementation("org.apache.activemq:artemis-jakarta-client") { - exclude group: "commons-logging", module: "commons-logging" - } - testImplementation("org.apache.activemq:artemis-jakarta-server") { - exclude group: "commons-logging", module: "commons-logging" - } + testImplementation("org.apache.activemq:artemis-jakarta-client") + testImplementation("org.apache.activemq:artemis-jakarta-server") testImplementation("org.apache.logging.log4j:log4j-to-slf4j") testImplementation("org.aspectj:aspectjrt") testImplementation("org.assertj:assertj-core") diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index bd257c7cb46..e35b134d825 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -53,9 +53,7 @@ dependencies { optional("org.eclipse.jetty:jetty-server") { exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") } - optional("org.elasticsearch.client:elasticsearch-rest-client") { - exclude(group: "commons-logging", module: "commons-logging") - } + optional("org.elasticsearch.client:elasticsearch-rest-client") optional("org.flywaydb:flyway-core") optional("org.glassfish.jersey.core:jersey-server") optional("org.glassfish.jersey.containers:jersey-container-servlet-core") @@ -79,9 +77,7 @@ dependencies { exclude group: "org.slf4j", module: "jcl-over-slf4j" } optional("org.springframework.data:spring-data-couchbase") - optional("org.springframework.data:spring-data-elasticsearch") { - exclude(group: "commons-logging", module: "commons-logging") - } + optional("org.springframework.data:spring-data-elasticsearch") optional("org.springframework.data:spring-data-ldap") optional("org.springframework.data:spring-data-mongodb") optional("org.springframework.data:spring-data-redis") diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index 5a50dd0f1ea..b5ba7164450 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -40,9 +40,7 @@ dependencies { dockerTestImplementation("org.testcontainers:pulsar") dockerTestImplementation("org.testcontainers:testcontainers") - optional("co.elastic.clients:elasticsearch-java") { - exclude group: "commons-logging", module: "commons-logging" - } + optional("co.elastic.clients:elasticsearch-java") optional("com.fasterxml.jackson.core:jackson-databind") optional("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor") optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") @@ -79,15 +77,9 @@ dependencies { optional("javax.money:money-api") optional("org.apache.activemq:activemq-broker") optional("org.apache.activemq:activemq-client") - optional("org.apache.activemq:artemis-jakarta-client") { - exclude group: "commons-logging", module: "commons-logging" - } - optional("org.apache.activemq:artemis-jakarta-server") { - exclude group: "commons-logging", module: "commons-logging" - } - optional("org.apache.commons:commons-dbcp2") { - exclude group: "commons-logging", module: "commons-logging" - } + optional("org.apache.activemq:artemis-jakarta-client") + optional("org.apache.activemq:artemis-jakarta-server") + optional("org.apache.commons:commons-dbcp2") optional("org.apache.httpcomponents.client5:httpclient5") optional("org.apache.httpcomponents.core5:httpcore5-reactive") optional("org.apache.kafka:kafka-streams") @@ -100,9 +92,7 @@ dependencies { optional("org.eclipse.angus:angus-mail") optional("com.github.ben-manes.caffeine:caffeine") optional("com.github.mxab.thymeleaf.extras:thymeleaf-extras-data-attribute") - optional("com.sendgrid:sendgrid-java") { - exclude group: "commons-logging", module: "commons-logging" - } + optional("com.sendgrid:sendgrid-java") optional("com.unboundid:unboundid-ldapsdk") optional("com.zaxxer:HikariCP") optional("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect") @@ -117,12 +107,8 @@ dependencies { classifier = 'jakarta' } } - optional("org.elasticsearch.client:elasticsearch-rest-client") { - exclude group: "commons-logging", module: "commons-logging" - } - optional("org.elasticsearch.client:elasticsearch-rest-client-sniffer") { - exclude group: "commons-logging", module: "commons-logging" - } + optional("org.elasticsearch.client:elasticsearch-rest-client") + optional("org.elasticsearch.client:elasticsearch-rest-client-sniffer") optional("org.flywaydb:flyway-core") optional("org.flywaydb:flyway-database-postgresql") optional("org.flywaydb:flyway-database-oracle") @@ -260,9 +246,7 @@ dependencies { testImplementation("org.springframework:spring-test") testImplementation("org.springframework:spring-core-test") testImplementation("org.springframework.graphql:spring-graphql-test") - testImplementation("org.springframework.kafka:spring-kafka-test") { - exclude group: "commons-logging", module: "commons-logging" - } + testImplementation("org.springframework.kafka:spring-kafka-test") testImplementation("org.springframework.pulsar:spring-pulsar-cache-provider-caffeine") testImplementation("org.springframework.security:spring-security-test") testImplementation("org.yaml:snakeyaml") diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 40a46d7ab7f..e6b9fa7a687 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -15,12 +15,8 @@ bom { library("ActiveMQ", "6.1.6") { group("org.apache.activemq") { modules = [ - "activemq-console" { - exclude group: "commons-logging", module: "commons-logging" - }, - "activemq-spring" { - exclude group: "commons-logging", module: "commons-logging" - } + "activemq-console", + "activemq-spring" ] bom("activemq-bom") } @@ -212,9 +208,7 @@ bom { library("Commons DBCP2", "2.13.0") { group("org.apache.commons") { modules = [ - "commons-dbcp2" { - exclude group: "commons-logging", module: "commons-logging" - } + "commons-dbcp2" ] } links { @@ -233,6 +227,17 @@ bom { releaseNotes("https://commons.apache.org/proper/commons-lang/changes-report.html#a{version}") } } + library("Commons Logging", "1.3.4") { + group("commons-logging") { + modules = [ + "commons-logging" + ] + } + links { + site("https://commons.apache.org/proper/commons-logging") + releaseNotes("https://commons.apache.org/proper/commons-logging/changes-report.html#a{version}") + } + } library("Commons Pool", "1.6") { group("commons-pool") { modules = [ @@ -348,12 +353,8 @@ bom { } group("org.elasticsearch.client") { modules = [ - "elasticsearch-rest-client" { - exclude group: "commons-logging", module: "commons-logging" - }, - "elasticsearch-rest-client-sniffer" { - exclude group: "commons-logging", module: "commons-logging" - }, + "elasticsearch-rest-client", + "elasticsearch-rest-client-sniffer" ] } group("co.elastic.clients") { @@ -599,9 +600,7 @@ bom { library("HtmlUnit", "4.11.1") { group("org.htmlunit") { modules = [ - "htmlunit" { - exclude group: "commons-logging", module: "commons-logging" - } + "htmlunit" ] } links { @@ -618,9 +617,7 @@ bom { } group("org.apache.httpcomponents") { modules = [ - "httpasyncclient" { - exclude group: "commons-logging", module: "commons-logging" - } + "httpasyncclient" ] } } diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index f2e221b018c..8084c7812d5 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -102,9 +102,7 @@ dependencies { implementation("jakarta.servlet:jakarta.servlet-api") implementation("jakarta.validation:jakarta.validation-api") implementation("org.apache.httpcomponents.client5:httpclient5") - implementation("org.apache.commons:commons-dbcp2") { - exclude group: "commons-logging", module: "commons-logging" - } + implementation("org.apache.commons:commons-dbcp2") implementation("org.apache.kafka:kafka-streams") implementation("org.apache.logging.log4j:log4j-to-slf4j") implementation("org.apache.tomcat.embed:tomcat-embed-core") @@ -119,7 +117,6 @@ dependencies { exclude group: "org.jboss.spec.javax.transaction", module: "jboss-transaction-api_1.2_spec" } implementation("org.htmlunit:htmlunit") { - exclude group: "commons-logging", module: "commons-logging" exclude group: "xml-apis", module: "xml-apis" } implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") @@ -142,9 +139,7 @@ dependencies { implementation("org.springframework.batch:spring-batch-core") implementation("org.springframework.data:spring-data-cassandra") implementation("org.springframework.data:spring-data-couchbase") - implementation("org.springframework.data:spring-data-elasticsearch") { - exclude group: "commons-logging", module: "commons-logging" - } + implementation("org.springframework.data:spring-data-elasticsearch") implementation("org.springframework.data:spring-data-envers") { exclude group: "javax.activation", module: "javax.activation-api" exclude group: "javax.persistence", module: "javax.persistence-api" @@ -159,9 +154,7 @@ dependencies { implementation("org.springframework.graphql:spring-graphql") implementation("org.springframework.graphql:spring-graphql-test") implementation("org.springframework.kafka:spring-kafka") - implementation("org.springframework.kafka:spring-kafka-test") { - exclude group: "commons-logging", module: "commons-logging" - } + implementation("org.springframework.kafka:spring-kafka-test") implementation("org.springframework.pulsar:spring-pulsar") implementation("org.springframework.pulsar:spring-pulsar-reactive") implementation("org.springframework.restdocs:spring-restdocs-mockmvc") diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle index c38a13d499a..60905defcf2 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle @@ -7,7 +7,5 @@ description = "Starter for JMS messaging using Apache Artemis" dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) api("org.springframework:spring-jms") - api("org.apache.activemq:artemis-jakarta-client") { - exclude group: "commons-logging", module: "commons-logging" - } + api("org.apache.activemq:artemis-jakarta-client") } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle index f26c6eb92e6..98d31dc7e38 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -43,12 +43,9 @@ dependencies { optional("com.jayway.jsonpath:json-path") optional("com.sun.xml.messaging.saaj:saaj-impl") optional("org.hibernate.orm:hibernate-core") - optional("org.htmlunit:htmlunit") { - exclude group: "commons-logging", module: "commons-logging" - } + optional("org.htmlunit:htmlunit") optional("org.junit.jupiter:junit-jupiter-api") optional("org.seleniumhq.selenium:htmlunit3-driver") { - exclude(group: "commons-logging", module: "commons-logging") exclude(group: "com.sun.activation", module: "jakarta.activation") } optional("org.seleniumhq.selenium:selenium-api") diff --git a/spring-boot-project/spring-boot-test/build.gradle b/spring-boot-project/spring-boot-test/build.gradle index dd73e9729a0..29b06e0fc1b 100644 --- a/spring-boot-project/spring-boot-test/build.gradle +++ b/spring-boot-project/spring-boot-test/build.gradle @@ -23,16 +23,13 @@ dependencies { optional("org.assertj:assertj-core") optional("org.hamcrest:hamcrest-core") optional("org.hamcrest:hamcrest-library") - optional("org.htmlunit:htmlunit") { - exclude(group: "commons-logging", module: "commons-logging") - } + optional("org.htmlunit:htmlunit") optional("org.jetbrains.kotlin:kotlin-stdlib") optional("org.jetbrains.kotlin:kotlin-reflect") optional("org.junit.jupiter:junit-jupiter-api") optional("org.mockito:mockito-core") optional("org.skyscreamer:jsonassert") optional("org.seleniumhq.selenium:htmlunit3-driver") { - exclude(group: "commons-logging", module: "commons-logging") exclude(group: "com.sun.activation", module: "jakarta.activation") } optional("org.seleniumhq.selenium:selenium-api") diff --git a/spring-boot-project/spring-boot-testcontainers/build.gradle b/spring-boot-project/spring-boot-testcontainers/build.gradle index 73bbbcf974e..3f24b34c820 100644 --- a/spring-boot-project/spring-boot-testcontainers/build.gradle +++ b/spring-boot-project/spring-boot-testcontainers/build.gradle @@ -16,19 +16,13 @@ dependencies { dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) dockerTestImplementation("ch.qos.logback:logback-classic") - dockerTestImplementation("co.elastic.clients:elasticsearch-java") { - exclude group: "commons-logging", module: "commons-logging" - } + dockerTestImplementation("co.elastic.clients:elasticsearch-java") dockerTestImplementation("com.couchbase.client:java-client") dockerTestImplementation("com.hazelcast:hazelcast") dockerTestImplementation("io.micrometer:micrometer-registry-otlp") - dockerTestImplementation("io.rest-assured:rest-assured") { - exclude group: "commons-logging", module: "commons-logging" - } + dockerTestImplementation("io.rest-assured:rest-assured") dockerTestImplementation("org.apache.activemq:activemq-client") - dockerTestImplementation("org.apache.activemq:artemis-jakarta-client") { - exclude group: "commons-logging", module: "commons-logging" - } + dockerTestImplementation("org.apache.activemq:artemis-jakarta-client") dockerTestImplementation("org.apache.cassandra:java-driver-core") { exclude group: "org.slf4j", module: "jcl-over-slf4j" } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle index 240281c2650..8ad97350f01 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle @@ -26,7 +26,5 @@ dependencies { testImplementation("org.mockito:mockito-core") testImplementation("org.projectlombok:lombok") testImplementation("org.springframework:spring-core") - testImplementation("org.apache.commons:commons-dbcp2") { - exclude group: "commons-logging", module: "commons-logging" - } + testImplementation("org.apache.commons:commons-dbcp2") } 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 0995887fabf..9bb0958e1cf 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 @@ -39,9 +39,7 @@ dependencies { optional("org.cyclonedx:cyclonedx-gradle-plugin") { exclude(group: "org.apache.maven", module: "maven-core") } - optional("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") { - exclude(group: "commons-logging", module: "commons-logging") - } + optional("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-gradle-test-support")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java index dc5cf7da992..1dd6fc06fba 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java @@ -64,7 +64,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { }) .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context") .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-core") - .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") + .hasEntryWithNameStartingWith("BOOT-INF/lib/commons-logging") .hasEntryWithNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-6") .hasEntryWithName("BOOT-INF/classes/org/test/SampleApplication.class") .hasEntryWithName("org/springframework/boot/loader/launch/JarLauncher.class"); @@ -195,7 +195,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/") .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context") .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-core") - .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") + .hasEntryWithNameStartingWith("BOOT-INF/lib/commons-logging") .doesNotHaveEntryWithName("BOOT-INF/lib/servlet-api-2.5.jar"); }); } @@ -210,7 +210,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/") .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context") .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-core") - .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") + .hasEntryWithNameStartingWith("BOOT-INF/lib/commons-logging") .doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-"); }); } @@ -223,7 +223,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { .hasEntryWithNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-") .doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/spring-context") .doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/spring-core") - .doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl"); + .doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/commons-logging"); }); } @@ -238,7 +238,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { .hasEntryWithNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-") .doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/spring-context") .doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/spring-core") - .doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl"); + .doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/commons-logging"); }); } @@ -249,7 +249,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/") .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context") .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-core") - .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") + .hasEntryWithNameStartingWith("BOOT-INF/lib/commons-logging") .doesNotHaveEntryWithName("BOOT-INF/lib/log4j-api-2.4.1.jar"); }); } @@ -491,12 +491,11 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { void whenJarIsRepackagedWithOutputTimestampConfiguredThenLibrariesAreSorted(MavenBuild mavenBuild) { mavenBuild.project("jar-output-timestamp").execute((project) -> { File repackaged = new File(project, "target/jar-output-timestamp-0.0.1.BUILD-SNAPSHOT.jar"); - List sortedLibs = Arrays.asList("BOOT-INF/lib/jakarta.servlet-api", "BOOT-INF/lib/jspecify", - "BOOT-INF/lib/micrometer-commons", "BOOT-INF/lib/micrometer-observation", "BOOT-INF/lib/spring-aop", - "BOOT-INF/lib/spring-beans", + List sortedLibs = Arrays.asList("BOOT-INF/lib/commons-logging", "BOOT-INF/lib/jakarta.servlet-api", + "BOOT-INF/lib/jspecify", "BOOT-INF/lib/micrometer-commons", "BOOT-INF/lib/micrometer-observation", + "BOOT-INF/lib/spring-aop", "BOOT-INF/lib/spring-beans", "BOOT-INF/lib/" + JarModeLibrary.TOOLS.getCoordinates().getArtifactId(), - "BOOT-INF/lib/spring-context", "BOOT-INF/lib/spring-core", "BOOT-INF/lib/spring-expression", - "BOOT-INF/lib/spring-jcl"); + "BOOT-INF/lib/spring-context", "BOOT-INF/lib/spring-core", "BOOT-INF/lib/spring-expression"); assertThat(jar(repackaged)).entryNamesInPath("BOOT-INF/lib/") .zipSatisfy(sortedLibs, (String jarLib, String expectedLib) -> assertThat(jarLib).startsWith(expectedLib)); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/TestRunIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/TestRunIntegrationTests.java index c0ca4e47505..71a1ac541db 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/TestRunIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/TestRunIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ class TestRunIntegrationTests { .contains("1. " + canonicalPathOf(project, "target/test-classes")) .contains("2. " + canonicalPathOf(project, "target/classes")) .containsPattern("3\\. .*spring-core") - .containsPattern("4\\. .*spring-jcl")); + .containsPattern("4\\. .*commons-logging")); } private String canonicalPathOf(File project, String path) throws IOException { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java index 9ef5f6bfd4d..8085835e15c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java @@ -56,7 +56,7 @@ class WarIntegrationTests extends AbstractArchiveIntegrationTests { .execute((project) -> assertThat(jar(new File(project, "target/war-0.0.1.BUILD-SNAPSHOT.war"))) .hasEntryWithNameStartingWith("WEB-INF/lib/spring-context") .hasEntryWithNameStartingWith("WEB-INF/lib/spring-core") - .hasEntryWithNameStartingWith("WEB-INF/lib/spring-jcl") + .hasEntryWithNameStartingWith("WEB-INF/lib/commons-logging") .hasEntryWithNameStartingWith("WEB-INF/lib-provided/jakarta.servlet-api-6") .hasEntryWithName("org/springframework/boot/loader/launch/WarLauncher.class") .hasEntryWithName("WEB-INF/classes/org/test/SampleApplication.class") @@ -80,7 +80,7 @@ class WarIntegrationTests extends AbstractArchiveIntegrationTests { .execute((project) -> assertThat(jar(new File(project, "target/war-with-unpack-0.0.1.BUILD-SNAPSHOT.war"))) .hasUnpackEntryWithNameStartingWith("WEB-INF/lib/spring-core-") .hasEntryWithNameStartingWith("WEB-INF/lib/spring-context-") - .hasEntryWithNameStartingWith("WEB-INF/lib/spring-jcl-")); + .hasEntryWithNameStartingWith("WEB-INF/lib/commons-logging-")); } @TestTemplate @@ -123,9 +123,9 @@ class WarIntegrationTests extends AbstractArchiveIntegrationTests { List sortedLibs = Arrays.asList( // these libraries are copied from the original war, sorted when // packaged by Maven - "WEB-INF/lib/jspecify", "WEB-INF/lib/micrometer-commons", "WEB-INF/lib/micrometer-observation", - "WEB-INF/lib/spring-aop", "WEB-INF/lib/spring-beans", "WEB-INF/lib/spring-context", - "WEB-INF/lib/spring-core", "WEB-INF/lib/spring-expression", "WEB-INF/lib/spring-jcl", + "WEB-INF/lib/commons-logging", "WEB-INF/lib/jspecify", "WEB-INF/lib/micrometer-commons", + "WEB-INF/lib/micrometer-observation", "WEB-INF/lib/spring-aop", "WEB-INF/lib/spring-beans", + "WEB-INF/lib/spring-context", "WEB-INF/lib/spring-core", "WEB-INF/lib/spring-expression", // these libraries are contributed by Spring Boot repackaging, and // sorted separately "WEB-INF/lib/" + JarModeLibrary.TOOLS.getCoordinates().getArtifactId()); diff --git a/spring-boot-project/spring-boot/build.gradle b/spring-boot-project/spring-boot/build.gradle index 73311c9bd69..c0382732103 100644 --- a/spring-boot-project/spring-boot/build.gradle +++ b/spring-boot-project/spring-boot/build.gradle @@ -44,9 +44,7 @@ dependencies { optional("jakarta.servlet:jakarta.servlet-api") optional("jakarta.transaction:jakarta.transaction-api") optional("junit:junit") - optional("org.apache.commons:commons-dbcp2") { - exclude(group: "commons-logging", module: "commons-logging") - } + optional("org.apache.commons:commons-dbcp2") optional("org.apache.httpcomponents.client5:httpclient5") optional("org.apache.httpcomponents.core5:httpcore5-reactive") optional("org.apache.logging.log4j:log4j-api") @@ -101,9 +99,7 @@ dependencies { optional("org.yaml:snakeyaml") optional("org.jetbrains.kotlin:kotlin-reflect") optional("org.jetbrains.kotlin:kotlin-stdlib") - optional("software.amazon.jdbc:aws-advanced-jdbc-wrapper") { - exclude(group: "commons-logging", module: "commons-logging") - } + optional("software.amazon.jdbc:aws-advanced-jdbc-wrapper") testFixturesCompileOnly("jakarta.servlet:jakarta.servlet-api") testFixturesCompileOnly("org.mockito:mockito-core") diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle index 23f257e59d6..661d403d21f 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle @@ -28,7 +28,5 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) testImplementation("org.awaitility:awaitility") - testImplementation("org.springframework.kafka:spring-kafka-test") { - exclude group: "commons-logging", module: "commons-logging" - } + testImplementation("org.springframework.kafka:spring-kafka-test") } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/build.gradle index ecbaf4e83b5..ceb988cf834 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/build.gradle @@ -11,13 +11,10 @@ dependencies { runtimeOnly("com.h2database:h2") testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) - testImplementation("org.htmlunit:htmlunit") { - exclude group: "commons-logging", module: "commons-logging" - } + testImplementation("org.htmlunit:htmlunit") testImplementation("org.mockito:mockito-junit-jupiter") testImplementation("org.seleniumhq.selenium:selenium-api") testImplementation("org.seleniumhq.selenium:htmlunit3-driver") { - exclude group: "commons-logging", module: "commons-logging" exclude(group: "com.sun.activation", module: "jakarta.activation") } }