From 9f13941c2f8672751e3c0f5fabf0ab65080c0d33 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 14 Oct 2021 09:52:38 +0100 Subject: [PATCH] Prohibit org.jboss.spec.* dependencies Closes gh-28329 --- .../classpath/CheckClasspathForProhibitedDependencies.java | 5 ++++- .../spring-boot-starter-undertow/build.gradle | 6 ++++-- 2 files changed, 8 insertions(+), 3 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 301304deb71..f5a8d173ba3 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-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -79,6 +79,9 @@ public class CheckClasspathForProhibitedDependencies extends DefaultTask { if (group.equals("org.slf4j") && id.getName().equals("jcl-over-slf4j")) { return true; } + if (group.startsWith("org.jboss.spec")) { + return true; + } return false; } diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle index 5f25ead862f..85e8443a01a 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle @@ -7,13 +7,15 @@ description = "Starter for using Undertow as the embedded servlet container. An dependencies { api("io.undertow:undertow-core") api("io.undertow:undertow-servlet") { - exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.2_spec" + exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_4.0_spec" } api("io.undertow:undertow-websockets-jsr") { - exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.2_spec" + exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_4.0_spec" + exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec" } api("jakarta.servlet:jakarta.servlet-api") + api("jakarta.websocket:jakarta.websocket-api") api("org.glassfish:jakarta.el") }