From bc3d51110aa5bad5942c123c8ceba6ff814eeaf3 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 22 Mar 2024 11:13:26 +0000 Subject: [PATCH] Override Servlet API version in enforcedPlatform-compatible way See gh-207 --- framework/webmvc-jetty-tls/build.gradle | 11 +++++------ framework/webmvc-jetty/build.gradle | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/framework/webmvc-jetty-tls/build.gradle b/framework/webmvc-jetty-tls/build.gradle index e9f96aa0..9fada598 100644 --- a/framework/webmvc-jetty-tls/build.gradle +++ b/framework/webmvc-jetty-tls/build.gradle @@ -5,6 +5,11 @@ plugins { id "org.graalvm.buildtools.native" } +configurations.all { + // Downgrade for Jetty, see https://github.com/spring-projects/spring-boot/issues/33044 + resolutionStrategy.force("jakarta.servlet:jakarta.servlet-api:5.0.0") +} + dependencies { implementation(enforcedPlatform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)) implementation("org.springframework.boot:spring-boot-starter-web") @@ -14,12 +19,6 @@ dependencies { replacedBy("org.springframework.boot:spring-boot-starter-jetty", "Use Jetty instead of Tomcat") } } - // Downgrade for Jetty, see https://github.com/spring-projects/spring-boot/issues/33044 - implementation("jakarta.servlet:jakarta.servlet-api") { - version { - strictly "5.0.0" - } - } testImplementation("org.springframework.boot:spring-boot-starter-test") diff --git a/framework/webmvc-jetty/build.gradle b/framework/webmvc-jetty/build.gradle index 8e1e2ed4..3b896e94 100644 --- a/framework/webmvc-jetty/build.gradle +++ b/framework/webmvc-jetty/build.gradle @@ -6,6 +6,11 @@ plugins { id "org.jetbrains.kotlin.jvm" } +configurations.all { + // Downgrade for Jetty, see https://github.com/spring-projects/spring-boot/issues/33044 + resolutionStrategy.force("jakarta.servlet:jakarta.servlet-api:5.0.0") +} + dependencies { implementation(enforcedPlatform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)) implementation("org.springframework.boot:spring-boot-starter-web") @@ -15,12 +20,6 @@ dependencies { replacedBy("org.springframework.boot:spring-boot-starter-jetty", "Use Jetty instead of Tomcat") } } - // Downgrade for Jetty, see https://github.com/spring-projects/spring-boot/issues/33044 - implementation("jakarta.servlet:jakarta.servlet-api") { - version { - strictly "5.0.0" - } - } implementation("com.fasterxml.jackson.module:jackson-module-kotlin") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")