From 108ca64989d87a46e62b2de88acc1a9f3b9727f8 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 11 Jul 2025 12:34:09 +0100 Subject: [PATCH] Reduce the effect of depending on spring-boot-starter-test efde264 corrected spring-boot-webclient by adding to it an api dependency on spring-webflux. This had an unwanted side-effect on the classpath of anything that depends on spring-boot-starter-test. That classpath now contained all of the classes that are needed to deduce that the web application type should be reactive. This caused some smoke tests to fail as they'd incorrectly try to start a reactive web server. This commit updates spring-boot-starter-test so that its dependencies on spring-boot-restclient and spring-boot-webclient are not transitive. This prevents them from pulling in unwanted dependencies such as spring-webflux by default, while making their classes and auto-configuration available for classes that already depend on spring-webflux and the like through some other route. See gh-46292 --- starter/spring-boot-starter-test/build.gradle | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/starter/spring-boot-starter-test/build.gradle b/starter/spring-boot-starter-test/build.gradle index 67db1d65e6b..24f5c4e1b5f 100644 --- a/starter/spring-boot-starter-test/build.gradle +++ b/starter/spring-boot-starter-test/build.gradle @@ -22,11 +22,18 @@ description = "Starter for testing Spring Boot applications with libraries inclu dependencies { api(project(":core:spring-boot-test")) - api(project(":module:spring-boot-restclient")) + api(project(":module:spring-boot-http-client")) { + transitive = false + } + api(project(":module:spring-boot-restclient")) { + transitive = false + } api(project(":module:spring-boot-restclient-test")) api(project(":module:spring-boot-test-autoconfigure")) api(project(":module:spring-boot-web-server-test")) - api(project(":module:spring-boot-webclient")) + api(project(":module:spring-boot-webclient")) { + transitive = false + } api(project(":starter:spring-boot-starter")) api("com.jayway.jsonpath:json-path") api("jakarta.xml.bind:jakarta.xml.bind-api")