From 6384e3265c8ceccd0a7de789c3d3f3fb4f46baa4 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 3 Mar 2025 11:47:30 +0000 Subject: [PATCH] Create beginnings of spring-boot-tomcat module See gh-46073 --- settings.gradle | 1 + .../build.gradle | 1 + .../TomcatMetricsAutoConfiguration.java | 3 +- .../tomcat/TomcatAccessLogCustomizer.java | 2 +- ...veManagementChildContextConfiguration.java | 2 +- ...etManagementChildContextConfiguration.java | 2 +- ...FoundryMvcWebEndpointIntegrationTests.java | 2 +- ...slVerificationHttpRequestFactoryTests.java | 2 +- .../TomcatMetricsAutoConfigurationTests.java | 6 +- .../EndpointRequestIntegrationTests.java | 2 +- ...JerseyEndpointRequestIntegrationTests.java | 2 +- .../MvcEndpointRequestIntegrationTests.java | 2 +- ...ingsEndpointServletDocumentationTests.java | 2 +- ...dContextConfigurationIntegrationTests.java | 2 +- .../spring-boot-actuator/build.gradle | 1 + .../web/tomcat/TomcatMetricsBinder.java | 2 +- .../DispatcherServletHandlerMappings.java | 8 ++- .../web/annotation/BaseConfiguration.java | 2 +- .../JerseyWebEndpointIntegrationTests.java | 2 +- ...ndpointHandlerMappingIntegrationTests.java | 2 +- .../MvcWebEndpointIntegrationTests.java | 2 +- ...EndpointTestInvocationContextProvider.java | 2 +- .../spring-boot-all/build.gradle | 23 +----- .../main/resources/META-INF/spring.factories | 3 +- ...tClientHttpRequestFactoryBuilderTests.java | 2 +- ...stractClientHttpConnectorBuilderTests.java | 2 +- ...stractClientHttpRequestFactoriesTests.java | 2 +- .../ServletWebServerMvcIntegrationTests.java | 2 +- .../ErrorPageFilterIntegrationTests.java | 2 +- .../spring-boot-autoconfigure/build.gradle | 1 + .../EnableAutoConfiguration.java | 2 +- ...catReactiveWebServerAutoConfiguration.java | 10 +-- ...catReactiveWebServerFactoryCustomizer.java | 2 +- ...mcatServletWebServerAutoConfiguration.java | 10 +-- ...mcatServletWebServerFactoryCustomizer.java | 4 +- ...tualThreadsWebServerFactoryCustomizer.java | 2 +- .../TomcatWebServerFactoryCustomizer.java | 2 +- ...ocketTomcatWebServerFactoryCustomizer.java | 2 +- ...utoConfigurationServletContainerTests.java | 2 +- ...ientWebSecurityAutoConfigurationTests.java | 2 +- ...ConfigurationEarlyInitializationTests.java | 2 +- .../web/TomcatServerPropertiesTests.java | 2 +- ...activeWebServerAutoConfigurationTests.java | 10 +-- ...tWebServerServletContextListenerTests.java | 2 +- ...ervletWebServerAutoConfigurationTests.java | 8 +-- ...ervletWebServerFactoryCustomizerTests.java | 4 +- ...hreadsWebServerFactoryCustomizerTests.java | 4 +- ...TomcatWebServerFactoryCustomizerTests.java | 4 +- .../MultipartAutoConfigurationTests.java | 2 +- .../servlet/WebMvcAutoConfigurationTests.java | 2 +- ...SocketMessagingAutoConfigurationTests.java | 2 +- .../spring-boot-dependencies/build.gradle | 3 +- .../spring-boot-devtools/build.gradle | 3 +- .../LocalDevToolsAutoConfigurationTests.java | 2 +- .../RemoteClientConfigurationTests.java | 2 +- .../spring-boot-docs/build.gradle | 1 + .../MyCloudFoundryConfiguration.java | 2 +- .../MyTomcatWebServerCustomizer.java | 2 +- .../MyTomcatConfiguration.java | 2 +- .../MyTomcatWebServerFactoryCustomizer.java | 2 +- .../MyCloudFoundryConfiguration.kt | 2 +- .../configure/MyTomcatWebServerCustomizer.kt | 2 +- .../MyTomcatConfiguration.kt | 2 +- .../MyTomcatWebServerFactoryCustomizer.kt | 2 +- .../spring-boot-starter-tomcat/build.gradle | 4 +- .../build.gradle | 2 + .../spring-boot-test/build.gradle | 1 + ...stEmbeddedReactiveWebEnvironmentTests.java | 2 +- ...gBootTestWebServerWebEnvironmentTests.java | 2 +- ...sterContextCustomizerIntegrationTests.java | 2 +- ...textCustomizerWithCustomBasePathTests.java | 2 +- ...tCustomizerWithCustomContextPathTests.java | 2 +- ...lateContextCustomizerIntegrationTests.java | 2 +- ...ContextCustomizerWithFactoryBeanTests.java | 2 +- ...ustomizerWithOverrideIntegrationTests.java | 2 +- ...ientContextCustomizerIntegrationTests.java | 2 +- ...textCustomizerWithCustomBasePathTests.java | 2 +- ...tCustomizerWithCustomContextPathTests.java | 2 +- ...ustomizerWithOverrideIntegrationTests.java | 2 +- .../spring-boot-tomcat/build.gradle | 67 ++++++++++++++++++ .../CompressionConnectorCustomizer.java | 2 +- .../ConfigurableTomcatWebServerFactory.java | 6 +- .../tomcat/ConnectorStartFailedException.java | 2 +- .../tomcat/ConnectorStartFailureAnalyzer.java | 2 +- ...bleReferenceClearingContextCustomizer.java | 2 +- .../boot}/tomcat/GracefulShutdown.java | 2 +- .../boot}/tomcat/LazySessionIdGenerator.java | 2 +- .../boot}/tomcat/SslConnectorCustomizer.java | 2 +- .../tomcat/TomcatConnectorCustomizer.java | 2 +- .../boot}/tomcat/TomcatContextCustomizer.java | 4 +- .../boot}/tomcat/TomcatEmbeddedContext.java | 2 +- .../TomcatEmbeddedWebappClassLoader.java | 2 +- .../TomcatProtocolHandlerCustomizer.java | 2 +- .../boot}/tomcat/TomcatStarter.java | 2 +- .../boot}/tomcat/TomcatWebServer.java | 6 +- .../boot}/tomcat/TomcatWebServerFactory.java | 2 +- .../boot}/tomcat/package-info.java | 6 +- .../TomcatReactiveWebServerFactory.java | 14 ++-- .../boot/tomcat/reactive}/package-info.java | 2 +- .../tomcat/servlet}/NestedJarResourceSet.java | 2 +- .../boot/tomcat/servlet}/TldPatterns.java | 2 +- .../TomcatServletWebServerFactory.java | 18 ++--- .../boot/tomcat/servlet}/package-info.java | 2 +- .../main/resources/META-INF/spring.factories | 3 + .../CompressionConnectorCustomizerTests.java | 2 +- .../tomcat/SslConnectorCustomizerTests.java | 2 +- .../boot}/tomcat/TomcatAccess.java | 2 +- .../TomcatEmbeddedWebappClassLoaderTests.java | 2 +- .../TomcatReactiveWebServerFactoryTests.java | 12 ++-- .../tomcat/servlet}/TldPatternsTests.java | 2 +- .../TomcatServletWebServerFactoryTests.java | 16 ++--- .../boot/tomcat/servlet}/1.crt | 0 .../boot/tomcat/servlet}/1.key | 0 .../boot/tomcat/servlet}/2.crt | 0 .../boot/tomcat/servlet}/2.key | 0 .../boot/tomcat/servlet}/test.jks | Bin .../org/springframework/boot}/tomcat/test.jks | Bin .../spring-boot-deployment-tests/build.gradle | 5 +- .../deployment/AbstractDeploymentTests.java | 1 + .../boot/image/paketo/PaketoBuilderTests.java | 1 + .../PaketoBuilderTests-plainWarApp.gradle | 1 - .../SampleTomcatTwoConnectorsApplication.java | 2 +- ...leTomcatTwoConnectorsApplicationTests.java | 2 +- .../tomcat/SampleTomcatApplicationTests.java | 2 +- .../SampleTomcat11ApplicationTests.java | 2 +- ...omContainerWebSocketsApplicationTests.java | 2 +- 126 files changed, 252 insertions(+), 189 deletions(-) create mode 100644 spring-boot-project/spring-boot-tomcat/build.gradle rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/CompressionConnectorCustomizer.java (97%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/ConfigurableTomcatWebServerFactory.java (92%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/ConnectorStartFailedException.java (96%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/ConnectorStartFailureAnalyzer.java (96%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/DisableReferenceClearingContextCustomizer.java (96%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/GracefulShutdown.java (98%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/LazySessionIdGenerator.java (95%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/SslConnectorCustomizer.java (99%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/TomcatConnectorCustomizer.java (95%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/TomcatContextCustomizer.java (87%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/TomcatEmbeddedContext.java (98%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/TomcatEmbeddedWebappClassLoader.java (98%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/TomcatProtocolHandlerCustomizer.java (95%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/TomcatStarter.java (97%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/TomcatWebServer.java (98%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/TomcatWebServerFactory.java (99%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server => spring-boot-tomcat/src/main/java/org/springframework/boot}/tomcat/package-info.java (75%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/tomcat => spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/reactive}/TomcatReactiveWebServerFactory.java (89%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/tomcat => spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/reactive}/package-info.java (91%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet}/NestedJarResourceSet.java (98%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet}/TldPatterns.java (99%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet}/TomcatServletWebServerFactory.java (97%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet}/package-info.java (91%) create mode 100644 spring-boot-project/spring-boot-tomcat/src/main/resources/META-INF/spring.factories rename spring-boot-project/{spring-boot-all/src/test/java/org/springframework/boot/web/server => spring-boot-tomcat/src/test/java/org/springframework/boot}/tomcat/CompressionConnectorCustomizerTests.java (98%) rename spring-boot-project/{spring-boot-all/src/test/java/org/springframework/boot/web/server => spring-boot-tomcat/src/test/java/org/springframework/boot}/tomcat/SslConnectorCustomizerTests.java (99%) rename spring-boot-project/{spring-boot-all/src/test/java/org/springframework/boot/web/server => spring-boot-tomcat/src/test/java/org/springframework/boot}/tomcat/TomcatAccess.java (95%) rename spring-boot-project/{spring-boot-all/src/test/java/org/springframework/boot/web/server => spring-boot-tomcat/src/test/java/org/springframework/boot}/tomcat/TomcatEmbeddedWebappClassLoaderTests.java (98%) rename spring-boot-project/{spring-boot-all/src/test/java/org/springframework/boot/web/server/reactive/tomcat => spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/reactive}/TomcatReactiveWebServerFactoryTests.java (96%) rename spring-boot-project/{spring-boot-all/src/test/java/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/servlet}/TldPatternsTests.java (97%) rename spring-boot-project/{spring-boot-all/src/test/java/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/servlet}/TomcatServletWebServerFactoryTests.java (98%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet}/1.crt (100%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet}/1.key (100%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet}/2.crt (100%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet}/2.key (100%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat => spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet}/test.jks (100%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server => spring-boot-tomcat/src/test/resources/org/springframework/boot}/tomcat/test.jks (100%) diff --git a/settings.gradle b/settings.gradle index 4da6bf37633..370cf8aa8c0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -66,6 +66,7 @@ include "spring-boot-project:spring-boot-parent" include "spring-boot-project:spring-boot-test" include "spring-boot-project:spring-boot-test-autoconfigure" include "spring-boot-project:spring-boot-testcontainers" +include "spring-boot-project:spring-boot-tomcat" include "spring-boot-project:spring-boot-tools:spring-boot-antlib" include "spring-boot-project:spring-boot-tools:spring-boot-autoconfigure-processor" include "spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index d7c83a9a3c5..a0719bcd823 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -33,6 +33,7 @@ dependencies { implementation("com.fasterxml.jackson.core:jackson-databind") implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") + optional(project(":spring-boot-project:spring-boot-tomcat")) optional("ch.qos.logback:logback-classic") optional("org.apache.cassandra:java-driver-core") { exclude group: "org.slf4j", module: "jcl-over-slf4j" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfiguration.java index 86efeba8cb1..070228ffe38 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfiguration.java @@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; 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.tomcat.TomcatWebServer; import org.springframework.context.annotation.Bean; /** @@ -38,7 +39,7 @@ import org.springframework.context.annotation.Bean; */ @AutoConfiguration(after = CompositeMeterRegistryAutoConfiguration.class) @ConditionalOnWebApplication -@ConditionalOnClass({ TomcatMetrics.class, Manager.class }) +@ConditionalOnClass({ TomcatMetrics.class, Manager.class, TomcatWebServer.class }) public class TomcatMetricsAutoConfiguration { @Bean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatAccessLogCustomizer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatAccessLogCustomizer.java index eb5075441a3..02d4d7d008e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatAccessLogCustomizer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatAccessLogCustomizer.java @@ -23,7 +23,7 @@ import org.apache.catalina.Valve; import org.apache.catalina.valves.AccessLogValve; import org.springframework.boot.actuate.autoconfigure.web.server.AccessLogCustomizer; -import org.springframework.boot.web.server.tomcat.ConfigurableTomcatWebServerFactory; +import org.springframework.boot.tomcat.ConfigurableTomcatWebServerFactory; /** * {@link AccessLogCustomizer} for Tomcat. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatReactiveManagementChildContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatReactiveManagementChildContextConfiguration.java index 3c6022b3a04..f35fd4da196 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatReactiveManagementChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatReactiveManagementChildContextConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.context.annotation.Bean; /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatServletManagementChildContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatServletManagementChildContextConfiguration.java index 7300d3e5e26..eac0486e89f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatServletManagementChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/tomcat/TomcatServletManagementChildContextConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.context.annotation.Bean; /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java index e3401615378..80ef40f96cf 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java @@ -44,7 +44,7 @@ import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes; import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint; import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/SkipSslVerificationHttpRequestFactoryTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/SkipSslVerificationHttpRequestFactoryTests.java index 3cfde9e84e7..95295e5b95b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/SkipSslVerificationHttpRequestFactoryTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/SkipSslVerificationHttpRequestFactoryTests.java @@ -23,9 +23,9 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.testsupport.classpath.resources.WithPackageResources; import org.springframework.boot.testsupport.web.servlet.ExampleServlet; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.Ssl; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java index ca2231d8215..12f3907e974 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java @@ -33,10 +33,10 @@ import org.springframework.boot.autoconfigure.web.server.servlet.tomcat.TomcatSe import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.boot.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestIntegrationTests.java index 453f39fcce5..288c12d6cde 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestIntegrationTests.java @@ -38,8 +38,8 @@ import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfigurat import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/JerseyEndpointRequestIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/JerseyEndpointRequestIntegrationTests.java index 6f637b77101..17a83a58810 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/JerseyEndpointRequestIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/JerseyEndpointRequestIntegrationTests.java @@ -25,7 +25,7 @@ import org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/MvcEndpointRequestIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/MvcEndpointRequestIntegrationTests.java index 07b8cceef67..c469beea766 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/MvcEndpointRequestIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/MvcEndpointRequestIntegrationTests.java @@ -25,7 +25,7 @@ import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoC import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointServletDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointServletDocumentationTests.java index 9720131daa3..9ea8d10c82e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointServletDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointServletDocumentationTests.java @@ -34,7 +34,7 @@ import org.springframework.boot.actuate.web.mappings.servlet.ServletsMappingDesc import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.server.LocalServerPort; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationIntegrationTests.java index b33c45c0c47..dbf694daea1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationIntegrationTests.java @@ -44,11 +44,11 @@ import org.springframework.boot.env.ConfigTreePropertySource; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; +import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; import org.springframework.context.ApplicationListener; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.convert.support.ConfigurableConversionService; diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index 5a59ecff7be..2809c5e2c9d 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -39,6 +39,7 @@ dependencies { dockerTestImplementation("org.testcontainers:neo4j") dockerTestImplementation("org.testcontainers:testcontainers") + optional(project(":spring-boot-project:spring-boot-tomcat")) optional("org.apache.cassandra:java-driver-core") { exclude group: "org.slf4j", module: "jcl-over-slf4j" } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/tomcat/TomcatMetricsBinder.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/tomcat/TomcatMetricsBinder.java index a8f632e2283..8437ec28add 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/tomcat/TomcatMetricsBinder.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/tomcat/TomcatMetricsBinder.java @@ -27,9 +27,9 @@ import org.apache.catalina.Manager; import org.springframework.beans.factory.DisposableBean; import org.springframework.boot.context.event.ApplicationStartedEvent; +import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java index afa6022b6d5..bcd07317ce6 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java @@ -26,10 +26,11 @@ import org.apache.catalina.Container; import org.apache.catalina.Context; import org.apache.catalina.core.StandardWrapper; +import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServer; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.util.ClassUtils; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.servlet.DispatcherServlet; import org.springframework.web.servlet.HandlerMapping; @@ -43,6 +44,9 @@ import org.springframework.web.servlet.HandlerMapping; */ final class DispatcherServletHandlerMappings { + private static final boolean TOMCAT_WEB_SERVER_PRESENT = ClassUtils.isPresent( + "org.springframework.boot.tomcat.TomcatWebServer", DispatcherServletHandlerMappings.class.getClassLoader()); + private final String name; private final DispatcherServlet dispatcherServlet; @@ -73,7 +77,7 @@ final class DispatcherServletHandlerMappings { if (webServer instanceof UndertowServletWebServer undertowServletWebServer) { new UndertowServletInitializer(undertowServletWebServer).initializeServlet(this.name); } - else if (webServer instanceof TomcatWebServer tomcatWebServer) { + else if (TOMCAT_WEB_SERVER_PRESENT && webServer instanceof TomcatWebServer tomcatWebServer) { new TomcatServletInitializer(tomcatWebServer).initializeServlet(this.name); } } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/BaseConfiguration.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/BaseConfiguration.java index 0dfafc24656..5e23c718ef6 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/BaseConfiguration.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/BaseConfiguration.java @@ -25,7 +25,7 @@ import org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper; import org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper; import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes; import org.springframework.boot.actuate.endpoint.web.PathMapper; -import org.springframework.boot.web.server.tomcat.TomcatEmbeddedWebappClassLoader; +import org.springframework.boot.tomcat.TomcatEmbeddedWebappClassLoader; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java index 3c85a15f8d8..2c0d91bf1c5 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java @@ -40,7 +40,7 @@ import org.springframework.boot.actuate.endpoint.web.EndpointMapping; import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes; import org.springframework.boot.actuate.endpoint.web.annotation.AbstractWebEndpointIntegrationTests; import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java index 53c953b63fe..5fe4a3cfe33 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java @@ -38,7 +38,7 @@ import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguratio import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java index b6dbe78fb53..3bee440e01a 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java @@ -38,7 +38,7 @@ import org.springframework.boot.autoconfigure.web.server.servlet.tomcat.TomcatSe import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java index 02d35809888..18477e86e62 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java @@ -55,10 +55,10 @@ import org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; diff --git a/spring-boot-project/spring-boot-all/build.gradle b/spring-boot-project/spring-boot-all/build.gradle index c69bdd49b30..7491c1eeda8 100644 --- a/spring-boot-project/spring-boot-all/build.gradle +++ b/spring-boot-project/spring-boot-all/build.gradle @@ -25,17 +25,10 @@ plugins { description = "Spring Boot All" -def tomcatConfigProperties = layout.buildDirectory.dir("tomcat-config-properties") - -configurations { - tomcatDistribution -} - dependencies { api(project(":spring-boot-project:spring-boot")) api("org.springframework:spring-core") api("org.springframework:spring-context") - optional("ch.qos.logback:logback-classic") optional("com.clickhouse:clickhouse-jdbc") optional("com.fasterxml.jackson.core:jackson-databind") @@ -66,7 +59,6 @@ dependencies { optional("org.apache.logging.log4j:log4j-api") optional("org.apache.logging.log4j:log4j-core") optional("org.apache.logging.log4j:log4j-jul") - optional("org.apache.tomcat.embed:tomcat-embed-core") optional("org.apache.tomcat.embed:tomcat-embed-jasper") optional("org.apache.tomcat:tomcat-jdbc") optional("org.assertj:assertj-core") @@ -118,6 +110,7 @@ dependencies { exclude(group: "commons-logging", module: "commons-logging") } + testImplementation(project(":spring-boot-project:spring-boot-tomcat")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) testImplementation("com.ibm.db2:jcc") @@ -151,17 +144,6 @@ dependencies { testRuntimeOnly("org.testcontainers:jdbc") { exclude group: "javax.annotation", module: "javax.annotation-api" } - - tomcatDistribution("org.apache.tomcat:tomcat:${tomcatVersion}@zip") -} - -task extractTomcatConfigProperties(type: Sync) { - destinationDir = file(tomcatConfigProperties) - from { - zipTree(configurations.tomcatDistribution.incoming.files.singleFile).matching { - include '**/conf/catalina.properties' - }.singleFile - } } def syncJavaTemplates = tasks.register("syncJavaTemplates", Sync) { @@ -192,9 +174,6 @@ sourceSets { srcDirs syncJavaTemplates } } - test { - output.dir(tomcatConfigProperties, builtBy: "extractTomcatConfigProperties") - } } test { diff --git a/spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories index 3f534dcaa8a..a9e65d892ce 100644 --- a/spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories @@ -8,8 +8,7 @@ org.springframework.boot.reactor.ReactorEnvironmentPostProcessor # Failure Analyzers org.springframework.boot.diagnostics.FailureAnalyzer=\ -org.springframework.boot.liquibase.LiquibaseChangelogMissingFailureAnalyzer,\ -org.springframework.boot.web.server.tomcat.ConnectorStartFailureAnalyzer +org.springframework.boot.liquibase.LiquibaseChangelogMissingFailureAnalyzer # Database Initializer Detectors org.springframework.boot.sql.init.dependency.DatabaseInitializerDetector=\ diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/http/client/AbstractClientHttpRequestFactoryBuilderTests.java b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/http/client/AbstractClientHttpRequestFactoryBuilderTests.java index 3f9037a8405..acd34cf65d5 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/http/client/AbstractClientHttpRequestFactoryBuilderTests.java +++ b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/http/client/AbstractClientHttpRequestFactoryBuilderTests.java @@ -41,10 +41,10 @@ import org.springframework.boot.ssl.jks.JksSslStoreBundle; import org.springframework.boot.ssl.jks.JksSslStoreDetails; import org.springframework.boot.testsupport.classpath.resources.WithPackageResources; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.Ssl; import org.springframework.boot.web.server.Ssl.ClientAuth; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpRequest; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/http/client/reactive/AbstractClientHttpConnectorBuilderTests.java b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/http/client/reactive/AbstractClientHttpConnectorBuilderTests.java index b526507fab7..53d1c6b14c0 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/http/client/reactive/AbstractClientHttpConnectorBuilderTests.java +++ b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/http/client/reactive/AbstractClientHttpConnectorBuilderTests.java @@ -41,10 +41,10 @@ import org.springframework.boot.ssl.jks.JksSslStoreBundle; import org.springframework.boot.ssl.jks.JksSslStoreDetails; import org.springframework.boot.testsupport.classpath.resources.WithPackageResources; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.Ssl; import org.springframework.boot.web.server.Ssl.ClientAuth; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.client.reactive.ClientHttpConnector; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/client/AbstractClientHttpRequestFactoriesTests.java b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/client/AbstractClientHttpRequestFactoriesTests.java index 35e47edac37..ea9faf8166c 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/client/AbstractClientHttpRequestFactoriesTests.java +++ b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/client/AbstractClientHttpRequestFactoriesTests.java @@ -38,10 +38,10 @@ import org.springframework.boot.ssl.jks.JksSslStoreBundle; import org.springframework.boot.ssl.jks.JksSslStoreDetails; import org.springframework.boot.testsupport.classpath.resources.WithPackageResources; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.Ssl; import org.springframework.boot.web.server.Ssl.ClientAuth; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.http.HttpMethod; import org.springframework.http.client.ClientHttpRequest; import org.springframework.http.client.ClientHttpRequestFactory; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java index 177ca76e715..cc03df0d725 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java +++ b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java @@ -23,10 +23,10 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.boot.web.server.servlet.jetty.JettyServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java index a5e06df769b..e7449c3148d 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java +++ b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java @@ -27,8 +27,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.web.servlet.support.ErrorPageFilterIntegrationTests.EmbeddedWebContextLoader; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index 3f910f01e02..e9dd91e750c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -56,6 +56,7 @@ dependencies { dockerTestImplementation("org.testcontainers:pulsar") dockerTestImplementation("org.testcontainers:testcontainers") + optional(project(":spring-boot-project:spring-boot-tomcat")) optional("co.elastic.clients:elasticsearch-java") optional("com.fasterxml.jackson.core:jackson-databind") optional("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor") diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java index b861b834985..2513eff3cc3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java @@ -27,8 +27,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.annotation.ImportCandidates; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.context.annotation.Conditional; 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/tomcat/TomcatReactiveWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerAutoConfiguration.java index c36dab6fcad..e5fd44b162b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerAutoConfiguration.java @@ -28,11 +28,11 @@ import org.springframework.boot.autoconfigure.web.server.reactive.ReactiveWebSer import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatServerProperties; import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.tomcat.TomcatConnectorCustomizer; +import org.springframework.boot.tomcat.TomcatContextCustomizer; +import org.springframework.boot.tomcat.TomcatProtocolHandlerCustomizer; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatConnectorCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatContextCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatProtocolHandlerCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.http.ReactiveHttpInputMessage; @@ -45,7 +45,7 @@ import org.springframework.http.ReactiveHttpInputMessage; * @since 4.0.0 */ @AutoConfiguration -@ConditionalOnClass({ ReactiveHttpInputMessage.class, Tomcat.class }) +@ConditionalOnClass({ ReactiveHttpInputMessage.class, Tomcat.class, TomcatReactiveWebServerFactory.class }) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE) @EnableConfigurationProperties(TomcatServerProperties.class) @Import({ TomcatWebServerConfiguration.class, ReactiveWebServerConfiguration.class }) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerFactoryCustomizer.java index 3a3de660234..6f1551d8835 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerFactoryCustomizer.java @@ -17,8 +17,8 @@ package org.springframework.boot.autoconfigure.web.server.reactive.tomcat; import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatServerProperties; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; /** * {@link WebServerFactoryCustomizer} to apply {@link TomcatServerProperties} to Tomcat diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerAutoConfiguration.java index 9a5d45b3037..af31c187862 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerAutoConfiguration.java @@ -35,11 +35,11 @@ import org.springframework.boot.autoconfigure.web.server.servlet.ServletWebServe import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatServerProperties; import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; +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.servlet.ServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatConnectorCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatContextCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatProtocolHandlerCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; @@ -51,7 +51,7 @@ import org.springframework.context.annotation.Import; * @since 4.0.0 */ @AutoConfiguration -@ConditionalOnClass({ ServletRequest.class, Tomcat.class, UpgradeProtocol.class }) +@ConditionalOnClass({ ServletRequest.class, Tomcat.class, UpgradeProtocol.class, TomcatServletWebServerFactory.class }) @ConditionalOnWebApplication(type = Type.SERVLET) @EnableConfigurationProperties(TomcatServerProperties.class) @Import({ ServletWebServerConfiguration.class, TomcatWebServerConfiguration.class }) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerFactoryCustomizer.java index e13b3cc683c..afc14743c44 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerFactoryCustomizer.java @@ -17,9 +17,9 @@ package org.springframework.boot.autoconfigure.web.server.servlet.tomcat; import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatServerProperties; +import org.springframework.boot.tomcat.ConfigurableTomcatWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.server.tomcat.ConfigurableTomcatWebServerFactory; import org.springframework.core.Ordered; import org.springframework.util.ObjectUtils; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatVirtualThreadsWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatVirtualThreadsWebServerFactoryCustomizer.java index ddeb9d114ff..e6857ff71aa 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatVirtualThreadsWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatVirtualThreadsWebServerFactoryCustomizer.java @@ -19,8 +19,8 @@ package org.springframework.boot.autoconfigure.web.server.tomcat; import org.apache.coyote.ProtocolHandler; import org.apache.tomcat.util.threads.VirtualThreadExecutor; +import org.springframework.boot.tomcat.ConfigurableTomcatWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.tomcat.ConfigurableTomcatWebServerFactory; import org.springframework.core.Ordered; /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatWebServerFactoryCustomizer.java index e410b4c472a..3672f56db12 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatWebServerFactoryCustomizer.java @@ -40,8 +40,8 @@ import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatServerProp import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatServerProperties.UseApr; import org.springframework.boot.cloud.CloudPlatform; import org.springframework.boot.context.properties.PropertyMapper; +import org.springframework.boot.tomcat.ConfigurableTomcatWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.tomcat.ConfigurableTomcatWebServerFactory; import org.springframework.core.Ordered; import org.springframework.core.env.Environment; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/WebSocketTomcatWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/WebSocketTomcatWebServerFactoryCustomizer.java index 1613d90a633..eb78b61809b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/WebSocketTomcatWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/tomcat/WebSocketTomcatWebServerFactoryCustomizer.java @@ -18,8 +18,8 @@ package org.springframework.boot.autoconfigure.web.server.tomcat; import org.apache.tomcat.websocket.server.WsSci; +import org.springframework.boot.tomcat.ConfigurableTomcatWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.tomcat.ConfigurableTomcatWebServerFactory; /** * {@link WebServerFactoryCustomizer} that configures Tomcat's WebSocket support. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfigurationServletContainerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfigurationServletContainerTests.java index 4753bce4e87..ef1586a67ac 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfigurationServletContainerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfigurationServletContainerTests.java @@ -37,7 +37,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; 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/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2ClientWebSecurityAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2ClientWebSecurityAutoConfigurationTests.java index dc653f7a7c7..1f5bf4523f1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2ClientWebSecurityAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2ClientWebSecurityAutoConfigurationTests.java @@ -27,7 +27,7 @@ import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguratio import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; 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/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java index 3b41cb50fca..d9129b1b871 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java @@ -39,7 +39,7 @@ import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/TomcatServerPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/TomcatServerPropertiesTests.java index 89622495073..896dd2f96f9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/TomcatServerPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/TomcatServerPropertiesTests.java @@ -37,7 +37,7 @@ 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.web.server.tomcat.TomcatWebServerFactory; +import org.springframework.boot.tomcat.TomcatWebServerFactory; import org.springframework.test.util.ReflectionTestUtils; 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/reactive/tomcat/TomcatReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerAutoConfigurationTests.java index 711e82b9217..2eb85648f25 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/tomcat/TomcatReactiveWebServerAutoConfigurationTests.java @@ -25,14 +25,14 @@ 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; +import org.springframework.boot.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatConnectorCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatContextCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatProtocolHandlerCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerServletContextListenerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerServletContextListenerTests.java index e0c3b8c57d9..002a1b66fd6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerServletContextListenerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerServletContextListenerTests.java @@ -26,10 +26,10 @@ import org.junit.jupiter.params.provider.MethodSource; import org.springframework.boot.testsupport.classpath.ForkedClassPath; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.boot.web.server.servlet.jetty.JettyServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory; import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerAutoConfigurationTests.java index e3260b8cff0..fe9bf9481a1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerAutoConfigurationTests.java @@ -22,11 +22,11 @@ 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.servlet.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatConnectorCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatContextCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatProtocolHandlerCustomizer; 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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerFactoryCustomizerTests.java index 7ef0a8ae574..0d3a00013e0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/servlet/tomcat/TomcatServletWebServerFactoryCustomizerTests.java @@ -24,8 +24,8 @@ import org.springframework.boot.autoconfigure.web.server.tomcat.TomcatServerProp 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.web.server.servlet.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.mock.env.MockEnvironment; import org.springframework.test.context.support.TestPropertySourceUtils; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatVirtualThreadsWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatVirtualThreadsWebServerFactoryCustomizerTests.java index 96167b3a891..0ab38432552 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatVirtualThreadsWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatVirtualThreadsWebServerFactoryCustomizerTests.java @@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledForJreRange; import org.junit.jupiter.api.condition.JRE; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; 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/tomcat/TomcatWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatWebServerFactoryCustomizerTests.java index f3f85a8b0f2..6c7188e1fe5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/server/tomcat/TomcatWebServerFactoryCustomizerTests.java @@ -39,9 +39,9 @@ import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; import org.springframework.boot.testsupport.classpath.ClassPathOverrides; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; +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.servlet.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; 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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java index 8efa4f91adb..0d690caffe6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java @@ -32,8 +32,8 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.testsupport.classpath.ForkedClassPath; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.jetty.JettyServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java index 35b2af6f043..5f05053c642 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java @@ -58,10 +58,10 @@ 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.classpath.resources.WithResource; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java index ca8d33b6d79..4a6e9d4c2ee 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java @@ -45,7 +45,7 @@ import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoC import org.springframework.boot.autoconfigure.websocket.servlet.WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index bfbde1a3568..768ddb478d7 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -2054,7 +2054,8 @@ bom { "spring-boot-starter-websocket", "spring-boot-test", "spring-boot-test-autoconfigure", - "spring-boot-testcontainers" + "spring-boot-testcontainers", + "spring-boot-tomcat" ] plugins = [ "spring-boot-maven-plugin" diff --git a/spring-boot-project/spring-boot-devtools/build.gradle b/spring-boot-project/spring-boot-devtools/build.gradle index e45ae6b0405..721b8fbb7d3 100644 --- a/spring-boot-project/spring-boot-devtools/build.gradle +++ b/spring-boot-project/spring-boot-devtools/build.gradle @@ -65,8 +65,9 @@ dependencies { optional("org.springframework.data:spring-data-redis") optional("org.springframework.session:spring-session-core") - testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation(project(":spring-boot-project:spring-boot-test")) + testImplementation(project(":spring-boot-project:spring-boot-tomcat")) + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation("ch.qos.logback:logback-classic") testImplementation("com.h2database:h2") testImplementation("com.zaxxer:HikariCP") diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java index 31f9b829440..bec1d56420f 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java @@ -44,7 +44,7 @@ import org.springframework.boot.devtools.restart.FailureHandler; import org.springframework.boot.devtools.restart.MockRestartInitializer; import org.springframework.boot.devtools.restart.MockRestarter; import org.springframework.boot.devtools.restart.Restarter; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/RemoteClientConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/RemoteClientConfigurationTests.java index 81dfbed1358..ccecae3f1d0 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/RemoteClientConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/RemoteClientConfigurationTests.java @@ -40,7 +40,7 @@ import org.springframework.boot.devtools.restart.RestartScopeInitializer; import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 240e766d332..08b411fa991 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -100,6 +100,7 @@ dependencies { implementation(project(path: ":spring-boot-project:spring-boot-test")) implementation(project(path: ":spring-boot-project:spring-boot-test-autoconfigure")) implementation(project(path: ":spring-boot-project:spring-boot-testcontainers")) + implementation(project(path: ":spring-boot-project:spring-boot-tomcat")) implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-cli")) implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-loader-tools")) implementation("ch.qos.logback:logback-classic") diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java index 370d4a499c0..290f4ae43e8 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java @@ -30,8 +30,8 @@ import org.apache.catalina.Host; import org.apache.catalina.core.StandardContext; import org.apache.catalina.startup.Tomcat; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletContextInitializer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/configure/MyTomcatWebServerCustomizer.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/configure/MyTomcatWebServerCustomizer.java index 99ba2274164..cdd744dc5b3 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/configure/MyTomcatWebServerCustomizer.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/configure/MyTomcatWebServerCustomizer.java @@ -16,8 +16,8 @@ package org.springframework.boot.docs.howto.webserver.configure; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.stereotype.Component; @Component diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.java index 7484178c4df..4a75b16c4b5 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.java @@ -18,8 +18,8 @@ package org.springframework.boot.docs.howto.webserver.enablemultipleconnectorsin import org.apache.catalina.connector.Connector; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.java index 1af3f0812e1..3e0bcbb4b71 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.java @@ -18,8 +18,8 @@ package org.springframework.boot.docs.web.servlet.embeddedcontainer.customizing. import java.time.Duration; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.stereotype.Component; @Component diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.kt index c600c3d0d56..57745666f90 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.kt @@ -27,7 +27,7 @@ import org.apache.catalina.Host import org.apache.catalina.core.StandardContext import org.apache.catalina.startup.Tomcat.FixContextListener import org.springframework.boot.web.server.servlet.ServletContextInitializer -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import java.io.IOException diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/webserver/configure/MyTomcatWebServerCustomizer.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/webserver/configure/MyTomcatWebServerCustomizer.kt index 636da486b46..04a571c1db1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/webserver/configure/MyTomcatWebServerCustomizer.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/webserver/configure/MyTomcatWebServerCustomizer.kt @@ -17,7 +17,7 @@ package org.springframework.boot.docs.howto.webserver.configure import org.springframework.boot.web.server.WebServerFactoryCustomizer -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory import org.springframework.stereotype.Component @Component diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.kt index c5d61171d14..92e7aa6fc70 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.kt @@ -18,7 +18,7 @@ package org.springframework.boot.docs.howto.webserver.enablemultipleconnectorsin import org.apache.catalina.connector.Connector import org.springframework.boot.web.server.WebServerFactoryCustomizer -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.kt index 95859e2dca5..755653949d3 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.kt @@ -17,7 +17,7 @@ package org.springframework.boot.docs.web.servlet.embeddedcontainer.customizing.programmatic import org.springframework.boot.web.server.WebServerFactoryCustomizer -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory import org.springframework.stereotype.Component import java.time.Duration diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/build.gradle index 4b6e1d332c9..7b74047bed2 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/build.gradle @@ -21,10 +21,8 @@ plugins { description = "Starter for using Tomcat as the embedded servlet container. Default servlet container starter used by spring-boot-starter-web" dependencies { + api(project(":spring-boot-project:spring-boot-tomcat")) api("jakarta.annotation:jakarta.annotation-api") - api("org.apache.tomcat.embed:tomcat-embed-core") { - exclude group: "org.apache.tomcat", module: "tomcat-annotations-api" - } api("org.apache.tomcat.embed:tomcat-embed-el") api("org.apache.tomcat.embed:tomcat-embed-websocket") { exclude group: "org.apache.tomcat", module: "tomcat-annotations-api" diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle index f1024d8cfa9..aff9b0b114a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -133,6 +133,8 @@ dependencies { exclude group: "org.opensaml", module: "opensaml-saml-impl" } testImplementation("org.thymeleaf:thymeleaf") + + testRuntimeOnly(project(":spring-boot-project:spring-boot-tomcat")) } configurations { diff --git a/spring-boot-project/spring-boot-test/build.gradle b/spring-boot-project/spring-boot-test/build.gradle index 7cb56fbedfd..89ff780bed4 100644 --- a/spring-boot-project/spring-boot-test/build.gradle +++ b/spring-boot-project/spring-boot-test/build.gradle @@ -53,6 +53,7 @@ dependencies { optional("org.springframework:spring-webflux") optional("org.springframework.graphql:spring-graphql-test") + testImplementation(project(":spring-boot-project:spring-boot-tomcat")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation("io.mockk:mockk") testImplementation("jakarta.json:jakarta.json-api") diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java index 0107d946d82..8797615312a 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java @@ -25,9 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java index a7db911bb32..55e22ff5594 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java @@ -23,8 +23,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerIntegrationTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerIntegrationTests.java index 3cfcd49e5fb..cebe404bf9c 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerIntegrationTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerIntegrationTests.java @@ -24,7 +24,7 @@ import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.buffer.DefaultDataBufferFactory; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerWithCustomBasePathTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerWithCustomBasePathTests.java index 241c3c08c1a..6d2372af653 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerWithCustomBasePathTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerWithCustomBasePathTests.java @@ -24,7 +24,7 @@ import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.buffer.DefaultDataBufferFactory; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerWithCustomContextPathTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerWithCustomContextPathTests.java index 99503f0c1c2..97c1d31fa22 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerWithCustomContextPathTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizerWithCustomContextPathTests.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; 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-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerIntegrationTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerIntegrationTests.java index 9c9a113fcf2..30d145e82e4 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerIntegrationTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerIntegrationTests.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; 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-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerWithFactoryBeanTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerWithFactoryBeanTests.java index 2391c0866a5..10c979e0782 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerWithFactoryBeanTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerWithFactoryBeanTests.java @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerWithOverrideIntegrationTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerWithOverrideIntegrationTests.java index 98efd19d75a..e9205aeeef9 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerWithOverrideIntegrationTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerWithOverrideIntegrationTests.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; 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-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerIntegrationTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerIntegrationTests.java index 3851ee91396..1f675ca801d 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerIntegrationTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerIntegrationTests.java @@ -22,7 +22,7 @@ import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; 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-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithCustomBasePathTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithCustomBasePathTests.java index 7da5f8bf39d..4bbb95f316e 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithCustomBasePathTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithCustomBasePathTests.java @@ -24,7 +24,7 @@ import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.buffer.DefaultDataBufferFactory; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithCustomContextPathTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithCustomContextPathTests.java index 7aa99c94ce1..645f9bee68c 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithCustomContextPathTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithCustomContextPathTests.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; 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-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithOverrideIntegrationTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithOverrideIntegrationTests.java index a8cf95c560d..dd9c202c244 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithOverrideIntegrationTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithOverrideIntegrationTests.java @@ -22,7 +22,7 @@ import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; 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-tomcat/build.gradle b/spring-boot-project/spring-boot-tomcat/build.gradle new file mode 100644 index 00000000000..d94109ad12f --- /dev/null +++ b/spring-boot-project/spring-boot-tomcat/build.gradle @@ -0,0 +1,67 @@ +/* + * Copyright 2012-present 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. + */ + + +plugins { + id "java-library" + id "org.springframework.boot.deployed" + id "org.springframework.boot.optional-dependencies" +} + +description = "Spring Boot Tomcat" + +def tomcatConfigProperties = layout.buildDirectory.dir("tomcat-config-properties") + +configurations { + tomcatDistribution +} + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api("org.apache.tomcat.embed:tomcat-embed-core") { + exclude group: "org.apache.tomcat", module: "tomcat-annotations-api" + } + + optional("org.apache.tomcat.embed:tomcat-embed-jasper") + optional("org.springframework:spring-webflux") + + runtimeOnly("jakarta.annotation:jakarta.annotation-api") + + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation("org.apache.httpcomponents.client5:httpclient5") + testRuntimeOnly("ch.qos.logback:logback-classic") + tomcatDistribution("org.apache.tomcat:tomcat:${tomcatVersion}@zip") +} + +tasks.register("extractTomcatConfigProperties", Sync) { + destinationDir = file(tomcatConfigProperties) + from { + zipTree(configurations.tomcatDistribution.incoming.files.singleFile).matching { + include '**/conf/catalina.properties' + }.singleFile + } +} + +sourceSets { + test { + output.dir(tomcatConfigProperties, builtBy: "extractTomcatConfigProperties") + } +} + +test { + jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED" +} diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/CompressionConnectorCustomizer.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/CompressionConnectorCustomizer.java similarity index 97% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/CompressionConnectorCustomizer.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/CompressionConnectorCustomizer.java index 486f8842475..dc1ddc376e2 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/CompressionConnectorCustomizer.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/CompressionConnectorCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import org.apache.catalina.connector.Connector; import org.apache.coyote.ProtocolHandler; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/ConfigurableTomcatWebServerFactory.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/ConfigurableTomcatWebServerFactory.java similarity index 92% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/ConfigurableTomcatWebServerFactory.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/ConfigurableTomcatWebServerFactory.java index 76296e5f848..fb9bb6bf700 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/ConfigurableTomcatWebServerFactory.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/ConfigurableTomcatWebServerFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.io.File; import java.nio.charset.Charset; @@ -24,9 +24,9 @@ import org.apache.catalina.Engine; import org.apache.catalina.Valve; import org.apache.catalina.connector.Connector; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.ConfigurableWebServerFactory; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; /** * {@link ConfigurableWebServerFactory} for Tomcat-specific features. diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/ConnectorStartFailedException.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/ConnectorStartFailedException.java similarity index 96% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/ConnectorStartFailedException.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/ConnectorStartFailedException.java index 9c02c0f8ba3..83eae80b1c9 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/ConnectorStartFailedException.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/ConnectorStartFailedException.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import org.apache.catalina.connector.Connector; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/ConnectorStartFailureAnalyzer.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/ConnectorStartFailureAnalyzer.java similarity index 96% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/ConnectorStartFailureAnalyzer.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/ConnectorStartFailureAnalyzer.java index 44e56dcefdb..d270a3dcd69 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/ConnectorStartFailureAnalyzer.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/ConnectorStartFailureAnalyzer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import org.springframework.boot.diagnostics.AbstractFailureAnalyzer; import org.springframework.boot.diagnostics.FailureAnalysis; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/DisableReferenceClearingContextCustomizer.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/DisableReferenceClearingContextCustomizer.java similarity index 96% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/DisableReferenceClearingContextCustomizer.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/DisableReferenceClearingContextCustomizer.java index 2c261409244..5f77f3e7897 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/DisableReferenceClearingContextCustomizer.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/DisableReferenceClearingContextCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import org.apache.catalina.Context; import org.apache.catalina.core.StandardContext; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/GracefulShutdown.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/GracefulShutdown.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/GracefulShutdown.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/GracefulShutdown.java index f4bcda49c42..9d8d7d217e8 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/GracefulShutdown.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/GracefulShutdown.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.util.ArrayList; import java.util.Collections; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/LazySessionIdGenerator.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/LazySessionIdGenerator.java similarity index 95% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/LazySessionIdGenerator.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/LazySessionIdGenerator.java index be2bda82e55..2848f77bd61 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/LazySessionIdGenerator.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/LazySessionIdGenerator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleState; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/SslConnectorCustomizer.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/SslConnectorCustomizer.java similarity index 99% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/SslConnectorCustomizer.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/SslConnectorCustomizer.java index 30b2a1f659b..1d3ba09b0ed 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/SslConnectorCustomizer.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/SslConnectorCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.util.Map; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatConnectorCustomizer.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatConnectorCustomizer.java similarity index 95% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatConnectorCustomizer.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatConnectorCustomizer.java index 49ad5b47c97..435a69d2266 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatConnectorCustomizer.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatConnectorCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import org.apache.catalina.connector.Connector; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatContextCustomizer.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatContextCustomizer.java similarity index 87% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatContextCustomizer.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatContextCustomizer.java index c71ffaa4fb4..25eac4b52bc 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatContextCustomizer.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatContextCustomizer.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import org.apache.catalina.Context; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; /** * Callback interface that can be used to customize a Tomcat {@link Context}. diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatEmbeddedContext.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatEmbeddedContext.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatEmbeddedContext.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatEmbeddedContext.java index fffa6ccbc1f..be5e75b6322 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatEmbeddedContext.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatEmbeddedContext.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.util.ArrayList; import java.util.Arrays; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatEmbeddedWebappClassLoader.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoader.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatEmbeddedWebappClassLoader.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoader.java index 9af61f3a9b2..9a6a9b23a61 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatEmbeddedWebappClassLoader.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoader.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.io.IOException; import java.net.URL; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatProtocolHandlerCustomizer.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatProtocolHandlerCustomizer.java similarity index 95% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatProtocolHandlerCustomizer.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatProtocolHandlerCustomizer.java index 5968c23c6a6..acd0cdeb2e7 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatProtocolHandlerCustomizer.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatProtocolHandlerCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import org.apache.catalina.connector.Connector; import org.apache.coyote.ProtocolHandler; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatStarter.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatStarter.java similarity index 97% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatStarter.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatStarter.java index 39307faf7a8..13f10936a93 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatStarter.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatStarter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.util.Set; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatWebServer.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatWebServer.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatWebServer.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatWebServer.java index cb9679ed731..a927840e2f9 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatWebServer.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatWebServer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.util.Arrays; import java.util.HashMap; @@ -39,14 +39,14 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.naming.ContextBindings; +import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.GracefulShutdownCallback; import org.springframework.boot.web.server.GracefulShutdownResult; import org.springframework.boot.web.server.PortInUseException; import org.springframework.boot.web.server.Shutdown; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerException; -import org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatWebServerFactory.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatWebServerFactory.java similarity index 99% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatWebServerFactory.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatWebServerFactory.java index 8e47f282762..a66dcc9fba1 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/TomcatWebServerFactory.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatWebServerFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.io.File; import java.nio.charset.Charset; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/package-info.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/package-info.java similarity index 75% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/package-info.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/package-info.java index f66e6bd51d3..87e9664dd00 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/tomcat/package-info.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/package-info.java @@ -17,7 +17,7 @@ /** * Reactive and servlet web server implementations backed by Tomcat. * - * @see org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory - * @see org.springframework.boot.web.server.reactive.tomcat.TomcatReactiveWebServerFactory + * @see org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory + * @see org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/tomcat/TomcatReactiveWebServerFactory.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/reactive/TomcatReactiveWebServerFactory.java similarity index 89% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/tomcat/TomcatReactiveWebServerFactory.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/reactive/TomcatReactiveWebServerFactory.java index 25ae66ed195..0d52aa95c49 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/tomcat/TomcatReactiveWebServerFactory.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/reactive/TomcatReactiveWebServerFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.tomcat; +package org.springframework.boot.tomcat.reactive; import java.io.File; @@ -26,15 +26,15 @@ import org.apache.catalina.startup.Tomcat; import org.apache.catalina.webresources.StandardRoot; import org.apache.tomcat.util.scan.StandardJarScanFilter; +import org.springframework.boot.tomcat.ConfigurableTomcatWebServerFactory; +import org.springframework.boot.tomcat.DisableReferenceClearingContextCustomizer; +import org.springframework.boot.tomcat.TomcatEmbeddedContext; +import org.springframework.boot.tomcat.TomcatEmbeddedWebappClassLoader; +import org.springframework.boot.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.TomcatWebServerFactory; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.reactive.ConfigurableReactiveWebServerFactory; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; -import org.springframework.boot.web.server.tomcat.ConfigurableTomcatWebServerFactory; -import org.springframework.boot.web.server.tomcat.DisableReferenceClearingContextCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatEmbeddedContext; -import org.springframework.boot.web.server.tomcat.TomcatEmbeddedWebappClassLoader; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; -import org.springframework.boot.web.server.tomcat.TomcatWebServerFactory; import org.springframework.http.server.reactive.HttpHandler; import org.springframework.http.server.reactive.TomcatHttpHandlerAdapter; import org.springframework.util.ClassUtils; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/tomcat/package-info.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/reactive/package-info.java similarity index 91% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/tomcat/package-info.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/reactive/package-info.java index b3371c0f15a..2abc50624f6 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/tomcat/package-info.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/reactive/package-info.java @@ -17,4 +17,4 @@ /** * Reactive web server implementation backed by Tomcat. */ -package org.springframework.boot.web.server.reactive.tomcat; +package org.springframework.boot.tomcat.reactive; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/NestedJarResourceSet.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/NestedJarResourceSet.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/NestedJarResourceSet.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/NestedJarResourceSet.java index 69d25cd2406..cb937d48785 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/NestedJarResourceSet.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/NestedJarResourceSet.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.servlet.tomcat; +package org.springframework.boot.tomcat.servlet; import java.io.IOException; import java.net.JarURLConnection; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/TldPatterns.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TldPatterns.java similarity index 99% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/TldPatterns.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TldPatterns.java index 005d755e0ea..b992bbdc639 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/TldPatterns.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TldPatterns.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.servlet.tomcat; +package org.springframework.boot.tomcat.servlet; import java.util.Collections; import java.util.LinkedHashSet; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/TomcatServletWebServerFactory.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactory.java similarity index 97% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/TomcatServletWebServerFactory.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactory.java index 7279e5f1dd6..5e26de6888f 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/TomcatServletWebServerFactory.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.servlet.tomcat; +package org.springframework.boot.tomcat.servlet; import java.io.File; import java.io.InputStream; @@ -64,6 +64,14 @@ import org.apache.commons.logging.LogFactory; import org.apache.tomcat.util.http.Rfc6265CookieProcessor; import org.apache.tomcat.util.scan.StandardJarScanFilter; +import org.springframework.boot.tomcat.ConfigurableTomcatWebServerFactory; +import org.springframework.boot.tomcat.DisableReferenceClearingContextCustomizer; +import org.springframework.boot.tomcat.TomcatContextCustomizer; +import org.springframework.boot.tomcat.TomcatEmbeddedContext; +import org.springframework.boot.tomcat.TomcatEmbeddedWebappClassLoader; +import org.springframework.boot.tomcat.TomcatStarter; +import org.springframework.boot.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.TomcatWebServerFactory; import org.springframework.boot.web.server.Cookie.SameSite; import org.springframework.boot.web.server.ErrorPage; import org.springframework.boot.web.server.MimeMappings; @@ -75,14 +83,6 @@ import org.springframework.boot.web.server.servlet.DocumentRoot; import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.boot.web.server.servlet.ServletContextInitializers; import org.springframework.boot.web.server.servlet.ServletWebServerSettings; -import org.springframework.boot.web.server.tomcat.ConfigurableTomcatWebServerFactory; -import org.springframework.boot.web.server.tomcat.DisableReferenceClearingContextCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatContextCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatEmbeddedContext; -import org.springframework.boot.web.server.tomcat.TomcatEmbeddedWebappClassLoader; -import org.springframework.boot.web.server.tomcat.TomcatStarter; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; -import org.springframework.boot.web.server.tomcat.TomcatWebServerFactory; import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.ResourceLoader; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/package-info.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/package-info.java similarity index 91% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/package-info.java rename to spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/package-info.java index f7de6a675ff..89e4606b1de 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/servlet/tomcat/package-info.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/package-info.java @@ -17,4 +17,4 @@ /** * Servlet web server implementation backed by Tomcat. */ -package org.springframework.boot.web.server.servlet.tomcat; +package org.springframework.boot.tomcat.servlet; diff --git a/spring-boot-project/spring-boot-tomcat/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-tomcat/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000000..cb023f0ee4c --- /dev/null +++ b/spring-boot-project/spring-boot-tomcat/src/main/resources/META-INF/spring.factories @@ -0,0 +1,3 @@ +# Failure Analyzers +org.springframework.boot.diagnostics.FailureAnalyzer=\ +org.springframework.boot.tomcat.ConnectorStartFailureAnalyzer diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/CompressionConnectorCustomizerTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/CompressionConnectorCustomizerTests.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/CompressionConnectorCustomizerTests.java rename to spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/CompressionConnectorCustomizerTests.java index c1656dbf0a0..c0a4f6ab57d 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/CompressionConnectorCustomizerTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/CompressionConnectorCustomizerTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import org.apache.catalina.connector.Connector; import org.apache.coyote.http11.AbstractHttp11Protocol; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/SslConnectorCustomizerTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/SslConnectorCustomizerTests.java similarity index 99% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/SslConnectorCustomizerTests.java rename to spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/SslConnectorCustomizerTests.java index af1de89ffb5..69b49538ce0 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/SslConnectorCustomizerTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/SslConnectorCustomizerTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.util.Collections; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/TomcatAccess.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatAccess.java similarity index 95% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/TomcatAccess.java rename to spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatAccess.java index 5933eb685b6..49cba489091 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/TomcatAccess.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatAccess.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.util.Map; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/TomcatEmbeddedWebappClassLoaderTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoaderTests.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/TomcatEmbeddedWebappClassLoaderTests.java rename to spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoaderTests.java index b57c74c14e9..36285bdf3a9 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/tomcat/TomcatEmbeddedWebappClassLoaderTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoaderTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.tomcat; +package org.springframework.boot.tomcat; import java.io.File; import java.io.FileOutputStream; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/reactive/tomcat/TomcatReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/reactive/TomcatReactiveWebServerFactoryTests.java similarity index 96% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/reactive/tomcat/TomcatReactiveWebServerFactoryTests.java rename to spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/reactive/TomcatReactiveWebServerFactoryTests.java index 4a69a300b14..c8a2f2d577d 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/reactive/tomcat/TomcatReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/reactive/TomcatReactiveWebServerFactoryTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.tomcat; +package org.springframework.boot.tomcat.reactive; import java.net.ConnectException; import java.time.Duration; @@ -39,16 +39,16 @@ import org.junit.jupiter.api.Test; import org.mockito.InOrder; import org.springframework.boot.testsupport.junit.EnabledOnLocale; +import org.springframework.boot.tomcat.TomcatAccess; +import org.springframework.boot.tomcat.TomcatConnectorCustomizer; +import org.springframework.boot.tomcat.TomcatContextCustomizer; +import org.springframework.boot.tomcat.TomcatProtocolHandlerCustomizer; +import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.web.server.PortInUseException; import org.springframework.boot.web.server.Shutdown; import org.springframework.boot.web.server.WebServerException; import org.springframework.boot.web.server.reactive.AbstractReactiveWebServerFactoryTests; import org.springframework.boot.web.server.reactive.ConfigurableReactiveWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatAccess; -import org.springframework.boot.web.server.tomcat.TomcatConnectorCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatContextCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatProtocolHandlerCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; import org.springframework.http.server.reactive.HttpHandler; import org.springframework.web.reactive.function.client.WebClient; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/servlet/tomcat/TldPatternsTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/servlet/TldPatternsTests.java similarity index 97% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/servlet/tomcat/TldPatternsTests.java rename to spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/servlet/TldPatternsTests.java index 1e87cfbe57b..077746157d1 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/servlet/tomcat/TldPatternsTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/servlet/TldPatternsTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.servlet.tomcat; +package org.springframework.boot.tomcat.servlet; import java.io.IOException; import java.io.InputStream; diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/servlet/tomcat/TomcatServletWebServerFactoryTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactoryTests.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/servlet/tomcat/TomcatServletWebServerFactoryTests.java rename to spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactoryTests.java index be1a7111907..8236351a9ef 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/servlet/tomcat/TomcatServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactoryTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.servlet.tomcat; +package org.springframework.boot.tomcat.servlet; import java.io.File; import java.io.IOException; @@ -83,19 +83,19 @@ import org.springframework.boot.ssl.DefaultSslBundleRegistry; import org.springframework.boot.testsupport.classpath.resources.WithPackageResources; import org.springframework.boot.testsupport.junit.EnabledOnLocale; import org.springframework.boot.testsupport.system.CapturedOutput; +import org.springframework.boot.tomcat.ConnectorStartFailedException; +import org.springframework.boot.tomcat.TomcatAccess; +import org.springframework.boot.tomcat.TomcatConnectorCustomizer; +import org.springframework.boot.tomcat.TomcatContextCustomizer; +import org.springframework.boot.tomcat.TomcatEmbeddedContext; +import org.springframework.boot.tomcat.TomcatProtocolHandlerCustomizer; +import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.web.server.PortInUseException; import org.springframework.boot.web.server.Shutdown; import org.springframework.boot.web.server.Ssl; import org.springframework.boot.web.server.WebServerException; import org.springframework.boot.web.server.servlet.AbstractServletWebServerFactoryTests; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; -import org.springframework.boot.web.server.tomcat.ConnectorStartFailedException; -import org.springframework.boot.web.server.tomcat.TomcatAccess; -import org.springframework.boot.web.server.tomcat.TomcatConnectorCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatContextCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatEmbeddedContext; -import org.springframework.boot.web.server.tomcat.TomcatProtocolHandlerCustomizer; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.support.PropertiesLoaderUtils; diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/1.crt b/spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/1.crt similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/1.crt rename to spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/1.crt diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/1.key b/spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/1.key similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/1.key rename to spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/1.key diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/2.crt b/spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/2.crt similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/2.crt rename to spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/2.crt diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/2.key b/spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/2.key similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/2.key rename to spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/2.key diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/test.jks b/spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/test.jks similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/servlet/tomcat/test.jks rename to spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/servlet/test.jks diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/tomcat/test.jks b/spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/test.jks similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/tomcat/test.jks rename to spring-boot-project/spring-boot-tomcat/src/test/resources/org/springframework/boot/tomcat/test.jks diff --git a/spring-boot-system-tests/spring-boot-deployment-tests/build.gradle b/spring-boot-system-tests/spring-boot-deployment-tests/build.gradle index 0e9867f31bc..93fb7bae64f 100644 --- a/spring-boot-system-tests/spring-boot-deployment-tests/build.gradle +++ b/spring-boot-system-tests/spring-boot-deployment-tests/build.gradle @@ -32,8 +32,11 @@ configurations.all { } dependencies { + compileOnly("jakarta.servlet:jakarta.servlet-api") + implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) { exclude group: "org.hibernate.validator" + exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat" } implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator")) @@ -44,8 +47,6 @@ dependencies { systemTestImplementation("org.testcontainers:junit-jupiter") systemTestImplementation("org.testcontainers:testcontainers") systemTestImplementation("org.springframework:spring-web") - - providedRuntime(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat")) } systemTest { diff --git a/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/AbstractDeploymentTests.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/AbstractDeploymentTests.java index 407dc2d35fb..7530c5de082 100644 --- a/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/AbstractDeploymentTests.java +++ b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/AbstractDeploymentTests.java @@ -104,6 +104,7 @@ abstract class AbstractDeploymentTests { try { Awaitility.await().atMost(Duration.ofMinutes(10)).until(() -> { try { + System.out.println(this.container.getLogs()); consumer.accept(rest); return true; } diff --git a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java index 9a08b77b469..aeb02374d04 100644 --- a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java +++ b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java @@ -386,6 +386,7 @@ class PaketoBuilderTests { return buildImage(imageName, arguments); } catch (Exception ex) { + ex.printStackTrace(); if (Duration.ofNanos(System.nanoTime() - start).toMinutes() > 6) { throw ex; } diff --git a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/resources/org/springframework/boot/image/paketo/PaketoBuilderTests-plainWarApp.gradle b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/resources/org/springframework/boot/image/paketo/PaketoBuilderTests-plainWarApp.gradle index c21274faafd..b5d8828c99e 100644 --- a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/resources/org/springframework/boot/image/paketo/PaketoBuilderTests-plainWarApp.gradle +++ b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/resources/org/springframework/boot/image/paketo/PaketoBuilderTests-plainWarApp.gradle @@ -38,7 +38,6 @@ repositories { dependencies { implementation("org.springframework.boot:spring-boot-starter-web:{bootVersion}") - providedRuntime("org.springframework.boot:spring-boot-starter-tomcat:{bootVersion}") } war { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/main/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/main/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplication.java index fda3f90e9a8..cd07b750e9f 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/main/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/main/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplication.java @@ -20,8 +20,8 @@ import org.apache.catalina.connector.Connector; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.context.annotation.Bean; /** diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java index dd796691869..de68faab7ea 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java @@ -27,9 +27,9 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; +import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java index 75301cd8a45..6ae64a0b661 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java @@ -33,7 +33,7 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.http.HttpEntity; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat11/src/test/java/smoketest/tomcat/SampleTomcat11ApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat11/src/test/java/smoketest/tomcat/SampleTomcat11ApplicationTests.java index 6e0e13a3ba7..bdc00632062 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat11/src/test/java/smoketest/tomcat/SampleTomcat11ApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat11/src/test/java/smoketest/tomcat/SampleTomcat11ApplicationTests.java @@ -33,7 +33,7 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.http.HttpEntity; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/echo/CustomContainerWebSocketsApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/echo/CustomContainerWebSocketsApplicationTests.java index f36b5076095..4ef36466a17 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/echo/CustomContainerWebSocketsApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/echo/CustomContainerWebSocketsApplicationTests.java @@ -36,8 +36,8 @@ import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.server.LocalServerPort; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.server.servlet.tomcat.TomcatServletWebServerFactory; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;