diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextAutoConfiguration.java index 760df4cc8f..32bebd7080 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextAutoConfiguration.java @@ -44,7 +44,6 @@ import org.springframework.util.Assert; */ @AutoConfiguration @AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE) -@EnableConfigurationProperties(ManagementServerProperties.class) public class ManagementContextAutoConfiguration { @Configuration(proxyBeanMethods = false) @@ -107,6 +106,7 @@ public class ManagementContextAutoConfiguration { @Configuration(proxyBeanMethods = false) @ConditionalOnManagementPort(ManagementPortType.DIFFERENT) + @EnableConfigurationProperties(ManagementServerProperties.class) static class DifferentManagementContextConfiguration { @Bean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java index 89709259f3..7cdb466c4a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java @@ -18,10 +18,10 @@ package org.springframework.boot.actuate.autoconfigure.web.server; import java.net.InetAddress; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.boot.web.server.Ssl; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.util.StringUtils; /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementWebServerFactoryCustomizer.java index 265eaf6d5f..c42b9cf575 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementWebServerFactoryCustomizer.java @@ -23,12 +23,12 @@ import java.util.List; import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.util.LambdaSafe; import org.springframework.boot.web.server.ConfigurableWebServerFactory; import org.springframework.boot.web.server.Ssl; import org.springframework.boot.web.server.WebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.core.Ordered; /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementWebServerFactoryCustomizer.java index e4f136df53..0cd661d9e6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementWebServerFactoryCustomizer.java @@ -19,7 +19,7 @@ package org.springframework.boot.actuate.autoconfigure.web.servlet; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementWebServerFactoryCustomizer; -import org.springframework.boot.autoconfigure.web.ServerProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.util.StringUtils; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java index 2ce58628f0..5f6849ba0c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java @@ -24,9 +24,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java index 0fabf0b167..755341fb57 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java @@ -316,15 +316,8 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin ServletSecurityContext securityContext = new ServletSecurityContext(request); ProducibleOperationArgumentResolver producibleOperationArgumentResolver = new ProducibleOperationArgumentResolver( () -> headers.get("Accept")); - OperationArgumentResolver serverNamespaceArgumentResolver = OperationArgumentResolver - .of(WebServerNamespace.class, () -> { - WebApplicationContext applicationContext = WebApplicationContextUtils - .getRequiredWebApplicationContext(request.getServletContext()); - return WebServerNamespace - .from(WebServerApplicationContext.getServerNamespace(applicationContext)); - }); InvocationContext invocationContext = new InvocationContext(securityContext, arguments, - serverNamespaceArgumentResolver, producibleOperationArgumentResolver); + serverNamespaceArgumentResolver(request), producibleOperationArgumentResolver); return handleResult(this.operation.invoke(invocationContext), HttpMethod.valueOf(request.getMethod())); } catch (InvalidEndpointRequestException ex) { @@ -332,6 +325,17 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin } } + private OperationArgumentResolver serverNamespaceArgumentResolver(HttpServletRequest request) { + if (ClassUtils.isPresent("org.springframework.boot.web.server.context.WebServerApplicationContext", null)) { + return OperationArgumentResolver.of(WebServerNamespace.class, () -> { + WebApplicationContext applicationContext = WebApplicationContextUtils + .getRequiredWebApplicationContext(request.getServletContext()); + return WebServerNamespace.from(WebServerApplicationContext.getServerNamespace(applicationContext)); + }); + } + return OperationArgumentResolver.of(WebServerNamespace.class, () -> null); + } + @Override public String toString() { return "Actuator web endpoint '" + this.operation.getId() + "'"; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java index d364089466..df28d5153c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java @@ -26,7 +26,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory; import org.springframework.boot.test.util.TestPropertyValues; @@ -35,6 +34,7 @@ import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index 99cf7fb933..8cb8f1fcfb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -11,7 +11,6 @@ description = "Spring Boot AutoConfigure" dependencies { api(project(":spring-boot-project:spring-boot")) - api(project(":spring-boot-project:spring-boot-web-server")) optional("com.github.ben-manes.caffeine:caffeine") optional("org.aspectj:aspectjweaver") @@ -24,16 +23,11 @@ dependencies { testFixturesCompileOnly(project(":spring-boot-project:spring-boot-test")) testFixturesCompileOnly(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testFixturesCompileOnly("javax.cache:cache-api") - testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-api") - testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-client-api") - testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) - testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation("ch.qos.logback:logback-classic") testImplementation("com.fasterxml.jackson.core:jackson-databind") testImplementation("io.projectreactor:reactor-core") diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index ad6d2ee68e..41fc59514e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1,292 +1,6 @@ { "groups": [], "properties": [ - { - "name": "server.connection-timeout", - "type": "java.time.Duration", - "deprecation": { - "reason": "Each server behaves differently. Use server specific properties instead.", - "level": "error" - } - }, - { - "name": "server.http2.enabled", - "description": "Whether to enable HTTP/2 support, if the current environment supports it.", - "defaultValue": false - }, - { - "name": "server.max-http-header-size", - "deprecation": { - "replacement": "server.max-http-request-header-size", - "level": "error" - } - }, - { - "name": "server.max-http-post-size", - "type": "java.lang.Integer", - "description": "Maximum size in bytes of the HTTP post content.", - "defaultValue": 0, - "deprecation": { - "reason": "Use dedicated property for each container.", - "level": "error" - } - }, - { - "name": "server.port", - "defaultValue": 8080 - }, - { - "name": "server.reactive.session.cookie.domain", - "description": "Domain for the cookie." - }, - { - "name": "server.reactive.session.cookie.http-only", - "description": "Whether to use \"HttpOnly\" cookies for the cookie." - }, - { - "name": "server.reactive.session.cookie.max-age", - "description": "Maximum age of the cookie. If a duration suffix is not specified, seconds will be used. A positive value indicates when the cookie expires relative to the current time. A value of 0 means the cookie should expire immediately. A negative value means no \"Max-Age\"." - }, - { - "name": "server.reactive.session.cookie.name", - "description": "Name for the cookie." - }, - { - "name": "server.reactive.session.cookie.partitioned", - "description": "Whether the generated cookie carries the Partitioned attribute." - }, - { - "name": "server.reactive.session.cookie.path", - "description": "Path of the cookie." - }, - { - "name": "server.reactive.session.cookie.same-site", - "description": "SameSite setting for the cookie." - }, - { - "name": "server.reactive.session.cookie.secure", - "description": "Whether to always mark the cookie as secure." - }, - { - "name": "server.servlet.encoding.charset", - "type": "java.nio.charset.Charset", - "description": "Charset of HTTP requests and responses. Added to the Content-Type header if not set explicitly.", - "deprecation": { - "replacement": "spring.servlet.encoding.charset", - "level": "error" - } - }, - { - "name": "server.servlet.encoding.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable http encoding support.", - "defaultValue": true, - "deprecation": { - "replacement": "spring.servlet.encoding.enabled", - "level": "error" - } - }, - { - "name": "server.servlet.encoding.force", - "type": "java.lang.Boolean", - "description": "Whether to force the encoding to the configured charset on HTTP requests and responses.", - "defaultValue": false, - "deprecation": { - "replacement": "spring.servlet.encoding.force", - "level": "error" - } - }, - { - "name": "server.servlet.encoding.force-request", - "type": "java.lang.Boolean", - "description": "Whether to force the encoding to the configured charset on HTTP requests. Defaults to true when force has not been specified.", - "defaultValue": true, - "deprecation": { - "replacement": "spring.servlet.encoding.force-request", - "level": "error" - } - }, - { - "name": "server.servlet.encoding.force-response", - "type": "java.lang.Boolean", - "description": "Whether to force the encoding to the configured charset on HTTP responses.", - "defaultValue": false, - "deprecation": { - "replacement": "spring.servlet.encoding.force-response", - "level": "error" - } - }, - { - "name": "server.servlet.jsp.class-name", - "description": "Class name of the servlet to use for JSPs. If registered is true and this class\n\t * is on the classpath then it will be registered.", - "defaultValue": "org.apache.jasper.servlet.JspServlet" - }, - { - "name": "server.servlet.jsp.init-parameters", - "description": "Init parameters used to configure the JSP servlet." - }, - { - "name": "server.servlet.path", - "type": "java.lang.String", - "description": "Path of the main dispatcher servlet.", - "defaultValue": "/", - "deprecation": { - "replacement": "spring.mvc.servlet.path", - "level": "error" - } - }, - { - "name": "server.servlet.session.cookie.comment", - "description": "Comment for the cookie.", - "deprecation": { - "level": "error" - } - }, - { - "name": "server.servlet.session.cookie.domain", - "description": "Domain for the cookie." - }, - { - "name": "server.servlet.session.cookie.http-only", - "description": "Whether to use \"HttpOnly\" cookies for the cookie." - }, - { - "name": "server.servlet.session.cookie.max-age", - "description": "Maximum age of the cookie. If a duration suffix is not specified, seconds will be used. A positive value indicates when the cookie expires relative to the current time. A value of 0 means the cookie should expire immediately. A negative value means no \"Max-Age\"." - }, - { - "name": "server.servlet.session.cookie.name", - "description": "Name of the cookie." - }, - { - "name": "server.servlet.session.cookie.partitioned", - "description": "Whether the generated cookie carries the Partitioned attribute." - }, - { - "name": "server.servlet.session.cookie.path", - "description": "Path of the cookie." - }, - { - "name": "server.servlet.session.cookie.same-site", - "description": "SameSite setting for the cookie." - }, - { - "name": "server.servlet.session.cookie.secure", - "description": "Whether to always mark the cookie as secure." - }, - { - "name": "server.servlet.session.persistent", - "description": "Whether to persist session data between restarts.", - "defaultValue": false - }, - { - "name": "server.servlet.session.store-dir", - "description": "Directory used to store session data." - }, - { - "name": "server.servlet.session.timeout", - "description": "Session timeout. If a duration suffix is not specified, seconds will be used.", - "defaultValue": "30m" - }, - { - "name": "server.servlet.session.tracking-modes", - "description": "Session tracking modes." - }, - { - "name": "server.ssl.bundle", - "description": "Name of a configured SSL bundle." - }, - { - "name": "server.ssl.certificate", - "description": "Path to a PEM-encoded SSL certificate file." - }, - { - "name": "server.ssl.certificate-private-key", - "description": "Path to a PEM-encoded private key file for the SSL certificate." - }, - { - "name": "server.ssl.ciphers", - "description": "Supported SSL ciphers." - }, - { - "name": "server.ssl.client-auth", - "description": "Client authentication mode. Requires a trust store." - }, - { - "name": "server.ssl.enabled", - "description": "Whether to enable SSL support.", - "defaultValue": true - }, - { - "name": "server.ssl.enabled-protocols", - "description": "Enabled SSL protocols." - }, - { - "name": "server.ssl.key-alias", - "description": "Alias that identifies the key in the key store." - }, - { - "name": "server.ssl.key-password", - "description": "Password used to access the key in the key store." - }, - { - "name": "server.ssl.key-store", - "description": "Path to the key store that holds the SSL certificate (typically a jks file)." - }, - { - "name": "server.ssl.key-store-password", - "description": "Password used to access the key store." - }, - { - "name": "server.ssl.key-store-provider", - "description": "Provider for the key store." - }, - { - "name": "server.ssl.key-store-type", - "description": "Type of the key store." - }, - { - "name": "server.ssl.protocol", - "description": "SSL protocol to use.", - "defaultValue": "TLS" - }, - { - "name": "server.ssl.server-name-bundles", - "description": "Mapping of host names to SSL bundles for SNI configuration." - }, - { - "name": "server.ssl.trust-certificate", - "description": "Path to a PEM-encoded SSL certificate authority file." - }, - { - "name": "server.ssl.trust-certificate-private-key", - "description": "Path to a PEM-encoded private key file for the SSL certificate authority." - }, - { - "name": "server.ssl.trust-store", - "description": "Trust store that holds SSL certificates." - }, - { - "name": "server.ssl.trust-store-password", - "description": "Password used to access the trust store." - }, - { - "name": "server.ssl.trust-store-provider", - "description": "Provider for the trust store." - }, - { - "name": "server.ssl.trust-store-type", - "description": "Type of the trust store." - }, - { - "name": "server.use-forward-headers", - "type": "java.lang.Boolean", - "deprecation": { - "reason": "Replaced to support additional strategies.", - "replacement": "server.forward-headers-strategy", - "level": "error" - } - }, { "name": "spring.aop.auto", "type": "java.lang.Boolean", diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnNotWebApplicationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnNotWebApplicationTests.java index ee9ab79a99..b01cadbdfb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnNotWebApplicationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnNotWebApplicationTests.java @@ -17,16 +17,12 @@ package org.springframework.boot.autoconfigure.condition; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.server.reactive.HttpHandler; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; @@ -47,8 +43,7 @@ class ConditionalOnNotWebApplicationTests { @Test void testNotWebApplicationWithReactiveContext() { - new ReactiveWebApplicationContextRunner() - .withUserConfiguration(ReactiveApplicationConfig.class, NotWebApplicationConfiguration.class) + new ReactiveWebApplicationContextRunner().withUserConfiguration(NotWebApplicationConfiguration.class) .run((context) -> assertThat(context).doesNotHaveBean(String.class)); } @@ -58,21 +53,6 @@ class ConditionalOnNotWebApplicationTests { .run((context) -> assertThat(context).getBeans(String.class).containsExactly(entry("none", "none"))); } - @Configuration(proxyBeanMethods = false) - static class ReactiveApplicationConfig { - - @Bean - ReactiveWebServerFactory reactiveWebServerFactory() { - return new MockReactiveWebServerFactory(); - } - - @Bean - HttpHandler httpHandler() { - return (request, response) -> Mono.empty(); - } - - } - @Configuration(proxyBeanMethods = false) @ConditionalOnNotWebApplication static class NotWebApplicationConfiguration { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWebApplicationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWebApplicationTests.java index 1435333d6a..e857781987 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWebApplicationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWebApplicationTests.java @@ -18,18 +18,14 @@ package org.springframework.boot.autoconfigure.condition; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.web.context.reactive.AnnotationConfigReactiveWebApplicationContext; import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; -import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.server.reactive.HttpHandler; import org.springframework.mock.web.MockServletContext; import static org.assertj.core.api.Assertions.assertThat; @@ -116,16 +112,6 @@ class ConditionalOnWebApplicationTests { return "reactive"; } - @Bean - ReactiveWebServerFactory reactiveWebServerFactory() { - return new MockReactiveWebServerFactory(); - } - - @Bean - HttpHandler httpHandler() { - return (request, response) -> Mono.empty(); - } - } } diff --git a/spring-boot-project/spring-boot-devtools/build.gradle b/spring-boot-project/spring-boot-devtools/build.gradle index e364d5148b..99323bf26f 100644 --- a/spring-boot-project/spring-boot-devtools/build.gradle +++ b/spring-boot-project/spring-boot-devtools/build.gradle @@ -42,6 +42,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-r2dbc")) optional(project(":spring-boot-project:spring-boot-reactor")) optional(project(":spring-boot-project:spring-boot-security")) + optional(project(":spring-boot-project:spring-boot-web-server")) optional("io.r2dbc:r2dbc-spi") optional("jakarta.servlet:jakarta.servlet-api") optional("org.apache.derby:derbytools") diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java index 24e86a1bc7..0a9597c053 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java @@ -28,8 +28,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProp import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.boot.autoconfigure.web.ServerProperties.Servlet; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.devtools.remote.server.AccessManager; import org.springframework.boot.devtools.remote.server.Dispatcher; @@ -43,6 +41,8 @@ import org.springframework.boot.devtools.restart.server.DefaultSourceDirectoryUr import org.springframework.boot.devtools.restart.server.HttpRestartServer; import org.springframework.boot.devtools.restart.server.HttpRestartServerHandler; import org.springframework.boot.devtools.restart.server.SourceDirectoryUrlFilter; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties.Servlet; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -61,7 +61,7 @@ import org.springframework.http.server.ServerHttpRequest; @AutoConfiguration(afterName = "org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration") @ConditionalOnEnabledDevTools @ConditionalOnProperty("spring.devtools.remote.secret") -@ConditionalOnClass({ Filter.class, ServerHttpRequest.class }) +@ConditionalOnClass({ Filter.class, ServerHttpRequest.class, ServerProperties.class }) @Import(RemoteDevtoolsSecurityConfiguration.class) @EnableConfigurationProperties({ ServerProperties.class, DevToolsProperties.class }) public class RemoteDevToolsAutoConfiguration { diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevtoolsSecurityConfiguration.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevtoolsSecurityConfiguration.java index 559284f447..1180b15d0c 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevtoolsSecurityConfiguration.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevtoolsSecurityConfiguration.java @@ -17,8 +17,8 @@ package org.springframework.boot.devtools.autoconfigure; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.security.autoconfigure.SecurityProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 056e84ea46..024de77303 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -215,6 +215,7 @@ dependencies { configurationProperties(project(path: ":spring-boot-project:spring-boot-tx", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-undertow", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-webflux", configuration: "configurationPropertiesMetadata")) + configurationProperties(project(path: ":spring-boot-project:spring-boot-web-server", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-webmvc", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-webservices", configuration: "configurationPropertiesMetadata")) diff --git a/spring-boot-project/spring-boot-http-converter/src/test/java/org/springframework/boot/http/converter/autoconfigure/HttpMessageConvertersAutoConfigurationTests.java b/spring-boot-project/spring-boot-http-converter/src/test/java/org/springframework/boot/http/converter/autoconfigure/HttpMessageConvertersAutoConfigurationTests.java index 6f5833e739..2fe605d643 100644 --- a/spring-boot-project/spring-boot-http-converter/src/test/java/org/springframework/boot/http/converter/autoconfigure/HttpMessageConvertersAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-http-converter/src/test/java/org/springframework/boot/http/converter/autoconfigure/HttpMessageConvertersAutoConfigurationTests.java @@ -26,7 +26,6 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.http.converter.autoconfigure.JacksonHttpMessageConvertersConfiguration.MappingJackson2HttpMessageConverterConfiguration; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.assertj.AssertableApplicationContext; @@ -265,16 +264,6 @@ class HttpMessageConvertersAutoConfigurationTests { }); } - @Test // gh-21789 - void whenAutoConfigurationIsActiveThenServerPropertiesConfigurationPropertiesAreNotEnabled() { - new WebApplicationContextRunner() - .withConfiguration(AutoConfigurations.of(HttpMessageConvertersAutoConfiguration.class)) - .run((context) -> { - assertThat(context).hasSingleBean(HttpMessageConverters.class); - assertThat(context).doesNotHaveBean(ServerProperties.class); - }); - } - private ApplicationContextRunner allOptionsRunner() { return this.contextRunner.withBean(Gson.class) .withBean(ObjectMapper.class) diff --git a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerConfiguration.java b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerConfiguration.java index b0ba5b35be..9146d6e6ad 100644 --- a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerConfiguration.java +++ b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerConfiguration.java @@ -19,9 +19,9 @@ package org.springframework.boot.jetty.autoconfigure; import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWarDeployment; import org.springframework.boot.autoconfigure.condition.ConditionalOnThreading; import org.springframework.boot.autoconfigure.thread.Threading; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.jetty.autoconfigure.reactive.JettyReactiveWebServerAutoConfiguration; import org.springframework.boot.jetty.autoconfigure.servlet.JettyServletWebServerAutoConfiguration; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; diff --git a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerFactoryCustomizer.java index c2fb69172f..31408767a8 100644 --- a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerFactoryCustomizer.java @@ -32,12 +32,12 @@ import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.RequestLogWriter; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.cloud.CloudPlatform; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.jetty.ConfigurableJettyWebServerFactory; import org.springframework.boot.jetty.autoconfigure.JettyServerProperties.Accesslog; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.core.Ordered; import org.springframework.core.env.Environment; import org.springframework.util.CollectionUtils; diff --git a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfiguration.java index 074c2ebc87..4ac820690a 100644 --- a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfiguration.java @@ -26,12 +26,12 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.web.server.reactive.ReactiveWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.jetty.JettyServerCustomizer; import org.springframework.boot.jetty.autoconfigure.JettyServerProperties; import org.springframework.boot.jetty.autoconfigure.JettyWebServerConfiguration; import org.springframework.boot.jetty.reactive.JettyReactiveWebServerFactory; +import org.springframework.boot.web.server.autoconfigure.reactive.ReactiveWebServerConfiguration; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfiguration.java index 4676c857ed..ef1beda718 100644 --- a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfiguration.java @@ -36,13 +36,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWarDeplo import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.autoconfigure.condition.SearchStrategy; -import org.springframework.boot.autoconfigure.web.server.servlet.ServletWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.jetty.JettyServerCustomizer; import org.springframework.boot.jetty.autoconfigure.JettyServerProperties; import org.springframework.boot.jetty.autoconfigure.JettyWebServerConfiguration; import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.servlet.ServletWebServerConfiguration; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerFactoryCustomizerTests.java index c9ec40d570..cfc99dfe60 100644 --- a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/JettyWebServerFactoryCustomizerTests.java @@ -41,14 +41,14 @@ import org.eclipse.jetty.util.thread.ThreadPool; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.boot.autoconfigure.web.ServerProperties.ForwardHeadersStrategy; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; import org.springframework.boot.jetty.ConfigurableJettyWebServerFactory; import org.springframework.boot.jetty.JettyWebServer; import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties.ForwardHeadersStrategy; import org.springframework.mock.env.MockEnvironment; import org.springframework.test.context.support.TestPropertySourceUtils; import org.springframework.test.util.ReflectionTestUtils; diff --git a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfigurationTests.java index c30273afc8..95df6ef0d3 100644 --- a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfigurationTests.java @@ -22,12 +22,12 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.StatisticsHandler; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.web.server.reactive.AbstractReactiveWebServerAutoConfigurationTests; import org.springframework.boot.jetty.JettyServerCustomizer; import org.springframework.boot.jetty.JettyWebServer; import org.springframework.boot.jetty.reactive.JettyReactiveWebServerFactory; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.reactive.AbstractReactiveWebServerAutoConfigurationTests; import org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfigurationTests.java index 83bfd33725..ed76c888b9 100644 --- a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfigurationTests.java @@ -24,10 +24,10 @@ import org.eclipse.jetty.server.Server; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.boot.autoconfigure.web.server.servlet.AbstractServletWebServerAutoConfigurationTests; import org.springframework.boot.jetty.JettyServerCustomizer; import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.servlet.AbstractServletWebServerAutoConfigurationTests; import org.springframework.boot.web.servlet.AbstractFilterRegistrationBean; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfiguration.java index 6098c5954d..6cfcd18fe3 100644 --- a/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfiguration.java @@ -23,13 +23,13 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.boot.autoconfigure.web.server.reactive.ReactiveWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.reactor.netty.NettyRouteProvider; import org.springframework.boot.reactor.netty.NettyServerCustomizer; import org.springframework.boot.reactor.netty.autoconfigure.ReactorNettyConfigurations.ReactorResourceFactoryConfiguration; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; +import org.springframework.boot.web.server.autoconfigure.reactive.ReactiveWebServerConfiguration; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizer.java index b23d54bac6..482ca50932 100644 --- a/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizer.java @@ -20,11 +20,11 @@ import java.time.Duration; import io.netty.channel.ChannelOption; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.cloud.CloudPlatform; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.core.Ordered; import org.springframework.core.env.Environment; diff --git a/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfigurationTests.java index a4adf1e34d..60ff5eabc7 100644 --- a/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfigurationTests.java @@ -19,10 +19,10 @@ package org.springframework.boot.reactor.netty.autoconfigure; import org.junit.jupiter.api.Test; import reactor.netty.http.server.HttpServer; -import org.springframework.boot.autoconfigure.web.server.reactive.AbstractReactiveWebServerAutoConfigurationTests; import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.reactor.netty.NettyServerCustomizer; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.reactive.AbstractReactiveWebServerAutoConfigurationTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java index a3f02d1c71..50ec57f111 100644 --- a/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java @@ -30,10 +30,10 @@ import reactor.netty.http.Http2SettingsSpec; import reactor.netty.http.server.HttpRequestDecoderSpec; import reactor.netty.http.server.HttpServer; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.reactor.netty.NettyServerCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.mock.env.MockEnvironment; import org.springframework.util.unit.DataSize; diff --git a/spring-boot-project/spring-boot-security/build.gradle b/spring-boot-project/spring-boot-security/build.gradle index 3304ca3cec..6346a91d75 100644 --- a/spring-boot-project/spring-boot-security/build.gradle +++ b/spring-boot-project/spring-boot-security/build.gradle @@ -26,6 +26,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-reactor")) optional(project(":spring-boot-project:spring-boot-rsocket")) optional(project(":spring-boot-project:spring-boot-webmvc")) + optional(project(":spring-boot-project:spring-boot-web-server")) optional("jakarta.servlet:jakarta.servlet-api") optional("org.springframework:spring-messaging") optional("org.springframework:spring-webflux") diff --git a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/reactive/StaticResourceRequestTests.java b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/reactive/StaticResourceRequestTests.java index ebf555deb2..abe32c52e0 100644 --- a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/reactive/StaticResourceRequestTests.java +++ b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/reactive/StaticResourceRequestTests.java @@ -21,8 +21,8 @@ import java.time.Duration; import org.assertj.core.api.AssertDelegateTarget; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.security.autoconfigure.StaticResourceLocation; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.support.StaticApplicationContext; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; diff --git a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/PathRequestTests.java b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/PathRequestTests.java index dbf2fbb1a7..66935ffc52 100644 --- a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/PathRequestTests.java +++ b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/PathRequestTests.java @@ -20,8 +20,8 @@ import jakarta.servlet.http.HttpServletRequest; import org.assertj.core.api.AssertDelegateTarget; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.h2console.autoconfigure.H2ConsoleProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockServletContext; import org.springframework.security.web.util.matcher.RequestMatcher; diff --git a/spring-boot-project/spring-boot-session-data-mongodb/build.gradle b/spring-boot-project/spring-boot-session-data-mongodb/build.gradle index b930d4bb48..c0e05be46e 100644 --- a/spring-boot-project/spring-boot-session-data-mongodb/build.gradle +++ b/spring-boot-project/spring-boot-session-data-mongodb/build.gradle @@ -15,14 +15,13 @@ dependencies { api("org.springframework.session:spring-session-data-mongodb") implementation(project(":spring-boot-project:spring-boot-data-mongodb")) + implementation(project(":spring-boot-project:spring-boot-web-server")) optional(project(":spring-boot-project:spring-boot-autoconfigure")) optional(project(":spring-boot-project:spring-boot-webflux")) dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) - dockerTestImplementation(project(":spring-boot-project:spring-boot-webflux")) - dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-session"))) dockerTestImplementation("org.mongodb:mongodb-driver-reactivestreams") diff --git a/spring-boot-project/spring-boot-session-data-mongodb/src/dockerTest/java/org/springframework/boot/session/data/mongodb/autoconfigure/MongoSessionAutoConfigurationTests.java b/spring-boot-project/spring-boot-session-data-mongodb/src/dockerTest/java/org/springframework/boot/session/data/mongodb/autoconfigure/MongoSessionAutoConfigurationTests.java index 901bda49b7..9242939180 100644 --- a/spring-boot-project/spring-boot-session-data-mongodb/src/dockerTest/java/org/springframework/boot/session/data/mongodb/autoconfigure/MongoSessionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-session-data-mongodb/src/dockerTest/java/org/springframework/boot/session/data/mongodb/autoconfigure/MongoSessionAutoConfigurationTests.java @@ -25,7 +25,6 @@ import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.data.mongodb.autoconfigure.MongoDataAutoConfiguration; import org.springframework.boot.mongodb.autoconfigure.MongoAutoConfiguration; import org.springframework.boot.session.autoconfigure.AbstractSessionAutoConfigurationTests; @@ -34,6 +33,7 @@ import org.springframework.boot.test.context.assertj.AssertableWebApplicationCon import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.testsupport.container.TestImage; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.session.config.SessionRepositoryCustomizer; diff --git a/spring-boot-project/spring-boot-session-data-mongodb/src/main/java/org/springframework/boot/session/data/mongodb/autoconfigure/MongoSessionAutoConfiguration.java b/spring-boot-project/spring-boot-session-data-mongodb/src/main/java/org/springframework/boot/session/data/mongodb/autoconfigure/MongoSessionAutoConfiguration.java index f0eb53d507..c382dbf863 100644 --- a/spring-boot-project/spring-boot-session-data-mongodb/src/main/java/org/springframework/boot/session/data/mongodb/autoconfigure/MongoSessionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-session-data-mongodb/src/main/java/org/springframework/boot/session/data/mongodb/autoconfigure/MongoSessionAutoConfiguration.java @@ -23,13 +23,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.data.mongodb.autoconfigure.MongoDataAutoConfiguration; import org.springframework.boot.data.mongodb.autoconfigure.MongoReactiveDataAutoConfiguration; import org.springframework.boot.session.autoconfigure.SessionAutoConfiguration; import org.springframework.boot.session.autoconfigure.SessionProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-session-data-redis/build.gradle b/spring-boot-project/spring-boot-session-data-redis/build.gradle index 4bbdbb1cf5..8ead2eca28 100644 --- a/spring-boot-project/spring-boot-session-data-redis/build.gradle +++ b/spring-boot-project/spring-boot-session-data-redis/build.gradle @@ -15,14 +15,13 @@ dependencies { api("org.springframework.session:spring-session-data-redis") implementation(project(":spring-boot-project:spring-boot-data-redis")) + implementation(project(":spring-boot-project:spring-boot-web-server")) optional(project(":spring-boot-project:spring-boot-autoconfigure")) optional(project(":spring-boot-project:spring-boot-webflux")) dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) - dockerTestImplementation(project(":spring-boot-project:spring-boot-webflux")) - dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-session"))) dockerTestImplementation("com.redis:testcontainers-redis") diff --git a/spring-boot-project/spring-boot-session-data-redis/src/dockerTest/java/org/springframework/boot/session/data/redis/autoconfigure/ReactiveRedisSessionAutoConfigurationTests.java b/spring-boot-project/spring-boot-session-data-redis/src/dockerTest/java/org/springframework/boot/session/data/redis/autoconfigure/ReactiveRedisSessionAutoConfigurationTests.java index d20ea50b22..c529b2a218 100644 --- a/spring-boot-project/spring-boot-session-data-redis/src/dockerTest/java/org/springframework/boot/session/data/redis/autoconfigure/ReactiveRedisSessionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-session-data-redis/src/dockerTest/java/org/springframework/boot/session/data/redis/autoconfigure/ReactiveRedisSessionAutoConfigurationTests.java @@ -28,7 +28,6 @@ import org.testcontainers.junit.jupiter.Testcontainers; import reactor.core.publisher.Mono; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration; import org.springframework.boot.session.autoconfigure.AbstractReactiveSessionAutoConfigurationTests; @@ -37,6 +36,7 @@ import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplic import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.testsupport.container.TestImage; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.webflux.autoconfigure.WebSessionIdResolverAutoConfiguration; import org.springframework.data.redis.connection.ReactiveRedisConnection; import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; diff --git a/spring-boot-project/spring-boot-session-data-redis/src/dockerTest/java/org/springframework/boot/session/data/redis/autoconfigure/RedisSessionAutoConfigurationTests.java b/spring-boot-project/spring-boot-session-data-redis/src/dockerTest/java/org/springframework/boot/session/data/redis/autoconfigure/RedisSessionAutoConfigurationTests.java index 1d03842bf1..f8f322e436 100644 --- a/spring-boot-project/spring-boot-session-data-redis/src/dockerTest/java/org/springframework/boot/session/data/redis/autoconfigure/RedisSessionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-session-data-redis/src/dockerTest/java/org/springframework/boot/session/data/redis/autoconfigure/RedisSessionAutoConfigurationTests.java @@ -26,7 +26,6 @@ import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.source.InvalidConfigurationPropertyValueException; import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.session.autoconfigure.AbstractSessionAutoConfigurationTests; @@ -35,6 +34,7 @@ import org.springframework.boot.test.context.assertj.AssertableWebApplicationCon import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.testsupport.container.TestImage; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnection; diff --git a/spring-boot-project/spring-boot-session-data-redis/src/main/java/org/springframework/boot/session/data/redis/autoconfigure/RedisSessionAutoConfiguration.java b/spring-boot-project/spring-boot-session-data-redis/src/main/java/org/springframework/boot/session/data/redis/autoconfigure/RedisSessionAutoConfiguration.java index 9f891ddc93..ea7a1202de 100644 --- a/spring-boot-project/spring-boot-session-data-redis/src/main/java/org/springframework/boot/session/data/redis/autoconfigure/RedisSessionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-session-data-redis/src/main/java/org/springframework/boot/session/data/redis/autoconfigure/RedisSessionAutoConfiguration.java @@ -24,7 +24,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.context.properties.source.InvalidConfigurationPropertyValueException; @@ -32,6 +31,7 @@ import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration; import org.springframework.boot.session.autoconfigure.SessionAutoConfiguration; import org.springframework.boot.session.autoconfigure.SessionProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-session-hazelcast/build.gradle b/spring-boot-project/spring-boot-session-hazelcast/build.gradle index e35cbe43ce..980bc99f64 100644 --- a/spring-boot-project/spring-boot-session-hazelcast/build.gradle +++ b/spring-boot-project/spring-boot-session-hazelcast/build.gradle @@ -14,6 +14,7 @@ dependencies { api("org.springframework.session:spring-session-hazelcast") implementation(project(":spring-boot-project:spring-boot-hazelcast")) + implementation(project(":spring-boot-project:spring-boot-web-server")) optional(project(":spring-boot-project:spring-boot-autoconfigure")) diff --git a/spring-boot-project/spring-boot-session-hazelcast/src/main/java/org/springframework/boot/session/hazelcast/autoconfigure/HazelcastSessionAutoConfiguration.java b/spring-boot-project/spring-boot-session-hazelcast/src/main/java/org/springframework/boot/session/hazelcast/autoconfigure/HazelcastSessionAutoConfiguration.java index 579f3b9957..854b836a12 100644 --- a/spring-boot-project/spring-boot-session-hazelcast/src/main/java/org/springframework/boot/session/hazelcast/autoconfigure/HazelcastSessionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-session-hazelcast/src/main/java/org/springframework/boot/session/hazelcast/autoconfigure/HazelcastSessionAutoConfiguration.java @@ -25,11 +25,11 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.session.autoconfigure.SessionAutoConfiguration; import org.springframework.boot.session.autoconfigure.SessionProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.core.Ordered; diff --git a/spring-boot-project/spring-boot-session-hazelcast/src/test/java/org/springframework/boot/session/hazelcast/autoconfigure/HazelcastSessionAutoConfigurationTests.java b/spring-boot-project/spring-boot-session-hazelcast/src/test/java/org/springframework/boot/session/hazelcast/autoconfigure/HazelcastSessionAutoConfigurationTests.java index f7e170bddf..debc3a4f52 100644 --- a/spring-boot-project/spring-boot-session-hazelcast/src/test/java/org/springframework/boot/session/hazelcast/autoconfigure/HazelcastSessionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-session-hazelcast/src/test/java/org/springframework/boot/session/hazelcast/autoconfigure/HazelcastSessionAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,10 +24,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.session.autoconfigure.AbstractSessionAutoConfigurationTests; import org.springframework.boot.session.autoconfigure.SessionAutoConfiguration; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.session.FlushMode; diff --git a/spring-boot-project/spring-boot-session-jdbc/build.gradle b/spring-boot-project/spring-boot-session-jdbc/build.gradle index 46ce7e9122..dfb4829421 100644 --- a/spring-boot-project/spring-boot-session-jdbc/build.gradle +++ b/spring-boot-project/spring-boot-session-jdbc/build.gradle @@ -14,6 +14,7 @@ dependencies { api("org.springframework.session:spring-session-jdbc") implementation(project(":spring-boot-project:spring-boot-jdbc")) + implementation(project(":spring-boot-project:spring-boot-web-server")) optional(project(":spring-boot-project:spring-boot-autoconfigure")) diff --git a/spring-boot-project/spring-boot-session-jdbc/src/main/java/org/springframework/boot/session/jdbc/autoconfigure/JdbcSessionAutoConfiguration.java b/spring-boot-project/spring-boot-session-jdbc/src/main/java/org/springframework/boot/session/jdbc/autoconfigure/JdbcSessionAutoConfiguration.java index f67ad90d4a..4bbc4bc4f3 100644 --- a/spring-boot-project/spring-boot-session-jdbc/src/main/java/org/springframework/boot/session/jdbc/autoconfigure/JdbcSessionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-session-jdbc/src/main/java/org/springframework/boot/session/jdbc/autoconfigure/JdbcSessionAutoConfiguration.java @@ -26,13 +26,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.session.autoconfigure.SessionAutoConfiguration; import org.springframework.boot.session.autoconfigure.SessionProperties; import org.springframework.boot.sql.autoconfigure.init.OnDatabaseInitializationCondition; import org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-session-jdbc/src/test/java/org/springframework/boot/session/jdbc/autoconfigure/JdbcSessionAutoConfigurationTests.java b/spring-boot-project/spring-boot-session-jdbc/src/test/java/org/springframework/boot/session/jdbc/autoconfigure/JdbcSessionAutoConfigurationTests.java index 099a8003d9..a7162bce09 100644 --- a/spring-boot-project/spring-boot-session-jdbc/src/test/java/org/springframework/boot/session/jdbc/autoconfigure/JdbcSessionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-session-jdbc/src/test/java/org/springframework/boot/session/jdbc/autoconfigure/JdbcSessionAutoConfigurationTests.java @@ -26,7 +26,6 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration; @@ -39,6 +38,7 @@ import org.springframework.boot.sql.init.DatabaseInitializationMode; import org.springframework.boot.sql.init.DatabaseInitializationSettings; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithResource; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; diff --git a/spring-boot-project/spring-boot-session/build.gradle b/spring-boot-project/spring-boot-session/build.gradle index 641d91f40a..9e3d78553d 100644 --- a/spring-boot-project/spring-boot-session/build.gradle +++ b/spring-boot-project/spring-boot-session/build.gradle @@ -13,6 +13,8 @@ dependencies { api(project(":spring-boot-project:spring-boot")) api("org.springframework.session:spring-session-core") + implementation(project(":spring-boot-project:spring-boot-web-server")) + optional(project(":spring-boot-project:spring-boot-autoconfigure")) optional("jakarta.servlet:jakarta.servlet-api") optional("org.springframework.security:spring-security-web") diff --git a/spring-boot-project/spring-boot-session/src/main/java/org/springframework/boot/session/autoconfigure/SessionAutoConfiguration.java b/spring-boot-project/spring-boot-session/src/main/java/org/springframework/boot/session/autoconfigure/SessionAutoConfiguration.java index e2a2db95f5..b389b5b835 100644 --- a/spring-boot-project/spring-boot-session/src/main/java/org/springframework/boot/session/autoconfigure/SessionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-session/src/main/java/org/springframework/boot/session/autoconfigure/SessionAutoConfiguration.java @@ -27,11 +27,11 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.web.server.Cookie; import org.springframework.boot.web.server.Cookie.SameSite; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-session/src/test/java/org/springframework/boot/session/autoconfigure/SessionAutoConfigurationTests.java b/spring-boot-project/spring-boot-session/src/test/java/org/springframework/boot/session/autoconfigure/SessionAutoConfigurationTests.java index ba22e2f1f4..5be8c17a92 100644 --- a/spring-boot-project/spring-boot-session/src/test/java/org/springframework/boot/session/autoconfigure/SessionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-session/src/test/java/org/springframework/boot/session/autoconfigure/SessionAutoConfigurationTests.java @@ -24,9 +24,9 @@ import org.junit.jupiter.api.Test; import org.mockito.InOrder; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.servlet.AbstractFilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcAutoConfiguration.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcAutoConfiguration.java index cf7e54c9ea..6dfe901e98 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcAutoConfiguration.java @@ -23,9 +23,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.test.client.reactive.WebTestClientBuilderCustomizer; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; diff --git a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerConfiguration.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerConfiguration.java index 5fe018e6a9..bba3e12611 100644 --- a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerConfiguration.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerConfiguration.java @@ -22,9 +22,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWarDeployment; import org.springframework.boot.autoconfigure.condition.ConditionalOnThreading; import org.springframework.boot.autoconfigure.thread.Threading; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.tomcat.autoconfigure.reactive.TomcatReactiveWebServerAutoConfiguration; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; diff --git a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerFactoryCustomizer.java index e97dec446c..7cbd48a572 100644 --- a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerFactoryCustomizer.java @@ -34,7 +34,6 @@ import org.apache.coyote.http2.Http2Protocol; import org.springframework.boot.autoconfigure.web.ErrorProperties; import org.springframework.boot.autoconfigure.web.ErrorProperties.IncludeAttribute; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.cloud.CloudPlatform; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.tomcat.ConfigurableTomcatWebServerFactory; @@ -42,6 +41,7 @@ import org.springframework.boot.tomcat.autoconfigure.TomcatServerProperties.Acce import org.springframework.boot.tomcat.autoconfigure.TomcatServerProperties.Remoteip; import org.springframework.boot.tomcat.autoconfigure.TomcatServerProperties.UseApr; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.core.Ordered; import org.springframework.core.env.Environment; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfiguration.java index 2b400f0d85..925eec3073 100644 --- a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfiguration.java @@ -24,7 +24,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.web.server.reactive.ReactiveWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.tomcat.TomcatConnectorCustomizer; import org.springframework.boot.tomcat.TomcatContextCustomizer; @@ -32,6 +31,7 @@ import org.springframework.boot.tomcat.TomcatProtocolHandlerCustomizer; import org.springframework.boot.tomcat.autoconfigure.TomcatServerProperties; import org.springframework.boot.tomcat.autoconfigure.TomcatWebServerConfiguration; import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; +import org.springframework.boot.web.server.autoconfigure.reactive.ReactiveWebServerConfiguration; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/servlet/TomcatServletWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/servlet/TomcatServletWebServerAutoConfiguration.java index 554d07a707..3535d71756 100644 --- a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/servlet/TomcatServletWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/servlet/TomcatServletWebServerAutoConfiguration.java @@ -29,9 +29,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.autoconfigure.condition.SearchStrategy; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.boot.autoconfigure.web.server.servlet.ForwardedHeaderFilterCustomizer; -import org.springframework.boot.autoconfigure.web.server.servlet.ServletWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.tomcat.TomcatConnectorCustomizer; import org.springframework.boot.tomcat.TomcatContextCustomizer; @@ -39,6 +36,9 @@ import org.springframework.boot.tomcat.TomcatProtocolHandlerCustomizer; import org.springframework.boot.tomcat.autoconfigure.TomcatServerProperties; import org.springframework.boot.tomcat.autoconfigure.TomcatWebServerConfiguration; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; +import org.springframework.boot.web.server.autoconfigure.servlet.ForwardedHeaderFilterCustomizer; +import org.springframework.boot.web.server.autoconfigure.servlet.ServletWebServerConfiguration; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerFactoryCustomizerTests.java index ece60e281b..3cd64f8941 100644 --- a/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerFactoryCustomizerTests.java @@ -32,14 +32,14 @@ import org.apache.coyote.http2.Http2Protocol; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.boot.autoconfigure.web.ServerProperties.ForwardHeadersStrategy; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties.ForwardHeadersStrategy; import org.springframework.mock.env.MockEnvironment; import org.springframework.test.context.support.TestPropertySourceUtils; import org.springframework.util.unit.DataSize; diff --git a/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfigurationTests.java index 8f80e528a9..1cb937d4bd 100644 --- a/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfigurationTests.java @@ -24,7 +24,6 @@ import org.apache.catalina.connector.Connector; import org.apache.catalina.startup.Tomcat; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.web.server.reactive.AbstractReactiveWebServerAutoConfigurationTests; import org.springframework.boot.tomcat.TomcatConnectorCustomizer; import org.springframework.boot.tomcat.TomcatContextCustomizer; import org.springframework.boot.tomcat.TomcatProtocolHandlerCustomizer; @@ -32,6 +31,7 @@ import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.reactive.AbstractReactiveWebServerAutoConfigurationTests; import org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/servlet/TomcatServletWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/servlet/TomcatServletWebServerAutoConfigurationTests.java index 07dd80d4fe..82cf0280ca 100644 --- a/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/servlet/TomcatServletWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/servlet/TomcatServletWebServerAutoConfigurationTests.java @@ -21,12 +21,12 @@ import org.apache.catalina.Context; import org.apache.catalina.connector.Connector; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.web.server.servlet.AbstractServletWebServerAutoConfigurationTests; import org.springframework.boot.tomcat.TomcatConnectorCustomizer; import org.springframework.boot.tomcat.TomcatContextCustomizer; import org.springframework.boot.tomcat.TomcatProtocolHandlerCustomizer; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.servlet.AbstractServletWebServerAutoConfigurationTests; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerConfiguration.java b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerConfiguration.java index 392929a849..50e673efd1 100644 --- a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerConfiguration.java +++ b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerConfiguration.java @@ -19,8 +19,8 @@ package org.springframework.boot.undertow.autoconfigure; import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWarDeployment; import org.springframework.boot.autoconfigure.condition.ConditionalOnThreading; import org.springframework.boot.autoconfigure.thread.Threading; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.undertow.servlet.UndertowDeploymentInfoCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; diff --git a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerFactoryCustomizer.java index ecf4e06df0..7ea9d8f41c 100644 --- a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerFactoryCustomizer.java @@ -29,12 +29,12 @@ import io.undertow.UndertowOptions; import org.xnio.Option; import org.xnio.Options; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.cloud.CloudPlatform; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.undertow.ConfigurableUndertowWebServerFactory; import org.springframework.boot.undertow.autoconfigure.UndertowServerProperties.Accesslog; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.core.Ordered; import org.springframework.core.env.Environment; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/reactive/UndertowReactiveWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/reactive/UndertowReactiveWebServerAutoConfiguration.java index a5aa7c2660..6bd6a8a965 100644 --- a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/reactive/UndertowReactiveWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/reactive/UndertowReactiveWebServerAutoConfiguration.java @@ -24,12 +24,12 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.web.server.reactive.ReactiveWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.undertow.UndertowBuilderCustomizer; import org.springframework.boot.undertow.autoconfigure.UndertowServerProperties; import org.springframework.boot.undertow.autoconfigure.UndertowWebServerConfiguration; import org.springframework.boot.undertow.reactive.UndertowReactiveWebServerFactory; +import org.springframework.boot.web.server.autoconfigure.reactive.ReactiveWebServerConfiguration; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerAutoConfiguration.java index 1920790229..6e10143650 100644 --- a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerAutoConfiguration.java @@ -29,13 +29,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.autoconfigure.condition.SearchStrategy; -import org.springframework.boot.autoconfigure.web.server.servlet.ServletWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.undertow.UndertowBuilderCustomizer; import org.springframework.boot.undertow.autoconfigure.UndertowServerProperties; import org.springframework.boot.undertow.autoconfigure.UndertowWebServerConfiguration; import org.springframework.boot.undertow.servlet.UndertowDeploymentInfoCustomizer; import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.autoconfigure.servlet.ServletWebServerConfiguration; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerFactoryCustomizer.java index 3072f3998e..c97bcd1085 100644 --- a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerFactoryCustomizer.java @@ -16,10 +16,10 @@ package org.springframework.boot.undertow.autoconfigure.servlet; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.undertow.autoconfigure.UndertowServerProperties; import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; /** * {@link WebServerFactoryCustomizer} to apply {@link ServerProperties} to Undertow diff --git a/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerFactoryCustomizerTests.java index 19e57065d0..cf0dcf1c24 100644 --- a/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/UndertowWebServerFactoryCustomizerTests.java @@ -29,12 +29,12 @@ import org.xnio.Option; import org.xnio.OptionMap; import org.xnio.Options; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; import org.springframework.boot.undertow.ConfigurableUndertowWebServerFactory; import org.springframework.boot.undertow.UndertowBuilderCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.mock.env.MockEnvironment; import org.springframework.test.context.support.TestPropertySourceUtils; import org.springframework.test.util.ReflectionTestUtils; diff --git a/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/reactive/UndertowReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/reactive/UndertowReactiveWebServerAutoConfigurationTests.java index 387db243c3..9004ec1791 100644 --- a/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/reactive/UndertowReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/reactive/UndertowReactiveWebServerAutoConfigurationTests.java @@ -19,11 +19,11 @@ package org.springframework.boot.undertow.autoconfigure.reactive; import io.undertow.Undertow.Builder; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.web.server.reactive.AbstractReactiveWebServerAutoConfigurationTests; import org.springframework.boot.undertow.UndertowBuilderCustomizer; import org.springframework.boot.undertow.reactive.UndertowReactiveWebServerFactory; import org.springframework.boot.undertow.servlet.UndertowDeploymentInfoCustomizer; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.reactive.AbstractReactiveWebServerAutoConfigurationTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerAutoConfigurationTests.java index 5974b43e28..93adf87d68 100644 --- a/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/autoconfigure/servlet/UndertowServletWebServerAutoConfigurationTests.java @@ -21,11 +21,11 @@ import io.undertow.servlet.api.DeploymentInfo; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.web.server.servlet.AbstractServletWebServerAutoConfigurationTests; import org.springframework.boot.undertow.UndertowBuilderCustomizer; import org.springframework.boot.undertow.servlet.UndertowDeploymentInfoCustomizer; import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.servlet.AbstractServletWebServerAutoConfigurationTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-web-server/build.gradle b/spring-boot-project/spring-boot-web-server/build.gradle index 7feb89d3ad..381427beef 100644 --- a/spring-boot-project/spring-boot-web-server/build.gradle +++ b/spring-boot-project/spring-boot-web-server/build.gradle @@ -1,6 +1,7 @@ plugins { id "java-library" id "java-test-fixtures" + id "org.springframework.boot.configuration-properties" id "org.springframework.boot.deployed" id "org.springframework.boot.optional-dependencies" } @@ -11,10 +12,12 @@ dependencies { api(project(":spring-boot-project:spring-boot")) api("org.springframework:spring-web") + optional(project(":spring-boot-project:spring-boot-autoconfigure")) optional("io.projectreactor:reactor-core") optional("jakarta.servlet:jakarta.servlet-api") optional("org.springframework:spring-test") + testFixturesCompileOnly(project(":spring-boot-project:spring-boot-test")) testFixturesCompileOnly(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testFixturesCompileOnly("io.projectreactor:reactor-test") testFixturesCompileOnly("io.projectreactor.netty:reactor-netty-http") @@ -23,10 +26,13 @@ dependencies { testFixturesCompileOnly("org.eclipse.jetty.http2:jetty-http2-client") testFixturesCompileOnly("org.eclipse.jetty.http2:jetty-http2-client-transport") testFixturesCompileOnly("jakarta.servlet:jakarta.servlet-api") + testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-api") + testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-client-api") testFixturesCompileOnly("org.mockito:mockito-core") testFixturesCompileOnly("org.springframework:spring-tx") testFixturesCompileOnly("org.springframework:spring-webflux") + testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) testImplementation("org.apache.tomcat.embed:tomcat-embed-core") diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/ServerProperties.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/ServerProperties.java index 9c273b4ac3..464c576aea 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/ServerProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web; +package org.springframework.boot.web.server.autoconfigure; import java.net.InetAddress; import java.nio.charset.Charset; @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; +import org.springframework.boot.autoconfigure.web.ErrorProperties; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.boot.convert.DurationUnit; diff --git a/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/package-info.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/package-info.java new file mode 100644 index 0000000000..4d87325829 --- /dev/null +++ b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2012-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Classes related to the auto-configuration of a web server. + */ +package org.springframework.boot.web.server.autoconfigure; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/ReactiveWebServerConfiguration.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/reactive/ReactiveWebServerConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/ReactiveWebServerConfiguration.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/reactive/ReactiveWebServerConfiguration.java index 53e88ed185..d2009039f4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/ReactiveWebServerConfiguration.java +++ b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/reactive/ReactiveWebServerConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive; +package org.springframework.boot.web.server.autoconfigure.reactive; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; @@ -25,10 +25,10 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.ssl.SslBundles; import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/ReactiveWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/reactive/ReactiveWebServerFactoryCustomizer.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/ReactiveWebServerFactoryCustomizer.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/reactive/ReactiveWebServerFactoryCustomizer.java index c5dadeda9f..cc987a2119 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/ReactiveWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/reactive/ReactiveWebServerFactoryCustomizer.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive; +package org.springframework.boot.web.server.autoconfigure.reactive; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.ssl.SslBundles; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.reactive.ConfigurableReactiveWebServerFactory; import org.springframework.core.Ordered; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/package-info.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/reactive/package-info.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/package-info.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/reactive/package-info.java index 2901a703b4..0616c19ea1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/package-info.java +++ b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/reactive/package-info.java @@ -17,4 +17,4 @@ /** * Classes related to the auto-configuration of a reactive web server. */ -package org.springframework.boot.autoconfigure.web.server.reactive; +package org.springframework.boot.web.server.autoconfigure.reactive; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ForwardedHeaderFilterCustomizer.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/ForwardedHeaderFilterCustomizer.java similarity index 94% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ForwardedHeaderFilterCustomizer.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/ForwardedHeaderFilterCustomizer.java index f26cb48add..bf316669ec 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ForwardedHeaderFilterCustomizer.java +++ b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/ForwardedHeaderFilterCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.servlet; +package org.springframework.boot.web.server.autoconfigure.servlet; import org.springframework.web.filter.ForwardedHeaderFilter; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerConfiguration.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/ServletWebServerConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerConfiguration.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/ServletWebServerConfiguration.java index dec2975057..04a23ce5f5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerConfiguration.java +++ b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/ServletWebServerConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.servlet; +package org.springframework.boot.web.server.autoconfigure.servlet; import jakarta.servlet.DispatcherType; @@ -27,11 +27,11 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingFilterBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.ssl.SslBundles; import org.springframework.boot.web.error.ErrorPageRegistrarBeanPostProcessor; import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.servlet.CookieSameSiteSupplier; import org.springframework.boot.web.server.servlet.WebListenerRegistrar; import org.springframework.boot.web.servlet.FilterRegistrationBean; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/ServletWebServerFactoryCustomizer.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizer.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/ServletWebServerFactoryCustomizer.java index 3981654250..a937790f54 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/ServletWebServerFactoryCustomizer.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.servlet; +package org.springframework.boot.web.server.autoconfigure.servlet; import java.util.Collections; import java.util.List; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.ssl.SslBundles; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.boot.web.server.servlet.CookieSameSiteSupplier; import org.springframework.boot.web.server.servlet.WebListenerRegistrar; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/package-info.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/package-info.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/package-info.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/package-info.java index 08915aa770..2d059a9bc8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/package-info.java +++ b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/autoconfigure/servlet/package-info.java @@ -17,4 +17,4 @@ /** * Classes related to the auto-configuration of a servlet web server. */ -package org.springframework.boot.autoconfigure.web.server.servlet; +package org.springframework.boot.web.server.autoconfigure.servlet; diff --git a/spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000000..f04fdaac14 --- /dev/null +++ b/spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,217 @@ +{ + "properties": [ + { + "name": "server.connection-timeout", + "type": "java.time.Duration", + "deprecation": { + "reason": "Each server behaves differently. Use server specific properties instead.", + "level": "error" + } + }, + { + "name": "server.error.include-binding-errors", + "description": "When to include \"errors\" attribute.", + "defaultValue": "never" + }, + { + "name": "server.error.include-exception", + "description": "Include the \"exception\" attribute.", + "defaultValue": false + }, + { + "name": "server.error.include-message", + "description": "When to include the \"message\" attribute.", + "defaultValue": "never" + }, + { + "name": "server.error.include-path", + "description": "When to include the \"path\" attribute.", + "defaultValue": "always" + }, + { + "name": "server.error.include-stacktrace", + "description": "When to include the \"trace\" attribute.", + "defaultValue": "never" + }, + { + "name": "server.error.path", + "description": "Path of the error controller", + "defaultValue": "/error" + }, + { + "name": "server.error.whitelabel.enabled", + "description": "Whether to enable the default error page displayed in browsers in case of a server error.", + "defaultValue": true + }, + { + "name": "server.max-http-header-size", + "deprecation": { + "replacement": "server.max-http-request-header-size", + "level": "error" + } + }, + { + "name": "server.max-http-post-size", + "type": "java.lang.Integer", + "description": "Maximum size in bytes of the HTTP post content.", + "defaultValue": 0, + "deprecation": { + "reason": "Use dedicated property for each container.", + "level": "error" + } + }, + { + "name": "server.port", + "defaultValue": 8080 + }, + { + "name": "server.reactive.session.cookie.domain", + "description": "Domain for the cookie." + }, + { + "name": "server.reactive.session.cookie.http-only", + "description": "Whether to use \"HttpOnly\" cookies for the cookie." + }, + { + "name": "server.reactive.session.cookie.max-age", + "description": "Maximum age of the cookie. If a duration suffix is not specified, seconds will be used. A positive value indicates when the cookie expires relative to the current time. A value of 0 means the cookie should expire immediately. A negative value means no \"Max-Age\"." + }, + { + "name": "server.reactive.session.cookie.name", + "description": "Name for the cookie." + }, + { + "name": "server.reactive.session.cookie.partitioned", + "description": "Whether the generated cookie carries the Partitioned attribute." + }, + { + "name": "server.reactive.session.cookie.path", + "description": "Path of the cookie." + }, + { + "name": "server.reactive.session.cookie.same-site", + "description": "SameSite setting for the cookie." + }, + { + "name": "server.reactive.session.cookie.secure", + "description": "Whether to always mark the cookie as secure." + }, + { + "name": "server.servlet.encoding.charset", + "type": "java.nio.charset.Charset", + "description": "Charset of HTTP requests and responses. Added to the Content-Type header if not set explicitly.", + "deprecation": { + "replacement": "spring.servlet.encoding.charset", + "level": "error" + } + }, + { + "name": "server.servlet.encoding.enabled", + "type": "java.lang.Boolean", + "description": "Whether to enable http encoding support.", + "defaultValue": true, + "deprecation": { + "replacement": "spring.servlet.encoding.enabled", + "level": "error" + } + }, + { + "name": "server.servlet.encoding.force", + "type": "java.lang.Boolean", + "description": "Whether to force the encoding to the configured charset on HTTP requests and responses.", + "defaultValue": false, + "deprecation": { + "replacement": "spring.servlet.encoding.force", + "level": "error" + } + }, + { + "name": "server.servlet.encoding.force-request", + "type": "java.lang.Boolean", + "description": "Whether to force the encoding to the configured charset on HTTP requests. Defaults to true when force has not been specified.", + "defaultValue": true, + "deprecation": { + "replacement": "spring.servlet.encoding.force-request", + "level": "error" + } + }, + { + "name": "server.servlet.encoding.force-response", + "type": "java.lang.Boolean", + "description": "Whether to force the encoding to the configured charset on HTTP responses.", + "defaultValue": false, + "deprecation": { + "replacement": "spring.servlet.encoding.force-response", + "level": "error" + } + }, + { + "name": "server.servlet.jsp.class-name", + "description": "Class name of the servlet to use for JSPs. If registered is true and this class\n\t * is on the classpath then it will be registered.", + "defaultValue": "org.apache.jasper.servlet.JspServlet" + }, + { + "name": "server.servlet.jsp.init-parameters", + "description": "Init parameters used to configure the JSP servlet." + }, + { + "name": "server.servlet.path", + "type": "java.lang.String", + "description": "Path of the main dispatcher servlet.", + "defaultValue": "/", + "deprecation": { + "replacement": "spring.mvc.servlet.path", + "level": "error" + } + }, + { + "name": "server.servlet.session.cookie.comment", + "description": "Comment for the cookie.", + "deprecation": { + "level": "error" + } + }, + { + "name": "server.ssl.protocol", + "description": "SSL protocol to use.", + "defaultValue": "TLS" + }, + { + "name": "server.ssl.server-name-bundles", + "description": "Mapping of host names to SSL bundles for SNI configuration." + }, + { + "name": "server.ssl.trust-certificate", + "description": "Path to a PEM-encoded SSL certificate authority file." + }, + { + "name": "server.ssl.trust-certificate-private-key", + "description": "Path to a PEM-encoded private key file for the SSL certificate authority." + }, + { + "name": "server.ssl.trust-store", + "description": "Trust store that holds SSL certificates." + }, + { + "name": "server.ssl.trust-store-password", + "description": "Password used to access the trust store." + }, + { + "name": "server.ssl.trust-store-provider", + "description": "Provider for the trust store." + }, + { + "name": "server.ssl.trust-store-type", + "description": "Type of the trust store." + }, + { + "name": "server.use-forward-headers", + "type": "java.lang.Boolean", + "deprecation": { + "reason": "Replaced to support additional strategies.", + "replacement": "server.forward-headers-strategy", + "level": "error" + } + } + ] +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index 543167aa35..fe75f73c4a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -26,9 +26,9 @@ import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySource; import org.springframework.boot.context.properties.source.MapConfigurationPropertySource; -import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; import org.springframework.boot.web.server.MimeMappings; import org.springframework.boot.web.server.MimeMappings.Mapping; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.util.unit.DataSize; import static org.assertj.core.api.Assertions.assertThat; @@ -51,7 +51,6 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Lasse Wulff * @author Moritz Halbritter */ -@DirtiesUrlFactories class ServerPropertiesTests { private final ServerProperties properties = new ServerProperties(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/ReactiveWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/autoconfigure/reactive/ReactiveWebServerFactoryCustomizerTests.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/ReactiveWebServerFactoryCustomizerTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/autoconfigure/reactive/ReactiveWebServerFactoryCustomizerTests.java index 026b00a4ec..f340e842c8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/ReactiveWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/autoconfigure/reactive/ReactiveWebServerFactoryCustomizerTests.java @@ -14,18 +14,18 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive; +package org.springframework.boot.web.server.autoconfigure.reactive; import java.net.InetAddress; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.ssl.DefaultSslBundleRegistry; import org.springframework.boot.ssl.SslBundles; import org.springframework.boot.web.server.Shutdown; import org.springframework.boot.web.server.Ssl; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.reactive.ConfigurableReactiveWebServerFactory; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/autoconfigure/servlet/ServletWebServerFactoryCustomizerTests.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizerTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/autoconfigure/servlet/ServletWebServerFactoryCustomizerTests.java index fa575f72ce..5d4d56f919 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/autoconfigure/servlet/ServletWebServerFactoryCustomizerTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.servlet; +package org.springframework.boot.web.server.autoconfigure.servlet; import java.io.File; import java.nio.charset.StandardCharsets; @@ -26,7 +26,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySource; @@ -35,6 +34,7 @@ import org.springframework.boot.web.server.Cookie; import org.springframework.boot.web.server.MimeMappings; import org.springframework.boot.web.server.Shutdown; import org.springframework.boot.web.server.Ssl; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.boot.web.server.servlet.Jsp; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/reactive/AbstractReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/reactive/AbstractReactiveWebServerAutoConfigurationTests.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/reactive/AbstractReactiveWebServerAutoConfigurationTests.java rename to spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/reactive/AbstractReactiveWebServerAutoConfigurationTests.java index 0f12118367..68c713938c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/reactive/AbstractReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/reactive/AbstractReactiveWebServerAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive; +package org.springframework.boot.web.server.autoconfigure.reactive; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/servlet/AbstractServletWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/servlet/AbstractServletWebServerAutoConfigurationTests.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/servlet/AbstractServletWebServerAutoConfigurationTests.java rename to spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/servlet/AbstractServletWebServerAutoConfigurationTests.java index 53899b09c3..ef67ab73ad 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/servlet/AbstractServletWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/servlet/AbstractServletWebServerAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.servlet; +package org.springframework.boot.web.server.autoconfigure.servlet; import java.io.IOException; diff --git a/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfiguration.java b/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfiguration.java index 3eb6d14225..25ad8083d5 100644 --- a/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfiguration.java +++ b/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfiguration.java @@ -36,7 +36,6 @@ import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguratio import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders; import org.springframework.boot.autoconfigure.thread.Threading; import org.springframework.boot.autoconfigure.web.ConditionalOnEnabledResourceChain; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.WebProperties; import org.springframework.boot.autoconfigure.web.WebProperties.Resources; import org.springframework.boot.autoconfigure.web.WebResourcesRuntimeHints; @@ -47,6 +46,7 @@ import org.springframework.boot.convert.ApplicationConversionService; import org.springframework.boot.http.codec.CodecCustomizer; import org.springframework.boot.http.codec.autoconfigure.CodecsAutoConfiguration; import org.springframework.boot.validation.autoconfigure.ValidatorAdapter; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.webflux.autoconfigure.WebFluxProperties.Format; import org.springframework.boot.webflux.filter.OrderedHiddenHttpMethodFilter; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/WebSessionIdResolverAutoConfiguration.java b/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/WebSessionIdResolverAutoConfiguration.java index 081b0723cd..6440c2f7cb 100644 --- a/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/WebSessionIdResolverAutoConfiguration.java +++ b/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/WebSessionIdResolverAutoConfiguration.java @@ -23,11 +23,11 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.web.server.Cookie; import org.springframework.boot.web.server.Cookie.SameSite; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import org.springframework.http.ResponseCookie.ResponseCookieBuilder; import org.springframework.util.StringUtils; diff --git a/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/error/ErrorWebFluxAutoConfiguration.java b/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/error/ErrorWebFluxAutoConfiguration.java index db92ba0e35..8706235f96 100644 --- a/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/error/ErrorWebFluxAutoConfiguration.java +++ b/spring-boot-project/spring-boot-webflux/src/main/java/org/springframework/boot/webflux/autoconfigure/error/ErrorWebFluxAutoConfiguration.java @@ -23,9 +23,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.SearchStrategy; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.WebProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.boot.webflux.error.DefaultErrorAttributes; import org.springframework.boot.webflux.error.ErrorAttributes; diff --git a/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java b/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java index a7902782d6..b2eb160670 100644 --- a/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java @@ -47,7 +47,6 @@ import org.junit.jupiter.params.provider.ValueSource; import org.springframework.aop.support.AopUtils; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.http.codec.CodecCustomizer; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ContextConsumer; @@ -56,6 +55,7 @@ import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration; import org.springframework.boot.validation.autoconfigure.ValidatorAdapter; import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration.WebFluxConfig; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfigurationTests.OrderedControllerAdviceBeansConfiguration.HighestOrderedControllerAdvice; diff --git a/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/error/DefaultErrorWebExceptionHandlerIntegrationTests.java b/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/error/DefaultErrorWebExceptionHandlerIntegrationTests.java index 1e55a0e25f..d6ab7a2bd3 100644 --- a/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/error/DefaultErrorWebExceptionHandlerIntegrationTests.java +++ b/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/error/DefaultErrorWebExceptionHandlerIntegrationTests.java @@ -32,7 +32,6 @@ import reactor.core.scheduler.Schedulers; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.WebProperties; import org.springframework.boot.mustache.autoconfigure.MustacheAutoConfiguration; import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; @@ -43,6 +42,7 @@ import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.web.error.ErrorAttributeOptions; import org.springframework.boot.web.error.ErrorAttributeOptions.Include; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.webflux.autoconfigure.HttpHandlerAutoConfiguration; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.boot.webflux.error.DefaultErrorAttributes; diff --git a/spring-boot-project/spring-boot-webmvc/build.gradle b/spring-boot-project/spring-boot-webmvc/build.gradle index c4e2b9e1a7..a4bed6715e 100644 --- a/spring-boot-project/spring-boot-webmvc/build.gradle +++ b/spring-boot-project/spring-boot-webmvc/build.gradle @@ -19,6 +19,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-autoconfigure")) optional(project(":spring-boot-project:spring-boot-validation")) + optional(project(":spring-boot-project:spring-boot-web-server")) testImplementation(project(":spring-boot-project:spring-boot-freemarker")) testImplementation(project(":spring-boot-project:spring-boot-test")) diff --git a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java index b3e5802e86..4bd36dbb9f 100644 --- a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java @@ -44,13 +44,13 @@ import org.springframework.boot.autoconfigure.condition.SearchStrategy; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider; import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.WebProperties; import org.springframework.boot.autoconfigure.web.WebProperties.Resources; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.error.ErrorPageRegistrar; import org.springframework.boot.web.error.ErrorPageRegistry; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcProperties; @@ -84,7 +84,7 @@ import org.springframework.web.util.HtmlUtils; // Load before the main WebMvcAutoConfiguration so that the error View is available @AutoConfiguration(before = WebMvcAutoConfiguration.class) @ConditionalOnWebApplication(type = Type.SERVLET) -@ConditionalOnClass({ Servlet.class, DispatcherServlet.class }) +@ConditionalOnClass({ Servlet.class, DispatcherServlet.class, ServerProperties.class }) @EnableConfigurationProperties({ ServerProperties.class, WebMvcProperties.class }) public class ErrorMvcAutoConfiguration { diff --git a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/BasicErrorControllerIntegrationTests.java b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/BasicErrorControllerIntegrationTests.java index 1a7ec0a86e..2c710984fe 100755 --- a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/BasicErrorControllerIntegrationTests.java +++ b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/BasicErrorControllerIntegrationTests.java @@ -39,13 +39,13 @@ import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.freemarker.autoconfigure.FreeMarkerAutoConfiguration; import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; import org.springframework.boot.web.error.ErrorAttributeOptions; import org.springframework.boot.web.error.ErrorAttributeOptions.Include; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.test.client.TestRestTemplate; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/build.gradle index 18cb1d0696..e452f63f8d 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/build.gradle @@ -10,4 +10,5 @@ dependencies { implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) + testImplementation(project(":spring-boot-project:spring-boot-web-server")) } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/src/test/java/smoketest/propertyvalidation/SamplePropertyValidationApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/src/test/java/smoketest/propertyvalidation/SamplePropertyValidationApplicationTests.java index 11c453eb84..c36202f320 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/src/test/java/smoketest/propertyvalidation/SamplePropertyValidationApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/src/test/java/smoketest/propertyvalidation/SamplePropertyValidationApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,9 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.BeanCreationException; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.bind.validation.BindValidationException; import org.springframework.boot.test.util.TestPropertyValues; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/checkstyle/import-control.xml b/src/checkstyle/import-control.xml index 5935334b2a..2ff31bf9c9 100644 --- a/src/checkstyle/import-control.xml +++ b/src/checkstyle/import-control.xml @@ -120,6 +120,13 @@ + + + + + + +