Mark spring-web optional in spring-boot-rsocket

This commit moves the spring-web dependency from implementation to
optional. It also adds an api dependency to spring-web in the rsocket
starter.

The reasoning behind this change is that RSocket can be used without
spring-web, and we want to make sure that consumers of the dependency
can achieve that goal, as they were able to in previous versions.

However, we believe that most RSocket-based applications need spring-web
as, without it, only the simple and not efficient implementation of
RouterMatcher is available. With the addition of exception handling
using ControllerAdvice, this change makes also sure that it works out
of the box with the starter.

Closes gh-47409
This commit is contained in:
Stéphane Nicoll 2025-10-06 16:31:09 +02:00
parent d97539bc46
commit 7db43ef820
2 changed files with 2 additions and 2 deletions

View File

@ -31,12 +31,11 @@ dependencies {
compileOnly("com.google.code.findbugs:jsr305")
implementation("org.springframework:spring-web")
optional(project(":core:spring-boot-autoconfigure"))
optional(project(":module:spring-boot-jackson"))
optional(project(":module:spring-boot-reactor-netty"))
optional("io.rsocket:rsocket-transport-netty")
optional("org.springframework:spring-web")
optional("tools.jackson.dataformat:jackson-dataformat-cbor")
testImplementation(project(":core:spring-boot-test"))

View File

@ -28,5 +28,6 @@ dependencies {
api(project(":module:spring-boot-rsocket"))
api("io.rsocket:rsocket-transport-netty")
api("org.springframework:spring-web")
api("tools.jackson.dataformat:jackson-dataformat-cbor")
}