Browse Source

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
pull/46408/head
Andy Wilkinson 5 months ago
parent
commit
108ca64989
  1. 11
      starter/spring-boot-starter-test/build.gradle

11
starter/spring-boot-starter-test/build.gradle

@ -22,11 +22,18 @@ description = "Starter for testing Spring Boot applications with libraries inclu
dependencies { dependencies {
api(project(":core:spring-boot-test")) 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-restclient-test"))
api(project(":module:spring-boot-test-autoconfigure")) api(project(":module:spring-boot-test-autoconfigure"))
api(project(":module:spring-boot-web-server-test")) 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(project(":starter:spring-boot-starter"))
api("com.jayway.jsonpath:json-path") api("com.jayway.jsonpath:json-path")
api("jakarta.xml.bind:jakarta.xml.bind-api") api("jakarta.xml.bind:jakarta.xml.bind-api")

Loading…
Cancel
Save