Browse Source

Replace spring-jcl with vanilla commons-logging

See gh-45487

Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
pull/45379/head
Stéphane Nicoll 7 months ago committed by Phillip Webb
parent
commit
6fceab2c90
  1. 4
      buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java
  2. 12
      buildSrc/src/test/resources/bom.gradle
  3. 21
      spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle
  4. 8
      spring-boot-project/spring-boot-actuator/build.gradle
  5. 32
      spring-boot-project/spring-boot-autoconfigure/build.gradle
  6. 39
      spring-boot-project/spring-boot-dependencies/build.gradle
  7. 13
      spring-boot-project/spring-boot-docs/build.gradle
  8. 4
      spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle
  9. 5
      spring-boot-project/spring-boot-test-autoconfigure/build.gradle
  10. 5
      spring-boot-project/spring-boot-test/build.gradle
  11. 12
      spring-boot-project/spring-boot-testcontainers/build.gradle
  12. 4
      spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle
  13. 4
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle
  14. 21
      spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java
  15. 4
      spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/TestRunIntegrationTests.java
  16. 10
      spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java
  17. 8
      spring-boot-project/spring-boot/build.gradle
  18. 4
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle
  19. 5
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/build.gradle

4
buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java

@ -1,5 +1,5 @@ @@ -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; @@ -37,7 +37,7 @@ import org.gradle.api.tasks.TaskAction;
public abstract class CheckClasspathForProhibitedDependencies extends DefaultTask {
private static final Set<String> 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<String> PERMITTED_JAVAX_GROUPS = Set.of("javax.batch", "javax.cache", "javax.money");

12
buildSrc/src/test/resources/bom.gradle

@ -7,18 +7,14 @@ bom { @@ -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 { @@ -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"
]

21
spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

@ -51,7 +51,6 @@ dependencies { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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")

8
spring-boot-project/spring-boot-actuator/build.gradle

@ -53,9 +53,7 @@ dependencies { @@ -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 { @@ -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")

32
spring-boot-project/spring-boot-autoconfigure/build.gradle

@ -40,9 +40,7 @@ dependencies { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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")

39
spring-boot-project/spring-boot-dependencies/build.gradle

@ -15,12 +15,8 @@ bom { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -618,9 +617,7 @@ bom {
}
group("org.apache.httpcomponents") {
modules = [
"httpasyncclient" {
exclude group: "commons-logging", module: "commons-logging"
}
"httpasyncclient"
]
}
}

13
spring-boot-project/spring-boot-docs/build.gradle

@ -102,9 +102,7 @@ dependencies { @@ -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 { @@ -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 { @@ -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 { @@ -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")

4
spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle

@ -7,7 +7,5 @@ description = "Starter for JMS messaging using Apache Artemis" @@ -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")
}

5
spring-boot-project/spring-boot-test-autoconfigure/build.gradle

@ -43,12 +43,9 @@ dependencies { @@ -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")

5
spring-boot-project/spring-boot-test/build.gradle

@ -23,16 +23,13 @@ dependencies { @@ -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")

12
spring-boot-project/spring-boot-testcontainers/build.gradle

@ -16,19 +16,13 @@ dependencies { @@ -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"
}

4
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle

@ -26,7 +26,5 @@ dependencies { @@ -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")
}

4
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle

@ -39,9 +39,7 @@ dependencies { @@ -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"))

21
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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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<String> 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<String> 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));

4
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/TestRunIntegrationTests.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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 {

10
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 { @@ -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 { @@ -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 { @@ -123,9 +123,9 @@ class WarIntegrationTests extends AbstractArchiveIntegrationTests {
List<String> 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());

8
spring-boot-project/spring-boot/build.gradle

@ -44,9 +44,7 @@ dependencies { @@ -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 { @@ -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")

4
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle

@ -28,7 +28,5 @@ dependencies { @@ -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")
}

5
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/build.gradle

@ -11,13 +11,10 @@ dependencies { @@ -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")
}
}

Loading…
Cancel
Save