mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Merge branch '3.1.x'
Closes gh-38075
This commit is contained in:
commit
10b392f38b
@ -20,9 +20,6 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp
|
||||
|
||||
[source,xml,indent=0,subs="verbatim"]
|
||||
----
|
||||
<properties>
|
||||
<servlet-api.version>3.1.0</servlet-api.version>
|
||||
</properties>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
@ -41,46 +38,6 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp
|
||||
</dependency>
|
||||
----
|
||||
|
||||
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, you can do so as shown in the following example:
|
||||
|
||||
[source,xml,indent=0,subs="verbatim"]
|
||||
----
|
||||
<properties>
|
||||
<jetty.version>10.0.8</jetty.version>
|
||||
</properties>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<!-- Exclude the Tomcat dependency -->
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- Use Jetty instead -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jetty</artifactId>
|
||||
<exclusions>
|
||||
<!-- Exclude the Jetty-9 specific dependencies -->
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-server</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>javax-websocket-server-impl</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
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:
|
||||
|
||||
[source,gradle,indent=0,subs="verbatim"]
|
||||
|
Loading…
Reference in New Issue
Block a user