diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index 2d5a4f8a83e..6bda2aa9d51 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -147,7 +147,7 @@ 3.9.1 2.29.3 4.1.2 - 3.1.0 + 4.0.1 1.7.25 1.19 7.2.1 @@ -175,9 +175,9 @@ 2.3.0 2.0.1 3.0.1.RELEASE - 8.5.31 + 9.0.10 4.0.6 - 1.4.25.Final + 2.0.9.Final 3325375 0.35 1.6.3 diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/getting-started.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/getting-started.adoc index 62bffbcab9c..6f5b5e0f00c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/getting-started.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/getting-started.adoc @@ -51,14 +51,14 @@ Spring Boot supports the following embedded servlet containers: |=== |Name |Servlet Version -|Tomcat 8.5 -|3.1 +|Tomcat 9.0 +|4.0 |Jetty 9.4 |3.1 -|Undertow 1.4 -|3.1 +|Undertow 2.0 +|4.0 |=== You can also deploy Spring Boot applications to any Servlet 3.1+ compatible container. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc index 0d83beb6363..4c057478235 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -523,6 +523,9 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp [source,xml,indent=0,subs="verbatim,quotes,attributes"] ---- + + 3.1.0 + org.springframework.boot spring-boot-starter-web @@ -541,6 +544,9 @@ 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.0, Jetty 9.4 does not support Servlet 4.0. + The following Gradle example shows how to exclude Netty and include Undertow for Spring WebFlux: @@ -727,16 +733,16 @@ To enable that support, your application needs to have two additional dependenci [[howto-configure-http2-tomcat]] ==== HTTP/2 with Tomcat -Spring Boot ships by default with Tomcat 8.5.x. With that version, HTTP/2 is only -supported if the `libtcnative` library and its dependencies are installed on the host -operating system. +Spring Boot ships by default with Tomcat 9.0.x which supports HTTP/2 out of the box when +using JDK 9 or later. Alternatively, HTTP/2 can be used on JDK 8 if the `libtcnative` +library and its dependencies are installed on the host operating system. The library folder must be made available, if not already, to the JVM library path. You can do so with a JVM argument such as `-Djava.library.path=/usr/local/opt/tomcat-native/lib`. More on this in the -https://tomcat.apache.org/tomcat-8.5-doc/apr.html[official Tomcat documentation]. +https://tomcat.apache.org/tomcat-9.0-doc/apr.html[official Tomcat documentation]. -Starting Tomcat 8.5.x without that native support logs the following error: +Starting Tomcat 9.0.x on JDK 8 without that native support logs the following error: [indent=0,subs="attributes"] ---- @@ -745,10 +751,6 @@ Starting Tomcat 8.5.x without that native support logs the following error: This error is not fatal, and the application still starts with HTTP/1.1 SSL support. -Running your application with Tomcat 9.0.x and JDK9 does not require any native library to -be installed. To use Tomcat 9, you can override the `tomcat.version` build property with -the version of your choice. - [[howto-configure-webserver]] diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index b1262bf3042..638354c1a8a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -7409,9 +7409,9 @@ include::{test-examples}/web/client/SampleWebClientTests.java[tag=test] [[boot-features-websockets]] == WebSockets -Spring Boot provides WebSockets auto-configuration for embedded Tomcat 8.5, Jetty -9, and Undertow. 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. +Spring Boot provides WebSockets auto-configuration for embedded Tomcat, Jetty, and +Undertow. 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. Spring Framework provides {spring-reference}web.html#websocket[rich WebSocket support] that can be easily accessed through the `spring-boot-starter-websocket` module. diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/pom.xml index 537da2c6784..0d8fc32869f 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/pom.xml +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/pom.xml @@ -13,6 +13,7 @@ alternative to spring-boot-starter-tomcat ${basedir}/../../.. + 3.1.0 diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/pom.xml index c29c6bbc2ce..7c1162b5cf6 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/pom.xml +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/pom.xml @@ -25,7 +25,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_4.0_spec diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java index 982feecff61..3121e1bf7dd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java @@ -230,7 +230,7 @@ public final class Verify { super.verifyZipEntries(verifier); verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/spring-context"); verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/spring-core"); - verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/javax.servlet-api-3"); + verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/javax.servlet-api-4"); assertThat(verifier .hasEntry("org/springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isTrue(); @@ -263,7 +263,7 @@ public final class Verify { verifier.assertHasEntryNameStartingWith("WEB-INF/lib/spring-context"); verifier.assertHasEntryNameStartingWith("WEB-INF/lib/spring-core"); verifier.assertHasEntryNameStartingWith( - "WEB-INF/lib-provided/javax.servlet-api-3"); + "WEB-INF/lib-provided/javax.servlet-api-4"); assertThat(verifier .hasEntry("org/" + "springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isTrue(); @@ -314,7 +314,7 @@ public final class Verify { super.verifyZipEntries(verifier); verifier.assertHasEntryNameStartingWith("lib/spring-context"); verifier.assertHasEntryNameStartingWith("lib/spring-core"); - verifier.assertHasNoEntryNameStartingWith("lib/javax.servlet-api-3"); + verifier.assertHasNoEntryNameStartingWith("lib/javax.servlet-api"); assertThat(verifier .hasEntry("org/" + "springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isFalse(); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java index 6ab1dfd7732..c2b894d2d94 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java @@ -63,7 +63,6 @@ import org.springframework.test.util.ReflectionTestUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -181,8 +180,7 @@ public class TomcatServletWebServerFactoryTests TomcatServletWebServerFactory factory = getFactory(); Connector[] listeners = new Connector[4]; for (int i = 0; i < listeners.length; i++) { - Connector connector = mock(Connector.class); - given(connector.getState()).willReturn(LifecycleState.STOPPED); + Connector connector = new Connector(); listeners[i] = connector; } factory.addAdditionalTomcatConnectors(listeners); diff --git a/spring-boot-samples/spring-boot-sample-jetty-jsp/pom.xml b/spring-boot-samples/spring-boot-sample-jetty-jsp/pom.xml index e208d3a8862..a2ddaa620d6 100644 --- a/spring-boot-samples/spring-boot-sample-jetty-jsp/pom.xml +++ b/spring-boot-samples/spring-boot-sample-jetty-jsp/pom.xml @@ -15,6 +15,7 @@ ${basedir}/../.. / + 3.1.0 diff --git a/spring-boot-samples/spring-boot-sample-jetty-ssl/pom.xml b/spring-boot-samples/spring-boot-sample-jetty-ssl/pom.xml index 05468a45b35..16941527893 100644 --- a/spring-boot-samples/spring-boot-sample-jetty-ssl/pom.xml +++ b/spring-boot-samples/spring-boot-sample-jetty-ssl/pom.xml @@ -13,6 +13,7 @@ Spring Boot Jetty SSL Sample ${basedir}/../.. + 3.1.0 diff --git a/spring-boot-samples/spring-boot-sample-jetty/pom.xml b/spring-boot-samples/spring-boot-sample-jetty/pom.xml index b5729f797af..395594a7471 100644 --- a/spring-boot-samples/spring-boot-sample-jetty/pom.xml +++ b/spring-boot-samples/spring-boot-sample-jetty/pom.xml @@ -13,6 +13,7 @@ Spring Boot Jetty Sample ${basedir}/../.. + 3.1.0