Skip to content

Commit 8c0051a

Browse files
committed
Drop Undertow support
Spring Framework 7.0 requires a Servlet 6.1 baseline for Servlet containers. Partial Servlet 6.1 support is available on the `main` Undertow branch, but there isn't any milestone version available for the undertow 2.4 generation. At this stage of our 4.0 schedule, we think it's safer to drop Undertow support now. Closes: gh-46917
1 parent f79c7d9 commit 8c0051a

File tree

134 files changed

+43
-8278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+43
-8278
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ The main library providing features that support the other parts of Spring Boot.
116116

117117
* The `SpringApplication` class, providing static convenience methods that can be used to write a stand-alone Spring Application.
118118
Its sole job is to create and refresh an appropriate Spring `ApplicationContext`.
119-
* Embedded web applications with a choice of container (Tomcat, Jetty, or Undertow).
119+
* Embedded web applications with a choice of container (Tomcat, Jetty).
120120
* First-class externalized configuration support.
121121
* Convenience `ApplicationContext` initializers, including support for sensible logging defaults.
122122

configuration-metadata/spring-boot-configuration-metadata-changelog-generator/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ def dependenciesOf(String version) {
128128
"spring-boot-tomcat",
129129
"spring-boot-tracing",
130130
"spring-boot-tx",
131-
"spring-boot-undertow",
132131
"spring-boot-validation",
133132
"spring-boot-web-server",
134133
"spring-boot-webclient",

documentation/spring-boot-docs/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ dependencies {
111111
implementation(project(path: ":module:spring-boot-security"))
112112
implementation(project(path: ":module:spring-boot-test-autoconfigure"))
113113
implementation(project(path: ":module:spring-boot-tomcat"))
114-
implementation(project(path: ":module:spring-boot-undertow"))
115114
implementation(project(path: ":module:spring-boot-web-server-test"))
116115
implementation(project(path: ":module:spring-boot-webclient"))
117116
implementation(project(path: ":module:spring-boot-webflux"))
@@ -126,7 +125,6 @@ dependencies {
126125
implementation("io.micrometer:micrometer-registry-jmx")
127126
implementation("io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0")
128127
implementation("io.projectreactor.netty:reactor-netty-http")
129-
implementation("io.undertow:undertow-core")
130128
implementation("jakarta.annotation:jakarta.annotation-api")
131129
implementation("jakarta.jms:jakarta.jms-api")
132130
implementation("jakarta.persistence:jakarta.persistence-api")

documentation/spring-boot-docs/src/docs/antora/modules/ROOT/pages/redirect.adoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,6 @@
684684
* xref:how-to:webserver.adoc#howto.webserver.configure-http2.netty[#howto.webserver.configure-http2.netty]
685685
* xref:how-to:webserver.adoc#howto.webserver.configure-http2.tomcat[#howto-configure-http2-tomcat]
686686
* xref:how-to:webserver.adoc#howto.webserver.configure-http2.tomcat[#howto.webserver.configure-http2.tomcat]
687-
* xref:how-to:webserver.adoc#howto.webserver.configure-http2.undertow[#howto-configure-http2-undertow]
688-
* xref:how-to:webserver.adoc#howto.webserver.configure-http2.undertow[#howto.webserver.configure-http2.undertow]
689687
* xref:how-to:webserver.adoc#howto.webserver.configure-http2[#howto-configure-http2]
690688
* xref:how-to:webserver.adoc#howto.webserver.configure-http2[#howto.webserver.configure-http2]
691689
* xref:how-to:webserver.adoc#howto.webserver.configure-ssl.pem-files[#howto.webserver.configure-ssl.pem-files]
@@ -701,8 +699,6 @@
701699
* xref:how-to:webserver.adoc#howto.webserver.discover-port[#howto.webserver.discover-port]
702700
* xref:how-to:webserver.adoc#howto.webserver.enable-multiple-connectors-in-tomcat[#howto-enable-multiple-connectors-in-tomcat]
703701
* xref:how-to:webserver.adoc#howto.webserver.enable-multiple-connectors-in-tomcat[#howto.webserver.enable-multiple-connectors-in-tomcat]
704-
* xref:how-to:webserver.adoc#howto.webserver.enable-multiple-listeners-in-undertow[#howto-enable-multiple-listeners-in-undertow]
705-
* xref:how-to:webserver.adoc#howto.webserver.enable-multiple-listeners-in-undertow[#howto.webserver.enable-multiple-listeners-in-undertow]
706702
* xref:how-to:webserver.adoc#howto.webserver.enable-response-compression[#how-to-enable-http-response-compression]
707703
* xref:how-to:webserver.adoc#howto.webserver.enable-response-compression[#howto.webserver.enable-response-compression]
708704
* xref:how-to:webserver.adoc#howto.webserver.enable-tomcat-mbean-registry[#howto-enable-tomcat-mbean-registry]

documentation/spring-boot-docs/src/docs/antora/modules/ROOT/pages/system-requirements.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ Spring Boot supports the following embedded servlet containers:
3232
| Jetty 12.0
3333
| 6.0
3434

35-
| Undertow 2.3
36-
| 6.0
3735
|===
3836

3937
You can also deploy Spring Boot applications to any servlet 5.0+ compatible container.

documentation/spring-boot-docs/src/docs/antora/modules/how-to/pages/deployment/cloud.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ web: java -Dserver.port=$PORT -jar target/demo-0.0.1-SNAPSHOT.jar
179179
----
180180

181181
Spring Boot makes `-D` arguments available as properties accessible from a Spring javadoc:org.springframework.core.env.Environment[] instance.
182-
The `server.port` configuration property is fed to the embedded Tomcat, Jetty, or Undertow instance, which then uses the port when it starts up.
182+
The `server.port` configuration property is fed to the embedded Tomcat or Jetty instance, which then uses the port when it starts up.
183183
The `$PORT` environment variable is assigned to us by the Heroku PaaS.
184184

185185
This should be everything you need.

documentation/spring-boot-docs/src/docs/antora/modules/how-to/pages/webserver.adoc

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ This section answers those questions.
1212

1313
Many Spring Boot starters include default embedded containers.
1414

15-
* For servlet stack applications, the `spring-boot-starter-web` includes Tomcat by including `spring-boot-starter-tomcat`, but you can use `spring-boot-starter-jetty` or `spring-boot-starter-undertow` instead.
16-
* For reactive stack applications, the `spring-boot-starter-webflux` includes Reactor Netty by including `spring-boot-starter-reactor-netty`, but you can use `spring-boot-starter-tomcat`, `spring-boot-starter-jetty`, or `spring-boot-starter-undertow` instead.
15+
* For servlet stack applications, the `spring-boot-starter-web` includes Tomcat by including `spring-boot-starter-tomcat`, but you can use `spring-boot-starter-jetty` instead.
16+
* For reactive stack applications, the `spring-boot-starter-webflux` includes Reactor Netty by including `spring-boot-starter-reactor-netty`, but you can use `spring-boot-starter-tomcat` or `spring-boot-starter-jetty` instead.
1717

1818
When switching to a different HTTP server, you need to swap the default dependencies for those that you need instead.
1919
To help with this process, Spring Boot provides a separate starter for each of the supported HTTP servers.
@@ -40,16 +40,16 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp
4040
</dependency>
4141
----
4242

43-
The following Gradle example configures the necessary dependencies and a {url-gradle-docs}/resolution_rules.html#sec:module_replacement[module replacement] to use Undertow in place of Reactor Netty for Spring WebFlux:
43+
The following Gradle example configures the necessary dependencies and a {url-gradle-docs}/resolution_rules.html#sec:module_replacement[module replacement] to use Tomcat in place of Reactor Netty for Spring WebFlux:
4444

4545
[source,gradle]
4646
----
4747
dependencies {
48-
implementation "org.springframework.boot:spring-boot-starter-undertow"
48+
implementation "org.springframework.boot:spring-boot-starter-tomcat"
4949
implementation "org.springframework.boot:spring-boot-starter-webflux"
5050
modules {
5151
module("org.springframework.boot:spring-boot-starter-reactor-netty") {
52-
replacedBy("org.springframework.boot:spring-boot-starter-undertow", "Use Undertow instead of Reactor Netty")
52+
replacedBy("org.springframework.boot:spring-boot-starter-tomcat", "Use Tomcat instead of Reactor Netty")
5353
}
5454
}
5555
}
@@ -116,7 +116,7 @@ Contrary to a test, application code callbacks are processed early (before the v
116116
[[howto.webserver.enable-response-compression]]
117117
== Enable HTTP Response Compression
118118

119-
HTTP response compression is supported by Jetty, Tomcat, Reactor Netty, and Undertow.
119+
HTTP response compression is supported by Jetty, Tomcat and Reactor Netty.
120120
It can be enabled in `application.properties`, as follows:
121121

122122
[configprops,yaml]
@@ -221,7 +221,7 @@ These properties should instead be defined using `spring.ssl.bundle.<type>.<name
221221
[[howto.webserver.configure-ssl.sni]]
222222
=== Configure Server Name Indication
223223

224-
Tomcat, Netty, and Undertow can be configured to use unique SSL trust material for individual host names to support Server Name Indication (SNI).
224+
Tomcat, and Netty can be configured to use unique SSL trust material for individual host names to support Server Name Indication (SNI).
225225
SNI configuration is not supported with Jetty, but Jetty can https://eclipse.dev/jetty/documentation/jetty-12/operations-guide/index.html#og-protocols-ssl-sni[automatically set up SNI] if multiple certificates are provided to it.
226226

227227
Assuming xref:reference:features/ssl.adoc[SSL bundles] named `web`, `web-alt1`, and `web-alt2` have been configured, the following configuration can be used to assign each bundle to a host name served by the embedded web server:
@@ -292,13 +292,6 @@ Developers can choose to import only the required dependencies using a classifie
292292

293293

294294

295-
[[howto.webserver.configure-http2.undertow]]
296-
=== HTTP/2 With Undertow
297-
298-
Undertow supports `h2c` and `h2` out of the box.
299-
300-
301-
302295
[[howto.webserver.configure]]
303296
== Configure the Web Server
304297

@@ -309,7 +302,7 @@ See the list of xref:appendix:application-properties/index.adoc[].
309302

310303
The previous sections covered already many common use cases, such as compression, SSL or HTTP/2.
311304
However, if a configuration key does not exist for your use case, you should then look at javadoc:org.springframework.boot.web.server.WebServerFactoryCustomizer[].
312-
You can declare such a component and get access to the server factory relevant to your choice: you should select the variant for the chosen Server (Tomcat, Jetty, Reactor Netty, Undertow) and the chosen web stack (servlet or reactive).
305+
You can declare such a component and get access to the server factory relevant to your choice: you should select the variant for the chosen Server (Tomcat, Jetty, Reactor Netty) and the chosen web stack (servlet or reactive).
313306

314307
The example below is for Tomcat with the `spring-boot-starter-web` (servlet stack):
315308

@@ -335,10 +328,6 @@ In addition Spring Boot provides:
335328
| javadoc:org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory[]
336329
| javadoc:org.springframework.boot.web.embedded.jetty.JettyReactiveWebServerFactory[]
337330

338-
| Undertow
339-
| javadoc:org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory[]
340-
| javadoc:org.springframework.boot.web.embedded.undertow.UndertowReactiveWebServerFactory[]
341-
342331
| Reactor
343332
| N/A
344333
| javadoc:org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory[]
@@ -402,7 +391,7 @@ By default, javadoc:org.springframework.boot.web.servlet.ServletComponentScan[fo
402391
[[howto.webserver.configure-access-logs]]
403392
== Configure Access Logging
404393

405-
Access logs can be configured for Tomcat, Undertow, and Jetty through their respective namespaces.
394+
Access logs can be configured for Tomcat and Jetty through their respective namespaces.
406395

407396
For instance, the following settings log access on Tomcat with a {url-tomcat-docs}/config/valve.html#Access_Logging[custom pattern].
408397

@@ -420,24 +409,6 @@ NOTE: The default location for logs is a `logs` directory relative to the Tomcat
420409
By default, the `logs` directory is a temporary directory, so you may want to fix Tomcat's base directory or use an absolute path for the logs.
421410
In the preceding example, the logs are available in `my-tomcat/logs` relative to the working directory of the application.
422411

423-
Access logging for Undertow can be configured in a similar fashion, as shown in the following example:
424-
425-
[configprops,yaml]
426-
----
427-
server:
428-
undertow:
429-
accesslog:
430-
enabled: true
431-
pattern: "%t %a %r %s (%D milliseconds)"
432-
options:
433-
server:
434-
record-request-start-time: true
435-
----
436-
437-
Note that, in addition to enabling access logging and configuring its pattern, recording request start times has also been enabled.
438-
This is required when including the response time (`%D`) in the access log pattern.
439-
Logs are stored in a `logs` directory relative to the working directory of the application.
440-
You can customize this location by setting the configprop:server.undertow.accesslog.dir[] property.
441412

442413
Finally, access logging for Jetty can also be configured as follows:
443414

@@ -537,14 +508,6 @@ server:
537508

538509

539510

540-
[[howto.webserver.enable-multiple-listeners-in-undertow]]
541-
== Enable Multiple Listeners with Undertow
542-
543-
Add an javadoc:org.springframework.boot.web.embedded.undertow.UndertowBuilderCustomizer[] to the javadoc:org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory[] and add a listener to the `io.undertow.Undertow.Builder`, as shown in the following example:
544-
545-
include-code::MyUndertowConfiguration[]
546-
547-
548511

549512
[[howto.webserver.create-websocket-endpoints-using-serverendpoint]]
550513
== Create WebSocket Endpoints Using @ServerEndpoint

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/messaging/websockets.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[messaging.websockets]]
22
= WebSockets
33

4-
Spring Boot provides WebSockets auto-configuration for embedded Tomcat, Jetty, and Undertow.
4+
Spring Boot provides WebSockets auto-configuration for embedded Tomcat and Jetty.
55
If you deploy a war file to a standalone container, Spring Boot assumes that the container is responsible for the configuration of its WebSocket support.
66

77
Spring Framework provides {url-spring-framework-docs}/web/websocket.html[rich WebSocket support] for MVC web applications that can be easily accessed through the `spring-boot-starter-websocket` module.

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/web/graceful-shutdown.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[web.graceful-shutdown]]
22
= Graceful Shutdown
33

4-
Graceful shutdown is enabled by default with all four embedded web servers (Jetty, Reactor Netty, Tomcat, and Undertow) and with both reactive and servlet-based web applications.
4+
Graceful shutdown is enabled by default with all four embedded web servers (Jetty, Reactor Netty, and Tomcat) and with both reactive and servlet-based web applications.
55
It occurs as part of closing the application context and is performed in the earliest phase of stopping javadoc:org.springframework.context.SmartLifecycle[] beans.
66
This stop processing uses a timeout which provides a grace period during which existing requests will be allowed to complete but no new requests will be permitted.
77

@@ -26,10 +26,9 @@ The exact way in which new requests are not permitted varies depending on the we
2626
Implementations may stop accepting requests at the network layer, or they may return a response with a specific HTTP status code or HTTP header.
2727
The use of persistent connections can also change the way that requests stop being accepted.
2828

29-
TIP: To learn more about the specific method used with your web server, see the `shutDownGracefully` API documentation for javadoc:org.springframework.boot.web.embedded.tomcat.TomcatWebServer#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[], javadoc:org.springframework.boot.web.embedded.netty.NettyWebServer#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[], javadoc:org.springframework.boot.web.embedded.jetty.JettyWebServer#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[] or javadoc:org.springframework.boot.web.embedded.undertow.UndertowWebServer#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[].
29+
TIP: To learn more about the specific method used with your web server, see the `shutDownGracefully` API documentation for javadoc:org.springframework.boot.web.embedded.tomcat.TomcatWebServer#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[], javadoc:org.springframework.boot.web.embedded.netty.NettyWebServer#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[], or javadoc:org.springframework.boot.web.embedded.jetty.JettyWebServer#shutDownGracefully(org.springframework.boot.web.server.GracefulShutdownCallback)[].
3030

3131
Jetty, Reactor Netty, and Tomcat will stop accepting new requests at the network layer.
32-
Undertow will accept new connections but respond immediately with a service unavailable (503) response.
3332

3433

3534

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/web/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
= Web
33

44
Spring Boot is well suited for web application development.
5-
You can create a self-contained HTTP server by using embedded Tomcat, Jetty, Undertow, or Netty.
5+
You can create a self-contained HTTP server by using embedded Tomcat, Jetty, or Netty.
66
Most web applications use the `spring-boot-starter-web` module to get up and running quickly.
77
You can also choose to build reactive web applications by using the `spring-boot-starter-webflux` module.
88

0 commit comments

Comments
 (0)