From d0883ba6efe59fb4a5763877e4158849d4341b30 Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Wed, 9 Mar 2022 15:40:01 -0800 Subject: [PATCH] Document the WebSocket-related exclusions that are required to use Jetty 10 Closes gh-29275 --- .../src/docs/asciidoc/howto/webserver.adoc | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc index 9a8a9d08f628..547247c439c0 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc @@ -42,7 +42,42 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp ---- NOTE: The version of the Servlet API has been overridden as, unlike Tomcat 9 and Undertow 2, Jetty 9.4 does not support Servlet 4.0. -If you wish to use Jetty 10, which does support Servlet 4.0, override the `jetty.version` property rather than the `servlet-api.version` property. + +If you wish to use Jetty 10, you can do so as shown in the following example: + +[source,xml,indent=0,subs="verbatim"] +---- + + 10.0.8 + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-tomcat + + + + org.eclipse.jetty.websocket + websocket-server + + + org.eclipse.jetty.websocket + javax-websocket-server-impl + + + + + + org.springframework.boot + spring-boot-starter-jetty + +---- + +Note that along with excluding the Tomcat starter, a couple of Jetty9-specific dependencies also need to be excluded. The following Gradle example configures the necessary dependencies and a {gradle-docs}/resolution_rules.html#sec:module_replacement[module replacement] to use Undertow in place of Reactor Netty for Spring WebFlux: