diff --git a/settings.gradle b/settings.gradle index d9f7f24720b..a8c5be8ae8b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -50,6 +50,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 8219b4c4496..5d4613277ef 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -17,6 +17,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 b5818258b87..f11c67e3f01 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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 53cbc37cc10..8ba1b101663 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 d3cdf6a0084..1714c60c5f7 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 0ec64115d59..6ca50b8e6e0 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 5e25ad9be1d..eddc0f1c3e4 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 fa1de4e291e..153b3c95a50 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 b9b7e393331..d22e080f56e 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 ad8db16605e..f33c42fa544 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 03593945d42..347724fabdf 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 ac9d5658b56..8d6fcff5adb 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 b65ec106842..c800573a75e 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 110b637030b..2dd4fd20506 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 7c8edf87bf1..fad71df8edd 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -23,6 +23,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 fd9a313db3e..a09c21ff4e3 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 aa0389dfd43..2029d414acf 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 27a7e947cae..027771b53fd 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 7a3fe003ffe..23e6b807b9d 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 840f7a9096c..262022f4baf 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 ea8dc2d7aee..705922887dc 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 829a2cd3b36..331adaecd30 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 9a7d09176a9..d77e1dc3082 100644 --- a/spring-boot-project/spring-boot-all/build.gradle +++ b/spring-boot-project/spring-boot-all/build.gradle @@ -8,17 +8,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") @@ -49,7 +42,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") @@ -101,6 +93,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") @@ -134,17 +127,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) { @@ -175,9 +157,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 314cb324658..253b17363a2 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 2fbed94d29e..3f4ed1d7845 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 41d0571e664..8ea57cc0cc4 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 82dce656fa2..e29d8c86ba5 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 671e9ef964c..f164435129a 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 3651808bef9..8e1f2851e49 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -40,6 +40,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 c7ad89e5277..0a3af3917c1 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 7a4dfbfa51e..7754752bb13 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 d60397873c7..258d7174c3e 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 5fe2529cef5..3c5f0b842cc 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 12efedbdd0f..0d057da0871 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 abef8ea53a6..f5d35ded8ea 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 2e621309dbd..1b9b03fc2eb 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 46680b91cc1..651d30c8d2f 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 c5ec988b323..ee1e9251551 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 f7008e53919..ad3508576c6 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 c2d8006043a..b817eed0fb3 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 d4fa82b9cf3..4532f186c4f 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 13b961d639a..19a7aed76ab 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 0977016a302..7f5b853249b 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 150da43e946..c498debdcdf 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 175d0ec31fb..6e89e75324d 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 0a4962b1047..0826bc99454 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 735e40a76fb..a2ce65cc84e 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 @@ -37,9 +37,9 @@ import org.springframework.boot.autoconfigure.web.ServerProperties.ForwardHeader import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; +import org.springframework.boot.tomcat.TomcatWebServer; +import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.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 7ed08849925..d94c27737cd 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 70a74657086..be793a37f3c 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 b1c607e1c3e..98466b0e5a6 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 10ea7004d4f..d9d9e3f1b04 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -2032,7 +2032,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 96b3ba9d216..2504b305c9e 100644 --- a/spring-boot-project/spring-boot-devtools/build.gradle +++ b/spring-boot-project/spring-boot-devtools/build.gradle @@ -49,8 +49,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 d127533bea8..47083f17979 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 ba9c277069a..2a4f4965311 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 4184025abe6..4c6f96947d2 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -84,6 +84,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 ca332c1ef2e..f36cd1f3722 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 823e7992165..883bd6d9126 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 40eb69c3fb4..3a20c9f3ebd 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 3cebffa9a79..e4a71f7d422 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 abce4077078..46b1d3173ba 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 18b44bbf4e0..a10e299b44c 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 961987ccefb..b069f11a2a4 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 f8a0830c630..5a7ed203b2d 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 f859ef7daee..6c90c9aaa9c 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 @@ -5,10 +5,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 42ba42629a8..f2c5ebcde2e 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -107,6 +107,8 @@ dependencies { testImplementation("org.springframework.hateoas:spring-hateoas") testImplementation("org.springframework.plugin:spring-plugin-core") 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 484c624e912..9e15cd72926 100644 --- a/spring-boot-project/spring-boot-test/build.gradle +++ b/spring-boot-project/spring-boot-test/build.gradle @@ -37,6 +37,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 52da84380f0..6d475345305 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 9a30cdb8d8b..95cf022233c 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 8fc226721c5..d01b6ab7013 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 cff9e6492ca..197b1a87198 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 47df5fe13ac..29d6d989eba 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 53d1877223e..bfd00861a27 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 e1fff670659..1331f96ba46 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 58300e8f23c..3e532e154b2 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 aa949d75fa8..29f0831c42f 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 b102f5fe93c..03eb3b4c984 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 7d7bb48feb2..a65f7970bea 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 2d8ecb1a0f0..48f6b6a0f04 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..929f72e059b --- /dev/null +++ b/spring-boot-project/spring-boot-tomcat/build.gradle @@ -0,0 +1,52 @@ +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 4c28bd9737d..629adfc4ce2 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 c64a5ddcf62..bd48e764663 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 729f4567ad1..c548fe3425d 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 cbe6db190db..a2b4df85dd9 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 c0853071ce6..b94ca70ac7c 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 1df1ff2d2ef..4f72c6d59cf 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 9869a506cd3..1b32167c7cd 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 590ab150372..6c6bf0bf45b 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 b5d6a62a134..19057e88246 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 b953df2006c..832acf1be0c 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 62c13dd2de1..1de36311750 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 75226c6d09b..2d48cfa753a 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 870202f205a..cbc7825eb39 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 6bdea21f431..4740710f7ea 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 7f84cc870a9..bae14313e87 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 cbef76d4484..d0bd56f0e37 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 a8c97e23d52..88ec6041657 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 2fde4918e33..7a14ed41a7a 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 dce179a946c..44fb617be12 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 4027b75867c..d3040796126 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 494f2e1f559..4c9f3d410f2 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 4d35239165e..1c14d40145a 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 d611e0a7b48..0a70dd5c579 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 200c554f61d..86fe922e8d1 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 30732875a3d..0b0e2b3a53c 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 8dba14ea7ba..f09054d9bf5 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 8186e750d4e..78c651c6c4b 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 bee3d91ad70..f8a4c9cd181 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; @@ -38,16 +38,16 @@ import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; import org.mockito.InOrder; +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 0720b5f2a26..89260030350 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 9fa52ddcfa2..369570e45ef 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; @@ -82,19 +82,19 @@ import org.mockito.InOrder; import org.springframework.boot.ssl.DefaultSslBundleRegistry; import org.springframework.boot.testsupport.classpath.resources.WithPackageResources; 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 b16972d5bfc..095cf42351a 100644 --- a/spring-boot-system-tests/spring-boot-deployment-tests/build.gradle +++ b/spring-boot-system-tests/spring-boot-deployment-tests/build.gradle @@ -16,8 +16,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")) @@ -28,8 +31,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 1bcb4e948c4..303efab8c45 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 b611278089a..f086baa24f8 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 2c9f76af9ce..eb1ca6cdbb6 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 @@ -22,7 +22,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 38cf5eaa9d9..e5107044bc4 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 19987a009c2..d55fd9e66a1 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 92534b0e37c..4cd55680d6c 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 8dbbbebb421..eda928f578e 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 6d41c6d6b24..5b1d517ddd1 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;