From 7db43ef820262bf297e28aa61a6a2d7244afe11b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Mon, 6 Oct 2025 16:31:09 +0200 Subject: [PATCH] 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 --- module/spring-boot-rsocket/build.gradle | 3 +-- starter/spring-boot-starter-rsocket/build.gradle | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/spring-boot-rsocket/build.gradle b/module/spring-boot-rsocket/build.gradle index f220eeffa22..f06edc6aa31 100644 --- a/module/spring-boot-rsocket/build.gradle +++ b/module/spring-boot-rsocket/build.gradle @@ -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")) diff --git a/starter/spring-boot-starter-rsocket/build.gradle b/starter/spring-boot-starter-rsocket/build.gradle index 32d0ba7fc08..0a8b46a4c0f 100644 --- a/starter/spring-boot-starter-rsocket/build.gradle +++ b/starter/spring-boot-starter-rsocket/build.gradle @@ -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") }