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 c1ed551d78..005a900c88 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 @@ -78,6 +78,9 @@ public class CheckClasspathForProhibitedDependencies extends DefaultTask { if (group.equals("org.codehaus.groovy")) { return true; } + if (group.equals("org.eclipse.jetty.toolchain")) { + return true; + } if (group.startsWith("javax")) { return true; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index eb2cf75c6e..97c1fcafa1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -101,7 +101,7 @@ dependencies { optional("org.cache2k:cache2k-micrometer") optional("org.cache2k:cache2k-spring") optional("org.eclipse.jetty:jetty-server") { - exclude group: "javax.servlet", module: "javax.servlet-api" + exclude group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api" } optional("org.elasticsearch:elasticsearch") optional("org.elasticsearch.client:elasticsearch-rest-client") { @@ -166,7 +166,7 @@ dependencies { testImplementation("org.awaitility:awaitility") testImplementation("org.cache2k:cache2k-api") testImplementation("org.eclipse.jetty:jetty-webapp") { - exclude group: "javax.servlet", module: "javax.servlet-api" + exclude group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api" } testImplementation("org.elasticsearch.client:elasticsearch-rest-high-level-client") { exclude(group: "commons-logging", module: "commons-logging") diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index e6139f298d..def8ded437 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -41,7 +41,7 @@ dependencies { optional("org.cache2k:cache2k-micrometer") optional("org.cache2k:cache2k-spring") optional("org.eclipse.jetty:jetty-server") { - exclude(group: "javax.servlet", module: "javax.servlet-api") + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") } optional("org.elasticsearch:elasticsearch") optional("org.elasticsearch.client:elasticsearch-rest-client") { diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index 656d4c4de6..c2024fa838 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -75,15 +75,18 @@ dependencies { optional("org.aspectj:aspectjweaver") optional("org.cache2k:cache2k-spring") optional("org.eclipse.jetty:jetty-webapp") { - exclude group: "javax.servlet", module: "javax.servlet-api" exclude(group: "org.eclipse.jetty", module: "jetty-jndi") + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") } optional("org.eclipse.jetty:jetty-reactive-httpclient") optional("org.eclipse.jetty.websocket:websocket-jakarta-server") { exclude(group: "org.eclipse.jetty", module: "jetty-jndi") + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-websocket-api") } optional("org.eclipse.jetty.websocket:websocket-jetty-server") { exclude(group: "org.eclipse.jetty", module: "jetty-jndi") + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") } optional("org.ehcache:ehcache") { artifact { diff --git a/spring-boot-project/spring-boot-devtools/build.gradle b/spring-boot-project/spring-boot-devtools/build.gradle index a0c6858f67..7df4d29188 100644 --- a/spring-boot-project/spring-boot-devtools/build.gradle +++ b/spring-boot-project/spring-boot-devtools/build.gradle @@ -66,7 +66,9 @@ dependencies { testImplementation("org.apache.tomcat.embed:tomcat-embed-jasper") testImplementation("org.assertj:assertj-core") testImplementation("org.awaitility:awaitility") - testImplementation("org.eclipse.jetty.websocket:websocket-jakarta-client") + testImplementation("org.eclipse.jetty.websocket:websocket-jakarta-client") { + exclude group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-websocket-api" + } testImplementation("org.hamcrest:hamcrest-library") testImplementation("org.hsqldb:hsqldb") testImplementation("org.junit.jupiter:junit-jupiter") diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle index c93edebb0a..0f29ea84ad 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle @@ -5,11 +5,19 @@ plugins { description = "Starter for using Jetty as the embedded servlet container. An alternative to spring-boot-starter-tomcat" dependencies { + api("jakarta.servlet:jakarta.servlet-api") + api("jakarta.websocket:jakarta.websocket-api") api("org.apache.tomcat.embed:tomcat-embed-el") api("org.eclipse.jetty:jetty-servlets") - api("org.eclipse.jetty:jetty-webapp") - api("org.eclipse.jetty.websocket:websocket-jakarta-server") + api("org.eclipse.jetty:jetty-webapp") { + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") + } + api("org.eclipse.jetty.websocket:websocket-jakarta-server") { + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-websocket-api") + } api("org.eclipse.jetty.websocket:websocket-jetty-server") { exclude group: "org.eclipse.jetty", module: "jetty-jndi" + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") } } diff --git a/spring-boot-project/spring-boot/build.gradle b/spring-boot-project/spring-boot/build.gradle index ac331560fe..a1184748eb 100644 --- a/spring-boot-project/spring-boot/build.gradle +++ b/spring-boot-project/spring-boot/build.gradle @@ -62,13 +62,13 @@ dependencies { optional("org.eclipse.jetty:jetty-servlets") optional("org.eclipse.jetty:jetty-util") optional("org.eclipse.jetty:jetty-webapp") { - exclude(group: "javax.servlet", module: "javax.servlet-api") + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") } optional("org.eclipse.jetty:jetty-alpn-conscrypt-server") { - exclude(group: "javax.servlet", module: "javax.servlet-api") + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") } optional("org.eclipse.jetty.http2:http2-server") { - exclude(group: "javax.servlet", module: "javax.servlet-api") + exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") } optional("org.flywaydb:flyway-core") optional("org.hamcrest:hamcrest-library") diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle index 310c4eda14..77c28fc0d9 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle @@ -12,7 +12,6 @@ configurations { } dependencies { - compileOnly("jakarta.servlet:jakarta.servlet-api") compileOnly(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-jetty")) implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) { @@ -20,8 +19,8 @@ dependencies { } providedRuntime("org.eclipse.jetty:apache-jsp") { - exclude group: "javax.annotation", module: "javax.annotation-api" - exclude group: "jakarta.servlet", module: "jakarta.servlet-api" + exclude group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api" + exclude group: "org.eclipse.jetty.toolchain", module: "jetty-schemas" } runtimeOnly("org.glassfish.web:jakarta.servlet.jsp.jstl")