From fe7b13ec46f9960bebfddad984816e353f9c9349 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 30 Nov 2021 20:32:16 +0000 Subject: [PATCH] Upgrade to Spring Framework 6 and Jakarta EE 9 Closes gh-28619 Closes gh-28620 Closes gh-28621 Closes gh-28622 Closes gh-28623 Closes gh-28624 Closes gh-28625 Closes gh-28626 Closes gh-28627 Closes gh-28628 Closes gh-28629 Closes gh-28630 Closes gh-28631 Closes gh-28632 Closes gh-28633 Closes gh-28634 Closes gh-28635 Closes gh-28636 Closes gh-28638 Closes gh-28639 Closes gh-28640 Closes gh-28644 Closes gh-28645 Closes gh-28650 Closes gh-28711 Closes gh-28866 Closes gh-28867 Closes gh-28868 Closes gh-28872 See gh-28641 See gh-28642 See gh-28643 See gh-28646 See gh-28647 See gh-28648 See gh-28649 See gh-28721 See gh-28869 See gh-28871 --- gradle.properties | 2 +- .../build.gradle | 10 +- .../CloudFoundrySecurityInterceptor.java | 4 +- ...undryWebEndpointServletHandlerMapping.java | 4 +- ...iveHealthContributorAutoConfiguration.java | 4 +- ...JmsHealthContributorAutoConfiguration.java | 2 +- ...metheusMetricsExportAutoConfiguration.java | 32 ++- .../WebMvcMetricsAutoConfiguration.java | 4 +- .../security/servlet/EndpointRequest.java | 4 +- .../web/servlet/CompositeHandlerAdapter.java | 4 +- .../CompositeHandlerExceptionResolver.java | 6 +- .../web/servlet/CompositeHandlerMapping.java | 2 +- ...etManagementChildContextConfiguration.java | 2 +- ...letManagementContextAutoConfiguration.java | 4 +- .../ConditionsReportEndpointTests.java | 4 +- ...ebMvcEndpointExposureIntegrationTests.java | 8 +- .../WebMvcEndpointIntegrationTests.java | 2 +- ...althContributorAutoConfigurationTests.java | 2 +- .../autoconfigure/metrics/data/city/City.java | 8 +- ...usMetricsExportAutoConfigurationTests.java | 16 +- .../metrics/test/MetricsIntegrationTests.java | 4 +- .../WebMvcMetricsAutoConfigurationTests.java | 10 +- ...stractEndpointRequestIntegrationTests.java | 8 +- .../servlet/EndpointRequestTests.java | 4 +- ...mentWebSecurityAutoConfigurationTests.java | 2 +- ...ompositeHandlerExceptionResolverTests.java | 6 +- .../servlet/ManagementErrorEndpointTests.java | 2 +- .../servlet/MockServletWebServerFactory.java | 2 +- ...dContextConfigurationIntegrationTests.java | 4 +- .../endpoint/web/documentation/sample.log | 4 +- .../spring-boot-actuator/build.gradle | 12 +- .../ElasticsearchReactiveHealthIndicator.java | 4 +- .../actuate/endpoint/web/EndpointServlet.java | 6 +- .../web/ServletEndpointRegistrar.java | 8 +- .../AbstractWebMvcEndpointHandlerMapping.java | 6 +- .../SkipPathExtensionContentNegotiation.java | 6 +- .../servlet/WebMvcEndpointHandlerMapping.java | 4 +- .../boot/actuate/jms/JmsHealthIndicator.java | 8 +- .../web/reactive/server/WebFluxTags.java | 2 +- .../servlet/DefaultWebMvcTagsProvider.java | 6 +- .../LongTaskTimingHandlerInterceptor.java | 4 +- .../web/servlet/WebMvcMetricsFilter.java | 8 +- .../metrics/web/servlet/WebMvcTags.java | 6 +- .../web/servlet/WebMvcTagsContributor.java | 6 +- .../web/servlet/WebMvcTagsProvider.java | 6 +- .../DispatcherServletHandlerMappings.java | 4 +- ...herServletsMappingDescriptionProvider.java | 4 +- .../FilterRegistrationMappingDescription.java | 4 +- .../FiltersMappingDescriptionProvider.java | 6 +- .../RegistrationMappingDescription.java | 4 +- ...ServletRegistrationMappingDescription.java | 4 +- .../ServletsMappingDescriptionProvider.java | 6 +- .../ServerWebExchangeTraceableRequest.java | 4 +- .../web/trace/servlet/HttpTraceFilter.java | 16 +- .../servlet/TraceableHttpServletRequest.java | 4 +- .../servlet/TraceableHttpServletResponse.java | 4 +- ...ticsearchReactiveHealthIndicatorTests.java | 6 +- .../endpoint/web/EndpointServletTests.java | 10 +- .../web/ServletEndpointRegistrarTests.java | 16 +- .../ServletEndpointDiscovererTests.java | 10 +- .../DefaultWebMvcTagsProviderTests.java | 4 +- .../MvcWebEndpointIntegrationTests.java | 10 +- .../actuate/jms/JmsHealthIndicatorTests.java | 10 +- .../mail/MailHealthIndicatorTests.java | 18 +- .../web/reactive/server/WebFluxTagsTests.java | 3 +- .../web/servlet/FaultyWebMvcTagsProvider.java | 4 +- .../web/servlet/WebMvcMetricsFilterTests.java | 8 +- .../http/servlet/HttpTraceFilterTests.java | 8 +- .../web/mappings/MappingsEndpointTests.java | 8 +- ...erverWebExchangeTraceableRequestTests.java | 8 +- .../spring-boot-autoconfigure/build.gradle | 43 ++- .../BackgroundPreinitializer.java | 6 +- .../batch/BatchConfigurerConfiguration.java | 5 +- .../batch/JpaBatchConfigurer.java | 5 +- .../condition/OnWarDeploymentCondition.java | 4 +- .../ElasticsearchDataAutoConfiguration.java | 2 +- .../ElasticsearchDataConfiguration.java | 6 +- ...icsearchRepositoriesAutoConfiguration.java | 2 +- ...sticsearchRestClientAutoConfiguration.java | 2 +- ...yManagerFactoryDependsOnPostProcessor.java | 2 +- .../FreeMarkerServletWebConfiguration.java | 6 +- .../GroovyTemplateAutoConfiguration.java | 4 +- ...zelcastJpaDependencyAutoConfiguration.java | 4 +- ...onbHttpMessageConvertersConfiguration.java | 4 +- .../jdbc/XADataSourceAutoConfiguration.java | 5 +- ...JmsListenerContainerFactoryConfigurer.java | 4 +- .../jms/JmsAnnotationDrivenConfiguration.java | 4 +- .../jms/JmsAutoConfiguration.java | 6 +- .../boot/autoconfigure/jms/JmsProperties.java | 10 +- ...ndiConnectionFactoryAutoConfiguration.java | 5 +- .../jmx/JmxAutoConfiguration.java | 7 +- .../jsonb/JsonbAutoConfiguration.java | 10 +- .../EmbeddedLdapAutoConfiguration.java | 4 +- .../mail/MailSenderAutoConfiguration.java | 6 +- .../mail/MailSenderJndiConfiguration.java | 5 +- .../MailSenderValidatorAutoConfiguration.java | 4 +- ...yManagerFactoryDependsOnPostProcessor.java | 4 +- .../jpa/HibernateJpaAutoConfiguration.java | 2 +- .../orm/jpa/HibernateProperties.java | 2 +- .../orm/jpa/JpaBaseConfiguration.java | 3 +- .../ErrorPageSecurityFilterConfiguration.java | 2 +- .../SecurityFilterAutoConfiguration.java | 4 +- .../servlet/StaticResourceRequest.java | 4 +- .../SessionRepositoryFilterConfiguration.java | 4 +- .../transaction/jta/JndiJtaConfiguration.java | 5 +- .../transaction/jta/JtaAutoConfiguration.java | 2 +- .../PrimaryDefaultValidatorPostProcessor.java | 2 +- .../ValidationAutoConfiguration.java | 6 +- .../validation/ValidatorAdapter.java | 10 +- .../reactive/WebFluxAutoConfiguration.java | 2 +- .../AbstractErrorWebExceptionHandler.java | 4 +- .../DefaultErrorWebExceptionHandler.java | 3 +- .../ClientHttpConnectorConfiguration.java | 9 +- .../ConditionalOnMissingFilterBean.java | 4 +- .../DispatcherServletAutoConfiguration.java | 6 +- .../servlet/MultipartAutoConfiguration.java | 10 +- .../web/servlet/MultipartProperties.java | 4 +- ...vletWebServerFactoryAutoConfiguration.java | 4 +- .../ServletWebServerFactoryConfiguration.java | 4 +- .../web/servlet/WebMvcAutoConfiguration.java | 6 +- .../servlet/WelcomePageHandlerMapping.java | 2 +- .../error/AbstractErrorController.java | 6 +- .../servlet/error/BasicErrorController.java | 4 +- .../error/DefaultErrorViewResolver.java | 4 +- .../error/ErrorMvcAutoConfiguration.java | 6 +- .../web/servlet/error/ErrorViewResolver.java | 4 +- .../WebSocketReactiveAutoConfiguration.java | 6 +- ...10WebSocketServletWebServerCustomizer.java | 110 -------- ...tyWebSocketServletWebServerCustomizer.java | 24 +- .../WebSocketServletAutoConfiguration.java | 21 +- ...itional-spring-configuration-metadata.json | 2 +- .../batch/BatchAutoConfigurationTests.java | 3 +- .../ConditionEvaluationReportTests.java | 6 +- ...tionTranslationAutoConfigurationTests.java | 4 +- ...asticsearchDataAutoConfigurationTests.java | 4 +- ...rchRepositoriesAutoConfigurationTests.java | 4 +- ...rchRepositoriesAutoConfigurationTests.java | 2 +- ...ientAutoConfigurationIntegrationTests.java | 2 +- ...earchRestClientAutoConfigurationTests.java | 2 +- ...JpaRepositoriesAutoConfigurationTests.java | 2 +- .../autoconfigure/data/jpa/city/City.java | 8 +- .../data/jpa/country/Country.java | 8 +- .../autoconfigure/data/mongo/city/City.java | 8 +- .../data/mongo/country/Country.java | 8 +- .../Neo4jDataAutoConfigurationTests.java | 13 +- ...o4jReactiveDataAutoConfigurationTests.java | 17 +- .../domain/EntityScannerTests.java | 4 +- .../domain/scan/a/EmbeddableA.java | 4 +- .../autoconfigure/domain/scan/a/EntityA.java | 4 +- .../domain/scan/b/EmbeddableB.java | 4 +- .../autoconfigure/domain/scan/b/EntityB.java | 4 +- .../domain/scan/c/EmbeddableC.java | 4 +- .../autoconfigure/domain/scan/c/EntityC.java | 4 +- ...oConfigurationServletIntegrationTests.java | 4 +- .../GroovyTemplateAutoConfigurationTests.java | 4 +- ...ssageConvertersAutoConfigurationTests.java | 4 +- .../jms/JmsAutoConfigurationTests.java | 6 +- ...nnectionFactoryAutoConfigurationTests.java | 5 +- .../jsonb/JsonbAutoConfigurationTests.java | 4 +- ...bAutoConfigurationWithNoProviderTests.java | 2 +- .../MailSenderAutoConfigurationTests.java | 3 +- .../AbstractJpaAutoConfigurationTests.java | 5 +- .../HibernateJpaAutoConfigurationTests.java | 37 +-- .../orm/jpa/HibernatePropertiesTests.java | 4 +- .../boot/autoconfigure/orm/jpa/test/City.java | 12 +- .../orm/jpa/test/CityListener.java | 4 +- .../OAuth2WebSecurityConfigurationTests.java | 2 +- ...2ResourceServerAutoConfigurationTests.java | 2 +- ...ml2RelyingPartyAutoConfigurationTests.java | 2 +- .../SecurityAutoConfigurationTests.java | 2 +- .../servlet/StaticResourceRequestTests.java | 4 +- .../autoconfigure/security/user/User.java | 8 +- ...ssionAutoConfigurationHazelcast3Tests.java | 96 ------- ...essionAutoConfigurationHazelcastTests.java | 22 +- .../SessionAutoConfigurationTests.java | 4 +- .../jta/JtaAutoConfigurationTests.java | 5 +- .../ValidationAutoConfigurationTests.java | 8 +- ...hHibernateValidatorMissingElImplTests.java | 4 +- ...utoConfigurationWithoutValidatorTests.java | 4 +- .../validation/ValidatorAdapterTests.java | 6 +- .../web/ServerPropertiesTests.java | 8 +- .../WebFluxAutoConfigurationTests.java | 20 +- ...orWebExceptionHandlerIntegrationTests.java | 2 +- .../web/reactive/error/DummyBody.java | 4 +- .../ConditionalOnMissingFilterBeanTests.java | 12 +- ...spatcherServletAutoConfigurationTests.java | 4 +- .../FilterOrderingIntegrationTests.java | 2 +- .../HttpEncodingAutoConfigurationTests.java | 4 +- .../servlet/MockServletWebServerFactory.java | 2 +- .../MultipartAutoConfigurationTests.java | 4 +- ...ebServerFactoryAutoConfigurationTests.java | 10 +- ...tWebServerServletContextListenerTests.java | 6 +- .../servlet/WebMvcAutoConfigurationTests.java | 29 +- .../WelcomePageHandlerMappingTests.java | 4 +- ...asicErrorControllerDirectMockMvcTests.java | 2 +- .../BasicErrorControllerIntegrationTests.java | 8 +- .../BasicErrorControllerMockMvcTests.java | 10 +- .../DefaultErrorViewIntegrationTests.java | 6 +- .../error/DefaultErrorViewResolverTests.java | 4 +- .../error/ErrorMvcAutoConfigurationTests.java | 4 +- ...ebSocketServletAutoConfigurationTests.java | 6 +- ...gApplicationWebApplicationInitializer.java | 6 +- .../JmsCompilerAutoConfiguration.java | 6 +- .../SpringBootCompilerAutoConfiguration.java | 9 +- .../spring-boot-dependencies/build.gradle | 266 ++++-------------- .../spring-boot-devtools/build.gradle | 10 +- .../DevToolsDataSourceAutoConfiguration.java | 6 +- .../RemoteDevToolsAutoConfiguration.java | 4 +- .../remote/server/DispatcherFilter.java | 18 +- .../RemoteDevToolsAutoConfigurationTests.java | 2 +- .../livereload/LiveReloadServerTests.java | 10 +- .../remote/server/DispatcherFilterTests.java | 12 +- .../remote/server/UrlHandlerMapperTests.java | 4 +- .../configuration-metadata/manual-hints.adoc | 2 +- .../getting-started/system-requirements.adoc | 17 +- .../src/docs/asciidoc/howto/spring-mvc.adoc | 2 +- .../src/docs/asciidoc/web/servlet.adoc | 2 +- .../MyCloudFoundryConfiguration.java | 14 +- .../connectingusingspringdata/MyBean.java | 2 +- .../jpaandspringdata/entityclasses/City.java | 8 +- .../entityclasses/Country.java | 8 +- .../validate/MyProperties.java | 2 +- .../validate/nested/MyProperties.java | 6 +- .../client/Request.java | 2 +- .../client/Response.java | 6 +- ...yManagerFactoryDependsOnPostProcessor.java | 2 +- .../MyJmsConfiguration.java | 2 +- .../writexmlrestservice/MyThing.java | 2 +- .../springbean/disable/MyFilter.java | 2 +- .../MyTomcatConfiguration.java | 29 +- .../nonxa/MyBean.java | 2 +- .../primary/MyBean.java | 2 +- .../xa/MyBean.java | 2 +- .../boot/docs/io/validation/MyBean.java | 2 +- .../receiving/custom/MyJmsConfiguration.java | 2 +- .../receiving/custom/MyMessageConverter.java | 6 +- .../springmvc/errorhandling/MyController.java | 2 +- .../errorhandling/MyControllerAdvice.java | 4 +- .../errorpages/MyErrorViewResolver.java | 2 +- .../errorpageswithoutspringmvc/MyFilter.java | 8 +- .../MyFilterConfiguration.java | 2 +- .../spring-boot-parent/build.gradle | 2 +- .../build.gradle | 6 +- .../spring-boot-starter-data-jpa/build.gradle | 9 +- .../spring-boot-starter-jetty/build.gradle | 16 +- .../spring-boot-starter-undertow/build.gradle | 9 +- .../build.gradle | 8 +- .../build.gradle | 8 +- .../json/JsonTestersAutoConfiguration.java | 2 +- .../orm/jpa/TestEntityManager.java | 6 +- .../TestEntityManagerAutoConfiguration.java | 4 +- .../SpringBootMockMvcBuilderCustomizer.java | 4 +- .../web/servlet/WebMvcTypeExcludeFilter.java | 2 +- ...ListenerPostConstructIntegrationTests.java | 4 +- .../autoconfigure/jdbc/ExampleRepository.java | 4 +- .../autoconfigure/orm/jpa/ExampleEntity.java | 8 +- .../orm/jpa/TestEntityManagerTests.java | 8 +- ...ringBootMockMvcBuilderCustomizerTests.java | 14 +- .../servlet/mockmvc/AfterSecurityFilter.java | 14 +- .../servlet/mockmvc/ExampleController3.java | 4 +- .../web/servlet/mockmvc/ExampleFilter.java | 16 +- ...MvcTestAllControllersIntegrationTests.java | 2 +- ...WebMvcTestServletContextResourceTests.java | 4 +- ...ebMvcTestWithWebAppConfigurationTests.java | 4 +- .../webservices/client/Request.java | 4 +- .../webservices/client/Response.java | 8 +- .../webservices/server/Request.java | 4 +- .../webservices/server/Response.java | 4 +- .../SpringBootTestContextBootstrapper.java | 2 +- .../boot/test/json/JsonbTester.java | 4 +- ...gBootTestWebServerWebEnvironmentTests.java | 4 +- .../SpringBootContextLoaderMockMvcTests.java | 4 +- ...SpringBootTestWebEnvironmentMockTests.java | 4 +- ...nmentMockWithWebAppConfigurationTests.java | 4 +- .../boot/test/json/JsonbTesterTests.java | 4 +- .../SpringBootMockServletContextTests.java | 4 +- ...lateContextCustomizerIntegrationTests.java | 10 +- ...ustomizerWithOverrideIntegrationTests.java | 10 +- .../MetadataGenerationEnvironment.java | 2 +- .../specific/AnnotatedGetter.java | 4 +- .../boot/maven/JarIntegrationTests.java | 2 +- .../boot/maven/WarIntegrationTests.java | 2 +- .../main/java/org/test/SampleApplication.java | 4 +- .../web/servlet/ExampleFilter.java | 14 +- .../web/servlet/ExampleServlet.java | 12 +- .../web/servlet/MockServletWebServer.java | 14 +- ...fiedClassPathExtensionExclusionsTests.java | 4 +- spring-boot-project/spring-boot/build.gradle | 20 +- .../boot/WebApplicationType.java | 2 +- ...onfigurationPropertiesJsr303Validator.java | 4 +- .../ValidationExceptionFailureAnalyzer.java | 4 +- .../boot/jdbc/XADataSourceWrapper.java | 5 +- .../boot/jms/XAConnectionFactoryWrapper.java | 8 +- .../jpa/JpaDatabaseInitializerDetector.java | 2 +- ...pendsOnDatabaseInitializationDetector.java | 2 +- .../orm/jpa/hibernate/SpringJtaPlatform.java | 6 +- .../ApplicationContextRequestMatcher.java | 4 +- .../MessageInterpolatorFactory.java | 6 +- .../MessageSourceMessageInterpolator.java | 2 +- .../web/embedded/jetty/JasperInitializer.java | 4 +- .../jetty/JettyEmbeddedErrorHandler.java | 6 +- .../embedded/jetty/JettyHandlerWrappers.java | 14 +- .../jetty/JettyServletWebServerFactory.java | 28 +- ...ervletContextInitializerConfiguration.java | 4 +- .../CompressionConnectorCustomizer.java | 19 +- .../tomcat/SslConnectorCustomizer.java | 78 ++--- ...lStoreProviderUrlStreamHandlerFactory.java | 111 -------- .../boot/web/embedded/tomcat/TldPatterns.java | 1 + .../tomcat/TomcatEmbeddedContext.java | 2 +- .../tomcat/TomcatServletWebServerFactory.java | 6 +- .../web/embedded/tomcat/TomcatStarter.java | 8 +- .../DeploymentManagerHttpHandlerFactory.java | 4 +- .../UndertowServletWebServerFactory.java | 12 +- .../AbstractFilterRegistrationBean.java | 12 +- ...DelegatingFilterProxyRegistrationBean.java | 6 +- .../boot/web/servlet/DispatcherType.java | 4 +- .../web/servlet/DynamicRegistrationBean.java | 8 +- .../web/servlet/FilterRegistrationBean.java | 4 +- .../web/servlet/MultipartConfigFactory.java | 4 +- .../boot/web/servlet/RegistrationBean.java | 6 +- .../web/servlet/ServletComponentScan.java | 8 +- .../servlet/ServletContextInitializer.java | 8 +- .../ServletContextInitializerBeans.java | 8 +- .../ServletListenerRegistrationBean.java | 16 +- .../web/servlet/ServletRegistrationBean.java | 10 +- .../boot/web/servlet/WebFilterHandler.java | 6 +- .../boot/web/servlet/WebListenerHandler.java | 4 +- .../web/servlet/WebListenerRegistrar.java | 4 +- .../boot/web/servlet/WebListenerRegistry.java | 4 +- .../boot/web/servlet/WebServletHandler.java | 8 +- .../ServletWebServerApplicationContext.java | 10 +- ...onContextServletContextAwareProcessor.java | 6 +- .../servlet/error/DefaultErrorAttributes.java | 8 +- .../web/servlet/error/ErrorAttributes.java | 2 +- .../ApplicationContextHeaderFilter.java | 10 +- .../filter/ErrorPageSecurityFilter.java | 18 +- .../web/servlet/filter/OrderedFilter.java | 6 +- .../boot/web/servlet/filter/package-info.java | 4 +- .../boot/web/servlet/package-info.java | 2 +- .../AbstractServletWebServerFactory.java | 12 +- .../ConfigurableServletWebServerFactory.java | 2 +- .../server/CookieSameSiteSupplier.java | 2 +- .../boot/web/servlet/server/Session.java | 2 +- .../web/servlet/support/ErrorPageFilter.java | 32 +-- .../support/ErrorPageFilterConfiguration.java | 4 +- ...tContextApplicationContextInitializer.java | 4 +- .../support/SpringBootServletInitializer.java | 12 +- .../boot/web/servlet/view/MustacheView.java | 6 +- .../ConfigurationPropertiesTests.java | 7 +- .../context/properties/bind/BinderTests.java | 2 +- .../ValidationBindHandlerTests.java | 6 +- .../analyzer/BindFailureAnalyzerTests.java | 2 +- .../BindValidationFailureAnalyzerTests.java | 8 +- ...lidationExceptionFailureAnalyzerTests.java | 79 ------ .../NoSuchMethodFailureAnalyzerTests.java | 73 ++--- .../orm/jpa/hibernate/TelephoneNumber.java | 8 +- .../boot/sampleconfig/MyNamedComponent.java | 4 +- ...ApplicationContextRequestMatcherTests.java | 4 +- .../MessageInterpolatorFactoryTests.java | 2 +- ...latorFactoryWithoutElIntegrationTests.java | 8 +- ...ceMessageInterpolatorIntegrationTests.java | 10 +- ...MessageSourceMessageInterpolatorTests.java | 4 +- .../Jetty10ReactiveWebServerFactoryTests.java | 46 --- .../Jetty10ServletWebServerFactoryTests.java | 53 ---- .../JettyReactiveWebServerFactoryTests.java | 8 + .../JettyServletWebServerFactoryTests.java | 58 ++-- .../web/embedded/jetty/TestWithJetty10.java | 47 ---- .../CompressionConnectorCustomizerTests.java | 30 +- .../tomcat/SslConnectorCustomizerTests.java | 55 +--- .../TomcatServletWebServerFactoryTests.java | 17 +- .../UndertowServletWebServerFactoryTests.java | 3 +- ...AbstractReactiveWebServerFactoryTests.java | 4 +- .../AbstractFilterRegistrationBeanTests.java | 10 +- ...atingFilterProxyRegistrationBeanTests.java | 10 +- .../servlet/FilterRegistrationBeanTests.java | 12 +- .../FilterRegistrationIntegrationTests.java | 4 +- .../servlet/MultipartConfigFactoryTests.java | 4 +- ...oSpringWebFilterRegistrationBeanTests.java | 2 +- .../ServletComponentScanIntegrationTests.java | 10 +- .../ServletContextInitializerBeansTests.java | 18 +- .../ServletListenerRegistrationBeanTests.java | 6 +- .../servlet/ServletRegistrationBeanTests.java | 8 +- .../web/servlet/WebFilterHandlerTests.java | 16 +- .../web/servlet/WebListenerHandlerTests.java | 8 +- .../web/servlet/WebServletHandlerTests.java | 6 +- ...rvletWebServerApplicationContextTests.java | 10 +- ...rvletWebServerApplicationContextTests.java | 16 +- ...rvletWebServerApplicationContextTests.java | 4 +- ...vletWebServerApplicationConfiguration.java | 4 +- .../error/DefaultErrorAttributesTests.java | 34 +-- .../filter/ErrorPageSecurityFilterTests.java | 6 +- .../boot/web/servlet/mock/MockFilter.java | 14 +- .../boot/web/servlet/mock/MockServlet.java | 8 +- .../AbstractServletWebServerFactoryTests.java | 43 +-- .../server/CookieSameSiteSupplierTests.java | 2 +- .../server/MockServletWebServerFactory.java | 2 +- .../ErrorPageFilterIntegrationTests.java | 6 +- .../servlet/support/ErrorPageFilterTests.java | 14 +- ...extApplicationContextInitializerTests.java | 4 +- .../SpringBootServletInitializerTests.java | 10 +- .../servlet/testcomponents/TestFilter.java | 16 +- .../servlet/testcomponents/TestListener.java | 20 +- .../testcomponents/TestMultipartServlet.java | 8 +- .../servlet/testcomponents/TestServlet.java | 12 +- .../deployment/TomcatDeploymentTests.java | 2 +- .../PaketoBuilderTests-plainWarApp.gradle | 1 + .../src/main/java/sample/AnnotatedSample.java | 4 +- .../LaunchScriptTestApplication.java | 8 +- .../boot/loaderapp/LoaderTestApplication.java | 4 +- .../autoconfig/ExampleAutoConfiguration.java | 8 +- .../example/JettyServerCustomizerConfig.java | 20 +- .../example/ResourceHandlingApplication.java | 8 +- ...mpleActuatorCustomSecurityApplication.java | 10 +- .../smoketest/actuator/SampleController.java | 4 +- .../java/smoketest/data/jpa/domain/City.java | 12 +- .../java/smoketest/data/jpa/domain/Hotel.java | 18 +- .../smoketest/data/jpa/domain/Review.java | 22 +- .../java/smoketest/data/rest/domain/City.java | 12 +- .../smoketest/data/rest/domain/Hotel.java | 14 +- .../java/smoketest/devtools/MyController.java | 2 +- .../main/java/smoketest/flyway/Person.java | 10 +- .../build.gradle | 2 +- .../jsp/SampleWebJspApplicationTests.java | 5 +- .../jetty/ExampleServletContextListener.java | 6 +- .../spring-boot-smoke-test-jpa/build.gradle | 2 +- .../main/java/smoketest/jpa/domain/Note.java | 12 +- .../main/java/smoketest/jpa/domain/Tag.java | 12 +- .../jpa/repository/JpaNoteRepository.java | 6 +- .../jpa/repository/JpaTagRepository.java | 6 +- .../logback/SampleLogbackApplication.java | 4 +- .../servlet/SampleServletApplication.java | 12 +- .../src/main/resources/hazelcast.xml | 2 +- .../session/HelloRestController.java | 2 +- .../simple/SampleConfigurationProperties.java | 4 +- .../main/java/smoketest/test/domain/User.java | 10 +- ...dentificationNumberAttributeConverter.java | 6 +- .../testng/SampleTestNGApplication.java | 6 +- .../tomcat/SampleTomcatApplication.java | 6 +- .../smoketest/groovytemplates/Message.java | 4 +- .../mvc/MessageController.java | 4 +- .../reverse/ReverseWebSocketEndpoint.java | 8 +- .../reverse/ReverseWebSocketEndpoint.java | 8 +- .../reverse/ReverseWebSocketEndpoint.java | 8 +- src/checkstyle/import-control.xml | 14 +- 444 files changed, 1642 insertions(+), 2394 deletions(-) delete mode 100644 spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/Jetty10WebSocketServletWebServerCustomizer.java delete mode 100644 spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationHazelcast3Tests.java delete mode 100644 spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslStoreProviderUrlStreamHandlerFactory.java delete mode 100644 spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests.java delete mode 100644 spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ReactiveWebServerFactoryTests.java delete mode 100644 spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ServletWebServerFactoryTests.java delete mode 100644 spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/TestWithJetty10.java diff --git a/gradle.properties b/gradle.properties index 161f44c9c6..479d3b34c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,6 +5,6 @@ org.gradle.parallel=true org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8 kotlinVersion=1.6.0 -tomcatVersion=9.0.55 +tomcatVersion=10.0.12 kotlin.stdlib.default.dependency=false diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index df0edcbf8e..33e1749c2d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -101,12 +101,7 @@ dependencies { exclude group: "commons-logging", module: "commons-logging" } optional("org.flywaydb:flyway-core") - optional("org.hibernate:hibernate-core") { - exclude group: "javax.activation", module: "javax.activation-api" - exclude group: "javax.persistence", module: "javax.persistence-api" - exclude group: "javax.xml.bind", module: "jaxb-api" - exclude group: "org.jboss.spec.javax.transaction", module: "jboss-transaction-api_1.2_spec" - } + optional("org.hibernate:hibernate-core-jakarta") optional("org.hibernate.validator:hibernate-validator") optional("org.influxdb:influxdb-java") optional("org.liquibase:liquibase-core") { @@ -146,9 +141,8 @@ dependencies { testImplementation("com.squareup.okhttp3:mockwebserver") testImplementation("com.jayway.jsonpath:json-path") testImplementation("io.undertow:undertow-core") - testImplementation("io.undertow:undertow-servlet") { + testImplementation("io.undertow:undertow-servlet-jakartaee9") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" - exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_4.0_spec" } testImplementation("jakarta.xml.bind:jakarta.xml.bind-api") testImplementation("org.apache.logging.log4j:log4j-to-slf4j") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityInterceptor.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityInterceptor.java index 5b612dd6bd..51a57a6b0a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityInterceptor.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.cloudfoundry.servlet; import java.util.Locale; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java index d4dc93e6bc..7a40ced9f2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java @@ -22,8 +22,8 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.stream.Collectors; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchReactiveHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchReactiveHealthContributorAutoConfiguration.java index 91ebf36ef3..49646d0674 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchReactiveHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchReactiveHealthContributorAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -32,7 +32,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRestClientAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient; +import org.springframework.data.elasticsearch.backend.elasticsearch7.client.reactive.ReactiveElasticsearchClient; /** * {@link EnableAutoConfiguration Auto-configuration} for diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfiguration.java index 90e3bb5b7a..9735b4eb98 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfiguration.java @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.jms; import java.util.Map; -import javax.jms.ConnectionFactory; +import jakarta.jms.ConnectionFactory; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java index fa027bb45d..378e917a95 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java @@ -16,16 +16,21 @@ package org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus; +import java.io.IOException; +import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.time.Duration; +import java.util.Base64; import java.util.Map; import io.micrometer.core.instrument.Clock; import io.micrometer.prometheus.PrometheusConfig; import io.micrometer.prometheus.PrometheusMeterRegistry; import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.exporter.BasicAuthHttpConnectionFactory; +import io.prometheus.client.exporter.DefaultHttpConnectionFactory; +import io.prometheus.client.exporter.HttpConnectionFactory; import io.prometheus.client.exporter.PushGateway; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -154,4 +159,29 @@ public class PrometheusMetricsExportAutoConfiguration { } + static class BasicAuthHttpConnectionFactory implements HttpConnectionFactory { + + private final HttpConnectionFactory delegate = new DefaultHttpConnectionFactory(); + + private final String authorizationHeader; + + BasicAuthHttpConnectionFactory(String username, String password) { + this.authorizationHeader = "Basic " + new String( + Base64.getEncoder().encode(new String(username + ":" + password).getBytes(StandardCharsets.UTF_8)), + StandardCharsets.UTF_8); + } + + String getAuthorizationHeader() { + return this.authorizationHeader; + } + + @Override + public HttpURLConnection create(String url) throws IOException { + HttpURLConnection connection = this.delegate.create(url); + connection.setRequestProperty("Authorization", this.authorizationHeader); + return connection; + } + + } + } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfiguration.java index 5647036689..aebd1fb681 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.metrics.web.servlet; import java.util.stream.Collectors; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.config.MeterFilter; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java index 3c5299f3bf..03ed9ef8bc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -27,7 +27,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerAdapter.java index 019fdbc387..fc830a3a75 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerAdapter.java @@ -20,8 +20,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.core.annotation.AnnotationAwareOrderComparator; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolver.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolver.java index 345617df91..69b941ec17 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolver.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerMapping.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerMapping.java index f5240d4614..cc5e74a136 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerMapping.java @@ -19,7 +19,7 @@ package org.springframework.boot.actuate.autoconfigure.web.servlet; import java.util.ArrayList; import java.util.List; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java index d2a6002aa3..dc42b3c6e3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.web.servlet; import java.io.File; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.apache.catalina.Valve; import org.apache.catalina.valves.AccessLogValve; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementContextAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementContextAutoConfiguration.java index f7a7fc2616..b3c1a12ab9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementContextAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementContextAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.actuate.autoconfigure.web.servlet; -import javax.servlet.Servlet; +import jakarta.servlet.Servlet; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointTests.java index 1002d79fec..029e4d59e1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,7 +19,7 @@ package org.springframework.boot.actuate.autoconfigure.condition; import java.util.Arrays; import java.util.Collections; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java index fd8346d920..3a50c227c0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java @@ -20,10 +20,10 @@ import java.io.IOException; import java.time.Duration; import java.util.function.Supplier; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java index afa442cc4f..90fa042126 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.integrationtest; import java.util.function.Supplier; -import javax.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServlet; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfigurationTests.java index 68780e418c..2ee6acba2c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfigurationTests.java @@ -16,7 +16,7 @@ package org.springframework.boot.actuate.autoconfigure.jms; -import javax.jms.ConnectionFactory; +import jakarta.jms.ConnectionFactory; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/data/city/City.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/data/city/City.java index 9b64dcbc10..ee0c5833c6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/data/city/City.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/data/city/City.java @@ -18,10 +18,10 @@ package org.springframework.boot.actuate.autoconfigure.metrics.data.city; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; @Entity public class City implements Serializable { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java index b19f63c3bc..73e6d6c656 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,19 +16,18 @@ package org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus; -import java.util.function.Consumer; - import io.micrometer.core.instrument.Clock; import io.micrometer.prometheus.PrometheusConfig; import io.micrometer.prometheus.PrometheusMeterRegistry; import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.exporter.BasicAuthHttpConnectionFactory; import io.prometheus.client.exporter.DefaultHttpConnectionFactory; import io.prometheus.client.exporter.HttpConnectionFactory; import io.prometheus.client.exporter.PushGateway; +import org.assertj.core.api.ThrowingConsumer; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus.PrometheusMetricsExportAutoConfiguration.BasicAuthHttpConnectionFactory; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration; import org.springframework.boot.actuate.metrics.export.prometheus.PrometheusPushGatewayManager; import org.springframework.boot.actuate.metrics.export.prometheus.PrometheusScrapeEndpoint; @@ -193,8 +192,11 @@ class PrometheusMetricsExportAutoConfigurationTests { "management.metrics.export.prometheus.pushgateway.username=admin", "management.metrics.export.prometheus.pushgateway.password=secret") .withUserConfiguration(BaseConfiguration.class) - .run(hasHttpConnectionFactory((httpConnectionFactory) -> assertThat(httpConnectionFactory) - .isInstanceOf(BasicAuthHttpConnectionFactory.class))); + .run(hasHttpConnectionFactory((httpConnectionFactory) -> { + assertThat(httpConnectionFactory).isInstanceOf(BasicAuthHttpConnectionFactory.class); + assertThat(((BasicAuthHttpConnectionFactory) httpConnectionFactory).getAuthorizationHeader()) + .isEqualTo("Basic YWRtaW46c2VjcmV0"); + })); } private void hasGatewayURL(AssertableApplicationContext context, String url) { @@ -202,7 +204,7 @@ class PrometheusMetricsExportAutoConfigurationTests { } private ContextConsumer hasHttpConnectionFactory( - Consumer httpConnectionFactory) { + ThrowingConsumer httpConnectionFactory) { return (context) -> { PushGateway pushGateway = getPushGateway(context); httpConnectionFactory diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/test/MetricsIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/test/MetricsIntegrationTests.java index 8c2552af31..9575100c61 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/test/MetricsIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/test/MetricsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -22,7 +22,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.CyclicBarrier; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.MockClock; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfigurationTests.java index 0c07ec22fc..4a003d461c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ import java.util.Collection; import java.util.Collections; import java.util.EnumSet; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.instrument.Meter; import io.micrometer.core.instrument.MeterRegistry; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java index 005d1bab1a..e1b21e47d6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java @@ -21,10 +21,10 @@ import java.time.Duration; import java.util.Base64; import java.util.function.Supplier; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java index 68ab2af9b9..be50fd1f2e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,7 +19,7 @@ package org.springframework.boot.actuate.autoconfigure.security.servlet; import java.util.ArrayList; import java.util.List; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.assertj.core.api.AssertDelegateTarget; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java index 1b99ffeacf..a61f77bd57 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java @@ -161,7 +161,7 @@ class ManagementWebSecurityAutoConfigurationTests { } private HttpStatus getResponseStatus(AssertableWebApplicationContext context, String path) - throws IOException, javax.servlet.ServletException { + throws IOException, jakarta.servlet.ServletException { FilterChainProxy filterChainProxy = context.getBean(FilterChainProxy.class); MockServletContext servletContext = new MockServletContext(); MockHttpServletResponse response = new MockHttpServletResponse(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolverTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolverTests.java index f78843a96e..6aec15488d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolverTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.actuate.autoconfigure.web.servlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpointTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpointTests.java index a11e090e4f..37105fa949 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpointTests.java @@ -48,7 +48,7 @@ class ManagementErrorEndpointTests { @BeforeEach void setUp() { - this.request.setAttribute("javax.servlet.error.exception", new RuntimeException("test exception")); + this.request.setAttribute("jakarta.servlet.error.exception", new RuntimeException("test exception")); } @Test diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java index 20325894bf..f83d146cb5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.web.servlet; import java.util.Arrays; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredFilter; import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredServlet; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java index 24c88be525..87788c950d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java @@ -21,8 +21,8 @@ import java.util.Map; import java.util.function.Consumer; import java.util.function.Function; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/sample.log b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/sample.log index d8c7e36812..db64317739 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/sample.log +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/sample.log @@ -20,8 +20,8 @@ 2017-08-08 17:12:32.084 INFO 19866 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 2017-08-08 17:12:32.084 INFO 19866 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 2017-08-08 17:12:32.349 INFO 19866 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@76b10754: startup date [Tue Aug 08 17:12:30 BST 2017]; root of context hierarchy -2017-08-08 17:12:32.420 INFO 19866 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest) -2017-08-08 17:12:32.421 INFO 19866 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) +2017-08-08 17:12:32.420 INFO 19866 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(jakarta.servlet.http.HttpServletRequest) +2017-08-08 17:12:32.421 INFO 19866 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(jakarta.servlet.http.HttpServletRequest,jakarta.servlet.http.HttpServletResponse) 2017-08-08 17:12:32.444 INFO 19866 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2017-08-08 17:12:32.444 INFO 19866 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2017-08-08 17:12:32.471 INFO 19866 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index 9c8a866a94..a9064cd715 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -31,12 +31,8 @@ dependencies { optional("io.r2dbc:r2dbc-pool") optional("io.r2dbc:r2dbc-spi") optional("io.reactivex:rxjava-reactive-streams") - optional("org.elasticsearch.client:elasticsearch-rest-client") { - exclude(group: "commons-logging", module: "commons-logging") - } - optional("io.undertow:undertow-servlet") { + optional("io.undertow:undertow-servlet-jakartaee9") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" - exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_4.0_spec" } optional("javax.cache:cache-api") optional("jakarta.jms:jakarta.jms-api") @@ -49,6 +45,12 @@ dependencies { exclude(group: "javax.servlet", module: "javax.servlet-api") } optional("org.elasticsearch:elasticsearch") + optional("org.elasticsearch.client:elasticsearch-rest-client") { + exclude(group: "commons-logging", module: "commons-logging") + } + optional("org.elasticsearch.client:elasticsearch-rest-high-level-client") { + exclude(group: "commons-logging", module: "commons-logging") + } optional("org.flywaydb:flyway-core") optional("org.hibernate.validator:hibernate-validator") optional("org.influxdb:influxdb-java") diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicator.java index 5290bfea7d..5525baa7e1 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -25,7 +25,7 @@ import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.Status; import org.springframework.core.ParameterizedTypeReference; -import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient; +import org.springframework.data.elasticsearch.backend.elasticsearch7.client.reactive.ReactiveElasticsearchClient; import org.springframework.web.reactive.function.client.ClientResponse; import org.springframework.web.reactive.function.client.WebClient; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java index 96dd948a21..f7949e5fe9 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; -import javax.servlet.Servlet; -import javax.servlet.ServletRegistration.Dynamic; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletRegistration.Dynamic; import org.springframework.beans.BeanUtils; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java index 304cf28372..e70b143dbf 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,9 @@ package org.springframework.boot.actuate.endpoint.web; import java.util.Collection; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration.Dynamic; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRegistration.Dynamic; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java index cb984c0dd4..188d2c4111 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java @@ -26,8 +26,8 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.InitializingBean; import org.springframework.boot.actuate.endpoint.InvalidEndpointRequestException; @@ -333,7 +333,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin }); InvocationContext invocationContext = new InvocationContext(securityContext, arguments, serverNamespaceArgumentResolver, producibleOperationArgumentResolver); - return handleResult(this.operation.invoke(invocationContext), HttpMethod.resolve(request.getMethod())); + return handleResult(this.operation.invoke(invocationContext), HttpMethod.valueOf(request.getMethod())); } catch (InvalidEndpointRequestException ex) { throw new InvalidEndpointBadRequestException(ex); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/SkipPathExtensionContentNegotiation.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/SkipPathExtensionContentNegotiation.java index 156ee97996..49997e12ee 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/SkipPathExtensionContentNegotiation.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/SkipPathExtensionContentNegotiation.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.actuate.endpoint.web.servlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.servlet.HandlerInterceptor; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMapping.java index 74073f28f3..b6000f9c15 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMapping.java @@ -20,8 +20,8 @@ import java.util.Collection; import java.util.Collections; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver; import org.springframework.boot.actuate.endpoint.web.EndpointMapping; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jms/JmsHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jms/JmsHealthIndicator.java index 52edf5404e..d8888675e2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jms/JmsHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jms/JmsHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,9 +19,9 @@ package org.springframework.boot.actuate.jms; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.JMSException; +import jakarta.jms.Connection; +import jakarta.jms.ConnectionFactory; +import jakarta.jms.JMSException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTags.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTags.java index 7ae68adcab..b5309909ba 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTags.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTags.java @@ -70,7 +70,7 @@ public final class WebFluxTags { * @return the method tag whose value is a capitalized method (e.g. GET). */ public static Tag method(ServerWebExchange exchange) { - return Tag.of("method", exchange.getRequest().getMethodValue()); + return Tag.of("method", exchange.getRequest().getMethod().name()); } /** diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/DefaultWebMvcTagsProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/DefaultWebMvcTagsProvider.java index 3336e89d02..6a1ce9e7bd 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/DefaultWebMvcTagsProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/DefaultWebMvcTagsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -19,8 +19,8 @@ package org.springframework.boot.actuate.metrics.web.servlet; import java.util.Collections; import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/LongTaskTimingHandlerInterceptor.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/LongTaskTimingHandlerInterceptor.java index 7f5be970bb..f8749088e6 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/LongTaskTimingHandlerInterceptor.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/LongTaskTimingHandlerInterceptor.java @@ -23,8 +23,8 @@ import java.util.Collections; import java.util.List; import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.annotation.Timed; import io.micrometer.core.instrument.LongTaskTimer; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java index 8838253d0d..10c97ed91c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java @@ -20,10 +20,10 @@ import java.io.IOException; import java.util.Collections; import java.util.Set; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.annotation.Timed; import io.micrometer.core.instrument.MeterRegistry; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java index e5e2147bf8..a5e8c17cba 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,8 +18,8 @@ package org.springframework.boot.actuate.metrics.web.servlet; import java.util.regex.Pattern; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.instrument.Tag; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTagsContributor.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTagsContributor.java index 0b0d3d5ef7..0c16de4d19 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTagsContributor.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTagsContributor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.actuate.metrics.web.servlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.instrument.LongTaskTimer; import io.micrometer.core.instrument.Tag; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTagsProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTagsProvider.java index 101ce828ba..b589ed5942 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTagsProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTagsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.actuate.metrics.web.servlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.instrument.LongTaskTimer; import io.micrometer.core.instrument.Tag; 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 ec858aded0..595c6acd76 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -21,7 +21,7 @@ import java.util.List; import java.util.Optional; import java.util.stream.Stream; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import org.apache.catalina.Container; import org.apache.catalina.Context; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProvider.java index 8644d8366b..d93826fbcf 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -26,7 +26,7 @@ import java.util.Map.Entry; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.servlet.Servlet; +import jakarta.servlet.Servlet; import org.springframework.boot.actuate.web.mappings.HandlerMethodDescription; import org.springframework.boot.actuate.web.mappings.MappingDescriptionProvider; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FilterRegistrationMappingDescription.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FilterRegistrationMappingDescription.java index 61a4cd503c..be2eaa0c32 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FilterRegistrationMappingDescription.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FilterRegistrationMappingDescription.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.web.mappings.servlet; import java.util.Collection; -import javax.servlet.FilterRegistration; +import jakarta.servlet.FilterRegistration; /** * A {@link RegistrationMappingDescription} derived from a {@link FilterRegistration}. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FiltersMappingDescriptionProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FiltersMappingDescriptionProvider.java index 677558448a..e287ce9dcc 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FiltersMappingDescriptionProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FiltersMappingDescriptionProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javax.servlet.Filter; -import javax.servlet.ServletContext; +import jakarta.servlet.Filter; +import jakarta.servlet.ServletContext; import org.springframework.boot.actuate.web.mappings.MappingDescriptionProvider; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/RegistrationMappingDescription.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/RegistrationMappingDescription.java index 338b89c37a..9d498136ef 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/RegistrationMappingDescription.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/RegistrationMappingDescription.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.actuate.web.mappings.servlet; -import javax.servlet.Registration; +import jakarta.servlet.Registration; /** * A mapping description derived from a {@link Registration}. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletRegistrationMappingDescription.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletRegistrationMappingDescription.java index 80858da64d..1b96682c0c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletRegistrationMappingDescription.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletRegistrationMappingDescription.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.web.mappings.servlet; import java.util.Collection; -import javax.servlet.ServletRegistration; +import jakarta.servlet.ServletRegistration; /** * A mapping description derived from a {@link ServletRegistration}. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletsMappingDescriptionProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletsMappingDescriptionProvider.java index 4cf432c121..4734997ca4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletsMappingDescriptionProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletsMappingDescriptionProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; import org.springframework.boot.actuate.web.mappings.MappingDescriptionProvider; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/reactive/ServerWebExchangeTraceableRequest.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/reactive/ServerWebExchangeTraceableRequest.java index fba82d119b..c6eeeb9746 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/reactive/ServerWebExchangeTraceableRequest.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/reactive/ServerWebExchangeTraceableRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -44,7 +44,7 @@ class ServerWebExchangeTraceableRequest implements TraceableRequest { ServerWebExchangeTraceableRequest(ServerWebExchange exchange) { ServerHttpRequest request = exchange.getRequest(); - this.method = request.getMethodValue(); + this.method = request.getMethod().name(); this.headers = request.getHeaders(); this.uri = request.getURI(); this.remoteAddress = getRemoteAddress(request); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilter.java index 7d85cc0399..88772d6d1f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,13 +20,13 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; -import javax.servlet.http.HttpSession; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; +import jakarta.servlet.http.HttpSession; import org.springframework.boot.actuate.trace.http.HttpExchangeTracer; import org.springframework.boot.actuate.trace.http.HttpTrace; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/TraceableHttpServletRequest.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/TraceableHttpServletRequest.java index b1b887a3c7..9a7e4c9949 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/TraceableHttpServletRequest.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/TraceableHttpServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -25,7 +25,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.boot.actuate.trace.http.TraceableRequest; import org.springframework.util.StringUtils; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/TraceableHttpServletResponse.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/TraceableHttpServletResponse.java index 181dbbc5d7..cce56777a1 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/TraceableHttpServletResponse.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/TraceableHttpServletResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -21,7 +21,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.actuate.trace.http.TraceableResponse; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicatorTests.java index 97da21c8cc..d7a51f0f7e 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -26,9 +26,9 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; +import org.springframework.data.elasticsearch.backend.elasticsearch7.client.reactive.DefaultReactiveElasticsearchClient; +import org.springframework.data.elasticsearch.backend.elasticsearch7.client.reactive.ReactiveElasticsearchClient; import org.springframework.data.elasticsearch.client.ClientConfiguration; -import org.springframework.data.elasticsearch.client.reactive.DefaultReactiveElasticsearchClient; -import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java index ae9a1c276f..e405dd7c13 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; -import javax.servlet.GenericServlet; -import javax.servlet.Servlet; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java index e4e2a419c5..3e26f6fb3c 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,13 +18,13 @@ package org.springframework.boot.actuate.endpoint.web; import java.util.Collections; -import javax.servlet.GenericServlet; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration.Dynamic; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRegistration.Dynamic; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java index 745465ccae..cdd01a0473 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,10 +24,10 @@ import java.util.function.Consumer; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.servlet.GenericServlet; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/DefaultWebMvcTagsProviderTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/DefaultWebMvcTagsProviderTests.java index fd5de979ee..a48a9b5e97 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/DefaultWebMvcTagsProviderTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/DefaultWebMvcTagsProviderTests.java @@ -23,8 +23,8 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.instrument.Tag; import org.junit.jupiter.api.Test; 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 4086a519b2..1b0103db68 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 @@ -19,11 +19,11 @@ package org.springframework.boot.actuate.endpoint.web.servlet; import java.io.IOException; import java.util.Arrays; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java index 93d39f95c6..c9fc8d6b36 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,10 +16,10 @@ package org.springframework.boot.actuate.jms; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.ConnectionMetaData; -import javax.jms.JMSException; +import jakarta.jms.Connection; +import jakarta.jms.ConnectionFactory; +import jakarta.jms.ConnectionMetaData; +import jakarta.jms.JMSException; import org.junit.jupiter.api.Test; import org.mockito.invocation.InvocationOnMock; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mail/MailHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mail/MailHealthIndicatorTests.java index 3cf1b7595f..c4019586f0 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mail/MailHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mail/MailHealthIndicatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,14 +18,14 @@ package org.springframework.boot.actuate.mail; import java.util.Properties; -import javax.mail.Address; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.Provider; -import javax.mail.Provider.Type; -import javax.mail.Session; -import javax.mail.Transport; -import javax.mail.URLName; +import jakarta.mail.Address; +import jakarta.mail.Message; +import jakarta.mail.MessagingException; +import jakarta.mail.Provider; +import jakarta.mail.Provider.Type; +import jakarta.mail.Session; +import jakarta.mail.Transport; +import jakarta.mail.URLName; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTagsTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTagsTests.java index 7273b9b0f4..c6e04f9a6e 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTagsTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTagsTests.java @@ -22,6 +22,7 @@ import io.micrometer.core.instrument.Tag; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; @@ -134,7 +135,7 @@ class WebFluxTagsTests { ServerWebExchange exchange = mock(ServerWebExchange.class); ServerHttpRequest request = mock(ServerHttpRequest.class); given(exchange.getRequest()).willReturn(request); - given(request.getMethodValue()).willReturn("CUSTOM"); + given(request.getMethod()).willReturn(HttpMethod.valueOf("CUSTOM")); Tag tag = WebFluxTags.method(exchange); assertThat(tag.getValue()).isEqualTo("CUSTOM"); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/FaultyWebMvcTagsProvider.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/FaultyWebMvcTagsProvider.java index fab53800ed..1c5ae9a1e4 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/FaultyWebMvcTagsProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/FaultyWebMvcTagsProvider.java @@ -18,8 +18,8 @@ package org.springframework.boot.actuate.metrics.web.servlet; import java.util.concurrent.atomic.AtomicBoolean; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.instrument.Tag; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java index 85d6ab16e7..d76d49937b 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java @@ -30,10 +30,10 @@ import java.util.concurrent.CyclicBarrier; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.micrometer.core.annotation.Timed; import io.micrometer.core.instrument.Clock; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/servlet/HttpTraceFilterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/servlet/HttpTraceFilterTests.java index bda27e8bd8..69e1852430 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/servlet/HttpTraceFilterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/servlet/HttpTraceFilterTests.java @@ -20,10 +20,10 @@ import java.io.IOException; import java.security.Principal; import java.util.EnumSet; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/MappingsEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/MappingsEndpointTests.java index 91ff146d15..31da2f82dc 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/MappingsEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/MappingsEndpointTests.java @@ -22,10 +22,10 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; -import javax.servlet.FilterRegistration; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration; +import jakarta.servlet.FilterRegistration; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRegistration; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/reactive/ServerWebExchangeTraceableRequestTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/reactive/ServerWebExchangeTraceableRequestTests.java index f29c4f52c8..7125741c85 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/reactive/ServerWebExchangeTraceableRequestTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/reactive/ServerWebExchangeTraceableRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.web.server.ServerWebExchange; @@ -48,14 +49,13 @@ class ServerWebExchangeTraceableRequestTests { this.exchange = mock(ServerWebExchange.class); this.request = mock(ServerHttpRequest.class); given(this.exchange.getRequest()).willReturn(this.request); + given(this.request.getMethod()).willReturn(HttpMethod.GET); } @Test void getMethod() { - String method = "POST"; - given(this.request.getMethodValue()).willReturn(method); ServerWebExchangeTraceableRequest traceableRequest = new ServerWebExchangeTraceableRequest(this.exchange); - assertThat(traceableRequest.getMethod()).isSameAs(method); + assertThat(traceableRequest.getMethod()).isEqualTo("GET"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index 20e4ba4136..5bc1a394d3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -34,14 +34,11 @@ dependencies { optional("io.r2dbc:r2dbc-pool") optional("io.rsocket:rsocket-core") optional("io.rsocket:rsocket-transport-netty") - optional("io.undertow:undertow-servlet") { + optional("io.undertow:undertow-servlet-jakartaee9") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" - exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_4.0_spec" } - optional("io.undertow:undertow-websockets-jsr") { + optional("io.undertow:undertow-websockets-jsr-jakartaee9") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" - exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_4.0_spec" - exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec" } optional("jakarta.jms:jakarta.jms-api") optional("jakarta.mail:jakarta.mail-api") @@ -78,12 +75,11 @@ dependencies { exclude(group: "org.eclipse.jetty", module: "jetty-jndi") } optional("org.eclipse.jetty:jetty-reactive-httpclient") - optional("org.eclipse.jetty.websocket:javax-websocket-server-impl") { - exclude group: "javax.annotation", module: "javax.annotation-api" - exclude group: "javax.servlet", module: "javax.servlet-api" - exclude group: "javax.websocket", module: "javax.websocket-api" - exclude group: "javax.websocket", module: "javax.websocket-client-api" - exclude group: "org.eclipse.jetty", module: "jetty-jndi" + optional("org.eclipse.jetty.websocket:websocket-jakarta-server") { + exclude(group: "org.eclipse.jetty", module: "jetty-jndi") + } + optional("org.eclipse.jetty.websocket:websocket-jetty-server") { + exclude(group: "org.eclipse.jetty", module: "jetty-jndi") } optional("org.elasticsearch.client:elasticsearch-rest-client") { exclude group: "commons-logging", module: "commons-logging" @@ -96,17 +92,9 @@ dependencies { } optional("org.flywaydb:flyway-core") optional("org.freemarker:freemarker") - optional("org.hibernate:hibernate-core") { - exclude group: "javax.activation", module: "javax.activation-api" - exclude group: "javax.persistence", module: "javax.persistence-api" - exclude group: "javax.xml.bind", module: "jaxb-api" - exclude group: "org.jboss.spec.javax.transaction", module: "jboss-transaction-api_1.2_spec" - } + optional("org.hibernate:hibernate-core-jakarta") optional("org.hibernate:hibernate-jcache") { - exclude group: "javax.activation", module: "javax.activation-api" - exclude group: "javax.persistence", module: "javax.persistence-api" - exclude group: "javax.xml.bind", module: "jaxb-api" - exclude group: "org.jboss.spec.javax.transaction", module: "jboss-transaction-api_1.2_spec" + exclude group: "org.hibernate", module: "hibernate-core" } optional("org.hibernate.validator:hibernate-validator") optional("org.influxdb:influxdb-java") @@ -164,21 +152,24 @@ dependencies { optional("org.springframework.session:spring-session-core") optional("org.springframework.session:spring-session-data-mongodb") optional("org.springframework.session:spring-session-data-redis") - optional("org.springframework.session:spring-session-hazelcast") { - exclude group: "javax.annotation", module: "javax.annotation-api" - } + optional("org.springframework.session:spring-session-hazelcast") optional("org.springframework.session:spring-session-jdbc") optional("org.springframework.amqp:spring-rabbit") optional("org.springframework.amqp:spring-rabbit-stream") optional("org.springframework.kafka:spring-kafka") - optional("org.springframework.ws:spring-ws-core") + optional("org.springframework.ws:spring-ws-core") { + exclude group: "com.sun.mail", module: "jakarta.mail" + exclude group: "jakarta.platform", module: "jakarta.jakartaee-api" + exclude group: "org.eclipse.jetty", module: "jetty-server" + exclude group: "org.eclipse.jetty", module: "jetty-servlet" + exclude group: "jakarta.mail", module: "jakarta.mail-api" + } optional("redis.clients:jedis") testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation("ch.qos.logback:logback-classic") testImplementation("commons-fileupload:commons-fileupload") - testImplementation("com.atomikos:transactions-jms") testImplementation("com.github.h-thurow:simple-jndi") testImplementation("com.ibm.db2:jcc") testImplementation("com.jayway.jsonpath:json-path") diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java index d97c57d248..b475383c2a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java @@ -20,8 +20,8 @@ import java.nio.charset.StandardCharsets; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; -import javax.validation.Configuration; -import javax.validation.Validation; +import jakarta.validation.Configuration; +import jakarta.validation.Validation; import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; import org.springframework.boot.context.event.ApplicationFailedEvent; @@ -139,7 +139,7 @@ public class BackgroundPreinitializer implements ApplicationListener - * {@link javax.jms.Session#SESSION_TRANSACTED} is not defined as we take care of this - * already via a call to {@code setSessionTransacted}. + * {@link jakarta.jms.Session#SESSION_TRANSACTED} is not defined as we take care of + * this already via a call to {@code setSessionTransacted}. */ public enum AcknowledgeMode { @@ -336,7 +336,7 @@ public class JmsProperties { /** * Messages are acknowledged once the message listener implementation has called - * {@link javax.jms.Message#acknowledge()}. This mode gives the application + * {@link jakarta.jms.Message#acknowledge()}. This mode gives the application * (rather than the JMS provider) complete control over message acknowledgement. */ CLIENT(2), diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfiguration.java index b3075bd433..10378b0084 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,10 @@ package org.springframework.boot.autoconfigure.jms; import java.util.Arrays; -import javax.jms.ConnectionFactory; import javax.naming.NamingException; +import jakarta.jms.ConnectionFactory; + import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.AnyNestedCondition; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java index 67f42b4a2b..02d274db09 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -27,7 +27,6 @@ import org.springframework.boot.autoconfigure.condition.SearchStrategy; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableMBeanExport; -import org.springframework.context.annotation.MBeanExportConfiguration.SpecificPlatform; import org.springframework.context.annotation.Primary; import org.springframework.core.env.Environment; import org.springframework.jmx.export.MBeanExporter; @@ -91,10 +90,6 @@ public class JmxAutoConfiguration { @Bean @ConditionalOnMissingBean public MBeanServer mbeanServer() { - SpecificPlatform platform = SpecificPlatform.get(); - if (platform != null) { - return platform.getMBeanServer(); - } MBeanServerFactoryBean factory = new MBeanServerFactoryBean(); factory.setLocateExistingServerIfPossible(true); factory.afterPropertiesSet(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfiguration.java index 3a27d26d29..1310177841 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.autoconfigure.jsonb; -import javax.json.bind.Jsonb; -import javax.json.bind.JsonbBuilder; +import jakarta.json.bind.Jsonb; +import jakarta.json.bind.JsonbBuilder; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -34,8 +34,8 @@ import org.springframework.context.annotation.Configuration; */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(Jsonb.class) -@ConditionalOnResource(resources = { "classpath:META-INF/services/javax.json.bind.spi.JsonbProvider", - "classpath:META-INF/services/javax.json.spi.JsonProvider" }) +@ConditionalOnResource(resources = { "classpath:META-INF/services/jakarta.json.bind.spi.JsonbProvider", + "classpath:META-INF/services/jakarta.json.spi.JsonProvider" }) public class JsonbAutoConfiguration { @Bean diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java index 8abb907c1e..9a4b9ed051 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -22,7 +22,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.PreDestroy; +import jakarta.annotation.PreDestroy; import com.unboundid.ldap.listener.InMemoryDirectoryServer; import com.unboundid.ldap.listener.InMemoryDirectoryServerConfig; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfiguration.java index 35fe65d10a..72afedbe68 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.autoconfigure.mail; -import javax.activation.MimeType; -import javax.mail.internet.MimeMessage; +import jakarta.activation.MimeType; +import jakarta.mail.internet.MimeMessage; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.AnyNestedCondition; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderJndiConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderJndiConfiguration.java index 2d86791307..02cfe435ca 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderJndiConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderJndiConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,10 @@ package org.springframework.boot.autoconfigure.mail; -import javax.mail.Session; import javax.naming.NamingException; +import jakarta.mail.Session; + import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnJndi; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderValidatorAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderValidatorAutoConfiguration.java index e72104819f..fcc0d8107a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderValidatorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailSenderValidatorAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.mail; -import javax.mail.MessagingException; +import jakarta.mail.MessagingException; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/EntityManagerFactoryDependsOnPostProcessor.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/EntityManagerFactoryDependsOnPostProcessor.java index c09faf7649..971fd6d95d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/EntityManagerFactoryDependsOnPostProcessor.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/EntityManagerFactoryDependsOnPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.orm.jpa; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java index d6532819e1..0e6b456541 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.orm.jpa; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import org.hibernate.engine.spi.SessionImplementor; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java index 994e33d359..aa46da1258 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java @@ -137,7 +137,7 @@ public class HibernateProperties { if (this.ddlAuto != null) { return this.ddlAuto; } - if (existing.get(AvailableSettings.HBM2DDL_DATABASE_ACTION) != null) { + if (existing.get(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION) != null) { return null; } return defaultDdlAuto.get(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java index 8526773988..df8dcec1a4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java @@ -19,9 +19,10 @@ package org.springframework.boot.autoconfigure.orm.jpa; import java.util.List; import java.util.Map; -import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; +import jakarta.persistence.EntityManagerFactory; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/ErrorPageSecurityFilterConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/ErrorPageSecurityFilterConfiguration.java index 6d30323942..b8b6087368 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/ErrorPageSecurityFilterConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/ErrorPageSecurityFilterConfiguration.java @@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.security.servlet; import java.util.EnumSet; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfiguration.java index 1e8228b9ba..e2d5f0e549 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.security.servlet; import java.util.EnumSet; import java.util.stream.Collectors; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java index c6f38ed14c..09f060cd19 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.boot.autoconfigure.security.StaticResourceLocation; import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.java index 973a81d411..b65cb9e937 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.session; import java.util.EnumSet; import java.util.stream.Collectors; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JndiJtaConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JndiJtaConfiguration.java index cc9f6325a8..91b59dd02a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JndiJtaConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JndiJtaConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -23,7 +23,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.transaction.config.JtaTransactionManagerFactoryBean; import org.springframework.transaction.jta.JtaTransactionManager; /** @@ -43,7 +42,7 @@ class JndiJtaConfiguration { @Bean JtaTransactionManager transactionManager( ObjectProvider transactionManagerCustomizers) { - JtaTransactionManager jtaTransactionManager = new JtaTransactionManagerFactoryBean().getObject(); + JtaTransactionManager jtaTransactionManager = new JtaTransactionManager(); transactionManagerCustomizers.ifAvailable((customizers) -> customizers.customize(jtaTransactionManager)); return jtaTransactionManager; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfiguration.java index cbcd6aa70f..3bd1853f74 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfiguration.java @@ -34,7 +34,7 @@ import org.springframework.context.annotation.Import; * @since 1.2.0 */ @Configuration(proxyBeanMethods = false) -@ConditionalOnClass(javax.transaction.Transaction.class) +@ConditionalOnClass(jakarta.transaction.Transaction.class) @ConditionalOnProperty(prefix = "spring.jta", value = "enabled", matchIfMissing = true) @AutoConfigureBefore({ XADataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class }) @Import(JndiJtaConfiguration.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/PrimaryDefaultValidatorPostProcessor.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/PrimaryDefaultValidatorPostProcessor.java index 7fbafabf20..db9eabcd29 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/PrimaryDefaultValidatorPostProcessor.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/PrimaryDefaultValidatorPostProcessor.java @@ -31,7 +31,7 @@ import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; * Enable the {@code Primary} flag on the auto-configured validator if necessary. *

* As {@link LocalValidatorFactoryBean} exposes 3 validator related contracts and we're - * only checking for the absence {@link javax.validation.Validator}, we should flag the + * only checking for the absence {@link jakarta.validation.Validator}, we should flag the * auto-configured validator as primary only if no Spring's {@link Validator} is flagged * as primary. * diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.java index 034170ca7d..252b38f0bc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.java @@ -16,8 +16,8 @@ package org.springframework.boot.autoconfigure.validation; -import javax.validation.Validator; -import javax.validation.executable.ExecutableValidator; +import jakarta.validation.Validator; +import jakarta.validation.executable.ExecutableValidator; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.config.BeanDefinition; @@ -49,7 +49,7 @@ import org.springframework.validation.beanvalidation.MethodValidationPostProcess */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(ExecutableValidator.class) -@ConditionalOnResource(resources = "classpath:META-INF/services/javax.validation.spi.ValidationProvider") +@ConditionalOnResource(resources = "classpath:META-INF/services/jakarta.validation.spi.ValidationProvider") @Import(PrimaryDefaultValidatorPostProcessor.class) public class ValidationAutoConfiguration { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapter.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapter.java index dae7346039..8a3ecb95f1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapter.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapter.java @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.validation; -import javax.validation.ValidationException; +import jakarta.validation.ValidationException; import org.springframework.beans.BeansException; import org.springframework.beans.factory.DisposableBean; @@ -97,7 +97,7 @@ public class ValidatorAdapter implements SmartValidator, ApplicationContextAware * wrapping it if necessary. *

* If the specified {@link Validator} is not {@code null}, it is wrapped. If not, a - * {@link javax.validation.Validator} is retrieved from the context and wrapped. + * {@link jakarta.validation.Validator} is retrieved from the context and wrapped. * Otherwise, a new default validator is created. * @param applicationContext the application context * @param validator an existing validator to use or {@code null} @@ -120,7 +120,7 @@ public class ValidatorAdapter implements SmartValidator, ApplicationContextAware private static Validator getExisting(ApplicationContext applicationContext) { try { - javax.validation.Validator validator = applicationContext.getBean(javax.validation.Validator.class); + jakarta.validation.Validator validator = applicationContext.getBean(jakarta.validation.Validator.class); if (validator instanceof Validator) { return (Validator) validator; } @@ -144,11 +144,11 @@ public class ValidatorAdapter implements SmartValidator, ApplicationContextAware } private static Validator wrap(Validator validator, boolean existingBean) { - if (validator instanceof javax.validation.Validator) { + if (validator instanceof jakarta.validation.Validator) { if (validator instanceof SpringValidatorAdapter) { return new ValidatorAdapter((SpringValidatorAdapter) validator, existingBean); } - return new ValidatorAdapter(new SpringValidatorAdapter((javax.validation.Validator) validator), + return new ValidatorAdapter(new SpringValidatorAdapter((jakarta.validation.Validator) validator), existingBean); } return validator; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java index b8df080f24..f7d86f0374 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java @@ -267,7 +267,7 @@ public class WebFluxAutoConfiguration { @Bean @Override public Validator webFluxValidator() { - if (!ClassUtils.isPresent("javax.validation.Validator", getClass().getClassLoader())) { + if (!ClassUtils.isPresent("jakarta.validation.Validator", getClass().getClassLoader())) { return super.webFluxValidator(); } return ValidatorAdapter.get(getApplicationContext(), getValidator()); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java index 5cb3291fc3..31700ef12d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java @@ -345,13 +345,13 @@ public abstract class AbstractErrorWebExceptionHandler implements ErrorWebExcept private String formatError(Throwable ex, ServerRequest request) { String reason = ex.getClass().getSimpleName() + ": " + ex.getMessage(); - return "Resolved [" + reason + "] for HTTP " + request.methodName() + " " + request.path(); + return "Resolved [" + reason + "] for HTTP " + request.method() + " " + request.path(); } private String formatRequest(ServerRequest request) { String rawQuery = request.uri().getRawQuery(); String query = StringUtils.hasText(rawQuery) ? "?" + rawQuery : ""; - return "HTTP " + request.methodName() + " \"" + request.path() + query + "\""; + return "HTTP " + request.method() + " \"" + request.path() + query + "\""; } private Mono write(ServerWebExchange exchange, ServerResponse response) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java index 01c4da841d..9fd92b851f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java @@ -35,6 +35,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.http.HttpStatus; import org.springframework.http.InvalidMediaTypeException; import org.springframework.http.MediaType; +import org.springframework.util.MimeTypeUtils; import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.server.RequestPredicate; import org.springframework.web.reactive.function.server.RouterFunction; @@ -237,7 +238,7 @@ public class DefaultErrorWebExceptionHandler extends AbstractErrorWebExceptionHa try { List acceptedMediaTypes = serverRequest.headers().accept(); acceptedMediaTypes.removeIf(MediaType.ALL::equalsTypeAndSubtype); - MediaType.sortBySpecificityAndQuality(acceptedMediaTypes); + MimeTypeUtils.sortBySpecificity(acceptedMediaTypes); return acceptedMediaTypes.stream().anyMatch(MediaType.TEXT_HTML::isCompatibleWith); } catch (InvalidMediaTypeException ex) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorConfiguration.java index 7e65578a57..c6de185c26 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorConfiguration.java @@ -19,6 +19,8 @@ package org.springframework.boot.autoconfigure.web.reactive.function.client; import org.apache.hc.client5.http.impl.async.HttpAsyncClients; import org.apache.hc.core5.http.nio.AsyncRequestProducer; import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.http.HttpClientTransportOverHTTP; +import org.eclipse.jetty.io.ClientConnector; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.springframework.beans.factory.ObjectProvider; @@ -82,8 +84,11 @@ class ClientHttpConnectorConfiguration { @Bean @Lazy JettyClientHttpConnector jettyClientHttpConnector(JettyResourceFactory jettyResourceFactory) { - SslContextFactory sslContextFactory = new SslContextFactory.Client(); - HttpClient httpClient = new HttpClient(sslContextFactory); + SslContextFactory.Client sslContextFactory = new SslContextFactory.Client(); + ClientConnector connector = new ClientConnector(); + connector.setSslContextFactory(sslContextFactory); + HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(connector); + HttpClient httpClient = new HttpClient(transport); return new JettyClientHttpConnector(httpClient, jettyResourceFactory); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java index d7f9d6ebb0..633d85ac91 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -22,7 +22,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.springframework.beans.factory.BeanFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java index 721cbb9f13..da059ecb7f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -19,8 +19,8 @@ package org.springframework.boot.autoconfigure.web.servlet; import java.util.Arrays; import java.util.List; -import javax.servlet.MultipartConfigElement; -import javax.servlet.ServletRegistration; +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.ServletRegistration; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfiguration.java index d2b52049f4..774ae767e9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.autoconfigure.web.servlet; -import javax.servlet.MultipartConfigElement; -import javax.servlet.Servlet; +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.Servlet; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -36,11 +36,11 @@ import org.springframework.web.servlet.DispatcherServlet; /** * {@link EnableAutoConfiguration Auto-configuration} for multi-part uploads. Adds a * {@link StandardServletMultipartResolver} if none is present, and adds a - * {@link javax.servlet.MultipartConfigElement multipartConfigElement} if none is + * {@link jakarta.servlet.MultipartConfigElement multipartConfigElement} if none is * otherwise defined. The {@link ServletWebServerApplicationContext} will associate the * {@link MultipartConfigElement} bean to any {@link Servlet} beans. *

- * The {@link javax.servlet.MultipartConfigElement} is a Servlet API that's used to + * The {@link jakarta.servlet.MultipartConfigElement} is a Servlet API that's used to * configure how the server handles file uploads. * * @author Greg Turnquist diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartProperties.java index 69e4d73d3a..1388ae73bb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.web.servlet; -import javax.servlet.MultipartConfigElement; +import jakarta.servlet.MultipartConfigElement; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.PropertyMapper; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration.java index 8d38dc1c93..219356d44b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration.java @@ -19,8 +19,8 @@ package org.springframework.boot.autoconfigure.web.servlet; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.servlet.DispatcherType; -import javax.servlet.ServletRequest; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletRequest; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryConfiguration.java index 13a6c6a3ea..618aad8b46 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.web.servlet; import java.util.stream.Collectors; -import javax.servlet.Servlet; +import jakarta.servlet.Servlet; import io.undertow.Undertow; import org.apache.catalina.startup.Tomcat; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java index 114204bf0c..41c5ecbbe2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java @@ -22,8 +22,8 @@ import java.util.ListIterator; import java.util.Map; import java.util.function.Consumer; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -526,7 +526,7 @@ public class WebMvcAutoConfiguration { @Bean @Override public Validator mvcValidator() { - if (!ClassUtils.isPresent("javax.validation.Validator", getClass().getClassLoader())) { + if (!ClassUtils.isPresent("jakarta.validation.Validator", getClass().getClassLoader())) { return super.mvcValidator(); } return ValidatorAdapter.get(getApplicationContext(), getValidator()); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMapping.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMapping.java index 2f33cbb3e9..99df8b55b9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMapping.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMapping.java @@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.web.servlet; import java.util.Collections; import java.util.List; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/AbstractErrorController.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/AbstractErrorController.java index 9e00a0944e..4777a492d6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/AbstractErrorController.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/AbstractErrorController.java @@ -20,9 +20,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import javax.servlet.RequestDispatcher; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.web.error.ErrorAttributeOptions; import org.springframework.boot.web.servlet.error.ErrorAttributes; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java index d9d0bb052a..27d6bf9dbd 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java @@ -20,8 +20,8 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.autoconfigure.web.ErrorProperties; import org.springframework.boot.web.error.ErrorAttributeOptions; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java index d91989108d..ee8cd286d4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java @@ -20,8 +20,8 @@ import java.util.Collections; import java.util.EnumMap; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider; import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java index 07a2699aa8..3582e422d4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java @@ -20,9 +20,9 @@ import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.stream.Collectors; -import javax.servlet.Servlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Servlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorViewResolver.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorViewResolver.java index bc84e5d0f9..299c482cb1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorViewResolver.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorViewResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.web.servlet.error; import java.util.Map; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.http.HttpStatus; import org.springframework.web.servlet.ModelAndView; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/reactive/WebSocketReactiveAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/reactive/WebSocketReactiveAutoConfiguration.java index f453a14772..4fb910f31d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/reactive/WebSocketReactiveAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/reactive/WebSocketReactiveAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.autoconfigure.websocket.reactive; -import javax.servlet.Servlet; -import javax.websocket.server.ServerContainer; +import jakarta.servlet.Servlet; +import jakarta.websocket.server.ServerContainer; import org.apache.catalina.startup.Tomcat; import org.apache.tomcat.websocket.server.WsSci; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/Jetty10WebSocketServletWebServerCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/Jetty10WebSocketServletWebServerCustomizer.java deleted file mode 100644 index c378d6683d..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/Jetty10WebSocketServletWebServerCustomizer.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2012-2021 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.autoconfigure.websocket.servlet; - -import java.lang.reflect.Method; - -import javax.servlet.ServletContext; - -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.webapp.AbstractConfiguration; -import org.eclipse.jetty.webapp.WebAppContext; - -import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; -import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.core.Ordered; -import org.springframework.util.ClassUtils; -import org.springframework.util.ReflectionUtils; - -/** - * WebSocket customizer for {@link JettyServletWebServerFactory} with Jetty 10. - * - * @author Andy Wilkinson - */ -class Jetty10WebSocketServletWebServerCustomizer - implements WebServerFactoryCustomizer, Ordered { - - static final String JETTY_WEB_SOCKET_SERVER_CONTAINER = "org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer"; - - static final String JAVAX_WEB_SOCKET_SERVER_CONTAINER = "org.eclipse.jetty.websocket.javax.server.internal.JavaxWebSocketServerContainer"; - - @Override - public void customize(JettyServletWebServerFactory factory) { - factory.addConfigurations(new AbstractConfiguration() { - - @Override - public void configure(WebAppContext context) throws Exception { - ServletContext servletContext = context.getServletContext(); - Class jettyContainer = ClassUtils.forName(JETTY_WEB_SOCKET_SERVER_CONTAINER, null); - Method getJettyContainer = ReflectionUtils.findMethod(jettyContainer, "getContainer", - ServletContext.class); - Server server = context.getServer(); - if (ReflectionUtils.invokeMethod(getJettyContainer, null, servletContext) == null) { - ensureWebSocketComponents(server, servletContext); - ensureContainer(jettyContainer, servletContext); - } - Class javaxContainer = ClassUtils.forName(JAVAX_WEB_SOCKET_SERVER_CONTAINER, null); - Method getJavaxContainer = ReflectionUtils.findMethod(javaxContainer, "getContainer", - ServletContext.class); - if (ReflectionUtils.invokeMethod(getJavaxContainer, "getContainer", servletContext) == null) { - ensureWebSocketComponents(server, servletContext); - ensureUpgradeFilter(servletContext); - ensureMappings(servletContext); - ensureContainer(javaxContainer, servletContext); - } - } - - private void ensureWebSocketComponents(Server server, ServletContext servletContext) - throws ClassNotFoundException { - Class webSocketServerComponents = ClassUtils - .forName("org.eclipse.jetty.websocket.core.server.WebSocketServerComponents", null); - Method ensureWebSocketComponents = ReflectionUtils.findMethod(webSocketServerComponents, - "ensureWebSocketComponents", Server.class, ServletContext.class); - ReflectionUtils.invokeMethod(ensureWebSocketComponents, null, server, servletContext); - } - - private void ensureContainer(Class container, ServletContext servletContext) - throws ClassNotFoundException { - Method ensureContainer = ReflectionUtils.findMethod(container, "ensureContainer", ServletContext.class); - ReflectionUtils.invokeMethod(ensureContainer, null, servletContext); - } - - private void ensureUpgradeFilter(ServletContext servletContext) throws ClassNotFoundException { - Class webSocketUpgradeFilter = ClassUtils - .forName("org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter", null); - Method ensureFilter = ReflectionUtils.findMethod(webSocketUpgradeFilter, "ensureFilter", - ServletContext.class); - ReflectionUtils.invokeMethod(ensureFilter, null, servletContext); - } - - private void ensureMappings(ServletContext servletContext) throws ClassNotFoundException { - Class webSocketMappings = ClassUtils - .forName("org.eclipse.jetty.websocket.core.server.WebSocketMappings", null); - Method ensureMappings = ReflectionUtils.findMethod(webSocketMappings, "ensureMappings", - ServletContext.class); - ReflectionUtils.invokeMethod(ensureMappings, null, servletContext); - } - - }); - } - - @Override - public int getOrder() { - return 0; - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/JettyWebSocketServletWebServerCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/JettyWebSocketServletWebServerCustomizer.java index 6b057b0714..8ee41bc966 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/JettyWebSocketServletWebServerCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/JettyWebSocketServletWebServerCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,11 +16,13 @@ package org.springframework.boot.autoconfigure.websocket.servlet; -import org.eclipse.jetty.util.thread.ShutdownThread; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.WebAppContext; -import org.eclipse.jetty.websocket.jsr356.server.ServerContainer; -import org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer; +import org.eclipse.jetty.websocket.core.server.WebSocketMappings; +import org.eclipse.jetty.websocket.core.server.WebSocketServerComponents; +import org.eclipse.jetty.websocket.jakarta.server.internal.JakartaWebSocketServerContainer; +import org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer; +import org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter; import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; @@ -43,8 +45,18 @@ public class JettyWebSocketServletWebServerCustomizer @Override public void configure(WebAppContext context) throws Exception { - ServerContainer serverContainer = WebSocketServerContainerInitializer.initialize(context); - ShutdownThread.deregister(serverContainer); + if (JettyWebSocketServerContainer.getContainer(context.getServletContext()) == null) { + WebSocketServerComponents.ensureWebSocketComponents(context.getServer(), + context.getServletContext()); + JettyWebSocketServerContainer.ensureContainer(context.getServletContext()); + } + if (JakartaWebSocketServerContainer.getContainer(context.getServletContext()) == null) { + WebSocketServerComponents.ensureWebSocketComponents(context.getServer(), + context.getServletContext()); + WebSocketUpgradeFilter.ensureFilter(context.getServletContext()); + WebSocketMappings.ensureMappings(context.getServletContext()); + JakartaWebSocketServerContainer.ensureContainer(context.getServletContext()); + } } }); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfiguration.java index 70f0d2bf4e..500d50e7f7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfiguration.java @@ -16,12 +16,12 @@ package org.springframework.boot.autoconfigure.websocket.servlet; -import javax.servlet.Servlet; -import javax.websocket.server.ServerContainer; +import jakarta.servlet.Servlet; +import jakarta.websocket.server.ServerContainer; import org.apache.catalina.startup.Tomcat; import org.apache.tomcat.websocket.server.WsSci; -import org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer; +import org.eclipse.jetty.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -72,7 +72,7 @@ public class WebSocketServletAutoConfiguration { } @Configuration(proxyBeanMethods = false) - @ConditionalOnClass(WebSocketServerContainerInitializer.class) + @ConditionalOnClass(JakartaWebSocketServletContainerInitializer.class) static class JettyWebSocketConfiguration { @Bean @@ -83,19 +83,6 @@ public class WebSocketServletAutoConfiguration { } - @Configuration(proxyBeanMethods = false) - @ConditionalOnClass(name = { Jetty10WebSocketServletWebServerCustomizer.JAVAX_WEB_SOCKET_SERVER_CONTAINER, - Jetty10WebSocketServletWebServerCustomizer.JETTY_WEB_SOCKET_SERVER_CONTAINER }) - static class Jetty10WebSocketConfiguration { - - @Bean - @ConditionalOnMissingBean(name = "websocketServletWebServerCustomizer") - Jetty10WebSocketServletWebServerCustomizer websocketServletWebServerCustomizer() { - return new Jetty10WebSocketServletWebServerCustomizer(); - } - - } - @Configuration(proxyBeanMethods = false) @ConditionalOnClass(io.undertow.websockets.jsr.Bootstrap.class) static class UndertowWebSocketConfiguration { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 605f790cb2..affb207943 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -2008,7 +2008,7 @@ { "name": "class-reference", "parameters": { - "target": "javax.servlet.http.HttpServlet" + "target": "jakarta.servlet.http.HttpServlet" } } ] diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java index ae6b398eb8..4769602b5f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java @@ -19,9 +19,10 @@ package org.springframework.boot.autoconfigure.batch; import java.util.Collection; import java.util.Collections; -import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; +import jakarta.persistence.EntityManagerFactory; + import org.junit.jupiter.api.Test; import org.springframework.batch.core.BatchStatus; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReportTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReportTests.java index 2a627c33c9..0852834736 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReportTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -198,8 +198,8 @@ class ConditionEvaluationReportTests { messages.add(outcome.getOutcome().getMessage()); } assertThat(messages).anyMatch((message) -> message.contains("@ConditionalOnClass found required classes " - + "'javax.servlet.Servlet', 'org.springframework.web.multipart." - + "support.StandardServletMultipartResolver', 'javax.servlet.MultipartConfigElement'")); + + "'jakarta.servlet.Servlet', 'org.springframework.web.multipart." + + "support.StandardServletMultipartResolver', 'jakarta.servlet.MultipartConfigElement'")); context.close(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfigurationTests.java index c3ef53ba17..c8bb6a2476 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfigurationTests.java @@ -18,8 +18,8 @@ package org.springframework.boot.autoconfigure.dao; import java.util.Map; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java index 794f856ea0..bcbfe58f82 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java @@ -32,8 +32,8 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.converter.Converter; -import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; -import org.springframework.data.elasticsearch.core.ReactiveElasticsearchTemplate; +import org.springframework.data.elasticsearch.backend.elasticsearch7.ElasticsearchRestTemplate; +import org.springframework.data.elasticsearch.backend.elasticsearch7.ReactiveElasticsearchTemplate; import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; import org.springframework.data.elasticsearch.core.convert.ElasticsearchCustomConversions; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesAutoConfigurationTests.java index 1268b14d11..d24d923c5f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -33,7 +33,7 @@ import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestCli import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.testsupport.testcontainers.DockerImageNames; import org.springframework.context.annotation.Configuration; -import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; +import org.springframework.data.elasticsearch.backend.elasticsearch7.ElasticsearchRestTemplate; import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesAutoConfigurationTests.java index e6eddf64e3..673480a130 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesAutoConfigurationTests.java @@ -32,7 +32,7 @@ import org.springframework.boot.autoconfigure.data.empty.EmptyDataPackage; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.testsupport.testcontainers.DockerImageNames; import org.springframework.context.annotation.Configuration; -import org.springframework.data.elasticsearch.core.ReactiveElasticsearchTemplate; +import org.springframework.data.elasticsearch.backend.elasticsearch7.ReactiveElasticsearchTemplate; import org.springframework.data.elasticsearch.repository.config.EnableReactiveElasticsearchRepositories; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java index 6a651b85a5..0069f7e3e3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java @@ -31,7 +31,7 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.testsupport.testcontainers.DockerImageNames; -import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient; +import org.springframework.data.elasticsearch.backend.elasticsearch7.client.reactive.ReactiveElasticsearchClient; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationTests.java index b0f0a7f31a..05b4560e6d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationTests.java @@ -35,9 +35,9 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.data.elasticsearch.backend.elasticsearch7.client.reactive.ReactiveElasticsearchClient; import org.springframework.data.elasticsearch.client.ClientConfiguration; import org.springframework.data.elasticsearch.client.ClientConfiguration.ClientConfigurationCallback; -import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient; import org.springframework.data.elasticsearch.client.reactive.ReactiveRestClients; import org.springframework.http.HttpHeaders; import org.springframework.http.codec.CodecConfigurer.DefaultCodecConfig; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/AbstractJpaRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/AbstractJpaRepositoriesAutoConfigurationTests.java index 8c529abea5..0c6f24b0d8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/AbstractJpaRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/AbstractJpaRepositoriesAutoConfigurationTests.java @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.data.jpa; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/city/City.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/city/City.java index e402ffc5c7..11995484ea 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/city/City.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/city/City.java @@ -18,10 +18,10 @@ package org.springframework.boot.autoconfigure.data.jpa.city; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; @Entity public class City implements Serializable { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/country/Country.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/country/Country.java index 878ed9aa13..5b1d3239f2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/country/Country.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jpa/country/Country.java @@ -18,10 +18,10 @@ package org.springframework.boot.autoconfigure.data.jpa.country; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; import org.hibernate.envers.Audited; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/city/City.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/city/City.java index 9afe5813ae..1e4aeb697c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/city/City.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/city/City.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,9 @@ package org.springframework.boot.autoconfigure.data.mongo.city; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Column; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; import org.springframework.data.mongodb.core.mapping.Document; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/country/Country.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/country/Country.java index 3a4e143e1e..6880b8f7f9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/country/Country.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/country/Country.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,9 @@ package org.springframework.boot.autoconfigure.data.mongo.country; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Column; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; import org.springframework.data.mongodb.core.mapping.Document; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfigurationTests.java index c5b46119ea..5e8fbbc845 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfigurationTests.java @@ -17,6 +17,7 @@ package org.springframework.boot.autoconfigure.data.neo4j; import org.junit.jupiter.api.Test; +import org.neo4j.driver.Driver; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage; @@ -108,7 +109,7 @@ class Neo4jDataAutoConfigurationTests { @Test void shouldReuseExistingNeo4jClient() { - this.contextRunner.withBean("myCustomClient", Neo4jClient.class, () -> mock(Neo4jClient.class)) + this.contextRunner.withUserConfiguration(Neo4jClientConfig.class) .run((context) -> assertThat(context).hasSingleBean(Neo4jClient.class).hasBean("myCustomClient")); } @@ -176,4 +177,14 @@ class Neo4jDataAutoConfigurationTests { } + @Configuration(proxyBeanMethods = false) + static class Neo4jClientConfig { + + @Bean + Neo4jClient myCustomClient(Driver driver) { + return Neo4jClient.create(driver); + } + + } + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveDataAutoConfigurationTests.java index e04690355f..c0d9891ff4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveDataAutoConfigurationTests.java @@ -17,6 +17,7 @@ package org.springframework.boot.autoconfigure.data.neo4j; import org.junit.jupiter.api.Test; +import org.neo4j.driver.Driver; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -103,10 +104,8 @@ class Neo4jReactiveDataAutoConfigurationTests { @Test void shouldReuseExistingReactiveNeo4jClient() { - this.contextRunner - .withBean("myCustomReactiveClient", ReactiveNeo4jClient.class, () -> mock(ReactiveNeo4jClient.class)) - .run((context) -> assertThat(context).hasSingleBean(ReactiveNeo4jClient.class) - .hasBean("myCustomReactiveClient")); + this.contextRunner.withUserConfiguration(ReactiveNeo4jClientConfig.class).run((context) -> assertThat(context) + .hasSingleBean(ReactiveNeo4jClient.class).hasBean("myCustomReactiveClient")); } @Test @@ -160,4 +159,14 @@ class Neo4jReactiveDataAutoConfigurationTests { } + @Configuration(proxyBeanMethods = false) + static class ReactiveNeo4jClientConfig { + + @Bean + ReactiveNeo4jClient myCustomReactiveClient(Driver driver) { + return ReactiveNeo4jClient.create(driver); + } + + } + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScannerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScannerTests.java index 36c2cc3160..e0a60aecb5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScannerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScannerTests.java @@ -19,8 +19,8 @@ package org.springframework.boot.autoconfigure.domain; import java.util.Collections; import java.util.Set; -import javax.persistence.Embeddable; -import javax.persistence.Entity; +import jakarta.persistence.Embeddable; +import jakarta.persistence.Entity; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/a/EmbeddableA.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/a/EmbeddableA.java index 0a6c87f77b..f55a53436b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/a/EmbeddableA.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/a/EmbeddableA.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.domain.scan.a; -import javax.persistence.Embeddable; +import jakarta.persistence.Embeddable; @Embeddable public class EmbeddableA { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/a/EntityA.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/a/EntityA.java index 8fc8027277..c4763f95fc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/a/EntityA.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/a/EntityA.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.domain.scan.a; -import javax.persistence.Entity; +import jakarta.persistence.Entity; @Entity public class EntityA { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/b/EmbeddableB.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/b/EmbeddableB.java index 4fe84a9639..0ca02e0aca 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/b/EmbeddableB.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/b/EmbeddableB.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.domain.scan.b; -import javax.persistence.Embeddable; +import jakarta.persistence.Embeddable; @Embeddable public class EmbeddableB { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/b/EntityB.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/b/EntityB.java index 3bc659b53c..c38cce72f1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/b/EntityB.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/b/EntityB.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.domain.scan.b; -import javax.persistence.Entity; +import jakarta.persistence.Entity; @Entity public class EntityB { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/c/EmbeddableC.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/c/EmbeddableC.java index c7ee19f993..5a72780f1d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/c/EmbeddableC.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/c/EmbeddableC.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.domain.scan.c; -import javax.persistence.Embeddable; +import jakarta.persistence.Embeddable; @Embeddable public class EmbeddableC { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/c/EntityC.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/c/EntityC.java index 97ea1c0b37..2b494cff15 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/c/EntityC.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/scan/c/EntityC.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.domain.scan.c; -import javax.persistence.Entity; +import jakarta.persistence.Entity; @Entity public class EntityC { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationServletIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationServletIntegrationTests.java index e9f6b21f18..b7f31644a4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationServletIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationServletIntegrationTests.java @@ -21,8 +21,8 @@ import java.util.EnumSet; import java.util.Locale; import java.util.Map; -import javax.servlet.DispatcherType; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAutoConfigurationTests.java index 46811b2af9..d01927d23c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -23,7 +23,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Locale; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import groovy.text.markup.MarkupTemplateEngine; import org.junit.jupiter.api.AfterEach; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java index 7851b1a0d4..7219feb4b5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.http; import java.nio.charset.StandardCharsets; -import javax.json.bind.Jsonb; +import jakarta.json.bind.Jsonb; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java index a5908d080f..efe991359a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java @@ -18,9 +18,9 @@ package org.springframework.boot.autoconfigure.jms; import java.io.IOException; -import javax.jms.ConnectionFactory; -import javax.jms.ExceptionListener; -import javax.jms.Session; +import jakarta.jms.ConnectionFactory; +import jakarta.jms.ExceptionListener; +import jakarta.jms.Session; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfigurationTests.java index 84f9a95543..2d31fb8696 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,10 @@ package org.springframework.boot.autoconfigure.jms; -import javax.jms.ConnectionFactory; import javax.naming.Context; +import jakarta.jms.ConnectionFactory; + import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationTests.java index cf17fc37db..d385ffe73f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.jsonb; -import javax.json.bind.Jsonb; +import jakarta.json.bind.Jsonb; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationWithNoProviderTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationWithNoProviderTests.java index 6dd367089c..7b5fecadc1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationWithNoProviderTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationWithNoProviderTests.java @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.jsonb; -import javax.json.bind.Jsonb; +import jakarta.json.bind.Jsonb; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfigurationTests.java index b8eede2a23..b1b84b7798 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfigurationTests.java @@ -18,9 +18,10 @@ package org.springframework.boot.autoconfigure.mail; import java.util.Properties; -import javax.mail.Session; import javax.naming.Context; +import jakarta.mail.Session; + import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/AbstractJpaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/AbstractJpaAutoConfigurationTests.java index 64408fb98e..a48f225721 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/AbstractJpaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/AbstractJpaAutoConfigurationTests.java @@ -21,10 +21,11 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; -import javax.persistence.EntityManagerFactory; -import javax.persistence.spi.PersistenceUnitInfo; import javax.sql.DataSource; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.spi.PersistenceUnitInfo; + import org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java index 159327068a..838025dbc7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java @@ -28,13 +28,14 @@ import java.util.List; import java.util.Map; import java.util.function.Consumer; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; -import javax.transaction.Synchronization; -import javax.transaction.Transaction; -import javax.transaction.TransactionManager; -import javax.transaction.UserTransaction; + +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.transaction.Synchronization; +import jakarta.transaction.Transaction; +import jakarta.transaction.TransactionManager; +import jakarta.transaction.UserTransaction; import com.zaxxer.hikari.HikariDataSource; import org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy; @@ -404,7 +405,7 @@ class HibernateJpaAutoConfigurationTests extends AbstractJpaAutoConfigurationTes @Test void vendorPropertiesWithEmbeddedDatabaseAndNoDdlProperty() { contextRunner().run(vendorProperties((vendorProperties) -> { - assertThat(vendorProperties).doesNotContainKeys(AvailableSettings.HBM2DDL_DATABASE_ACTION); + assertThat(vendorProperties).doesNotContainKeys(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION); assertThat(vendorProperties.get(AvailableSettings.HBM2DDL_AUTO)).isEqualTo("create-drop"); })); } @@ -413,7 +414,7 @@ class HibernateJpaAutoConfigurationTests extends AbstractJpaAutoConfigurationTes void vendorPropertiesWhenDdlAutoPropertyIsSet() { contextRunner().withPropertyValues("spring.jpa.hibernate.ddl-auto=update") .run(vendorProperties((vendorProperties) -> { - assertThat(vendorProperties).doesNotContainKeys(AvailableSettings.HBM2DDL_DATABASE_ACTION); + assertThat(vendorProperties).doesNotContainKeys(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION); assertThat(vendorProperties.get(AvailableSettings.HBM2DDL_AUTO)).isEqualTo("update"); })); } @@ -424,7 +425,7 @@ class HibernateJpaAutoConfigurationTests extends AbstractJpaAutoConfigurationTes .withPropertyValues("spring.jpa.hibernate.ddl-auto=update", "spring.jpa.properties.hibernate.hbm2ddl.auto=create-drop") .run(vendorProperties((vendorProperties) -> { - assertThat(vendorProperties).doesNotContainKeys(AvailableSettings.HBM2DDL_DATABASE_ACTION); + assertThat(vendorProperties).doesNotContainKeys(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION); assertThat(vendorProperties.get(AvailableSettings.HBM2DDL_AUTO)).isEqualTo("create-drop"); })); } @@ -433,26 +434,28 @@ class HibernateJpaAutoConfigurationTests extends AbstractJpaAutoConfigurationTes void vendorPropertiesWhenDdlAutoPropertyIsSetToNone() { contextRunner().withPropertyValues("spring.jpa.hibernate.ddl-auto=none") .run(vendorProperties((vendorProperties) -> assertThat(vendorProperties).doesNotContainKeys( - AvailableSettings.HBM2DDL_DATABASE_ACTION, AvailableSettings.HBM2DDL_AUTO))); + AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, AvailableSettings.HBM2DDL_AUTO))); } @Test void vendorPropertiesWhenJpaDdlActionIsSet() { contextRunner() - .withPropertyValues("spring.jpa.properties.javax.persistence.schema-generation.database.action=create") + .withPropertyValues( + "spring.jpa.properties.jakarta.persistence.schema-generation.database.action=create") .run(vendorProperties((vendorProperties) -> { - assertThat(vendorProperties.get(AvailableSettings.HBM2DDL_DATABASE_ACTION)).isEqualTo("create"); + assertThat(vendorProperties.get(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION)) + .isEqualTo("create"); assertThat(vendorProperties).doesNotContainKeys(AvailableSettings.HBM2DDL_AUTO); })); } @Test void vendorPropertiesWhenBothDdlAutoPropertiesAreSet() { - contextRunner() - .withPropertyValues("spring.jpa.properties.javax.persistence.schema-generation.database.action=create", - "spring.jpa.hibernate.ddl-auto=create-only") - .run(vendorProperties((vendorProperties) -> { - assertThat(vendorProperties.get(AvailableSettings.HBM2DDL_DATABASE_ACTION)).isEqualTo("create"); + contextRunner().withPropertyValues( + "spring.jpa.properties.jakarta.persistence.schema-generation.database.action=create", + "spring.jpa.hibernate.ddl-auto=create-only").run(vendorProperties((vendorProperties) -> { + assertThat(vendorProperties.get(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION)) + .isEqualTo("create"); assertThat(vendorProperties.get(AvailableSettings.HBM2DDL_AUTO)).isEqualTo("create-only"); })); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernatePropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernatePropertiesTests.java index f33dc26f63..3abb541254 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernatePropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernatePropertiesTests.java @@ -136,10 +136,10 @@ class HibernatePropertiesTests { void defaultDdlAutoIsNotInvokedAndDdlAutoIsNotSetIfJpaDbActionPropertyIsSet() { this.contextRunner .withPropertyValues( - "spring.jpa.properties.javax.persistence.schema-generation.database.action=drop-and-create") + "spring.jpa.properties.jakarta.persistence.schema-generation.database.action=drop-and-create") .run(assertHibernateProperties((hibernateProperties) -> { assertThat(hibernateProperties).doesNotContainKey(AvailableSettings.HBM2DDL_AUTO); - assertThat(hibernateProperties).containsEntry(AvailableSettings.HBM2DDL_DATABASE_ACTION, + assertThat(hibernateProperties).containsEntry(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "drop-and-create"); verify(this.ddlAutoSupplier, never()).get(); })); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/test/City.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/test/City.java index 6c3bee8f23..b671c5321a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/test/City.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/test/City.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,11 +18,11 @@ package org.springframework.boot.autoconfigure.orm.jpa.test; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityListeners; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; @Entity @EntityListeners(CityListener.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/test/CityListener.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/test/CityListener.java index 8eb7e8627f..017bccb509 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/test/CityListener.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/test/CityListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.orm.jpa.test; -import javax.persistence.PostLoad; +import jakarta.persistence.PostLoad; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.ConfigurableBeanFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2WebSecurityConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2WebSecurityConfigurationTests.java index 338c828707..3c64d4494d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2WebSecurityConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2WebSecurityConfigurationTests.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java index e0a2beb503..7c9ab28b4c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java @@ -23,7 +23,7 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java index da95d63082..c64da4c2c6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java @@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.security.saml2; import java.io.InputStream; import java.util.List; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityAutoConfigurationTests.java index fefae03f93..6df48a9f9d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityAutoConfigurationTests.java @@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.security.servlet; import java.security.interfaces.RSAPublicKey; import java.util.EnumSet; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import org.assertj.core.api.InstanceOfAssertFactories; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java index 26babb807d..7ed4ad79d9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.security.servlet; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.assertj.core.api.AssertDelegateTarget; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/user/User.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/user/User.java index f71868d8ff..94a5e3aac6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/user/User.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/user/User.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,9 @@ package org.springframework.boot.autoconfigure.security.user; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; @Entity public class User { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationHazelcast3Tests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationHazelcast3Tests.java deleted file mode 100644 index dad6a1251c..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationHazelcast3Tests.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2012-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.autoconfigure.session; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; -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.testsupport.classpath.ClassPathExclusions; -import org.springframework.boot.testsupport.classpath.ClassPathOverrides; -import org.springframework.session.FlushMode; -import org.springframework.session.SaveMode; -import org.springframework.session.data.mongo.MongoIndexedSessionRepository; -import org.springframework.session.data.redis.RedisIndexedSessionRepository; -import org.springframework.session.hazelcast.HazelcastIndexedSessionRepository; -import org.springframework.session.jdbc.JdbcIndexedSessionRepository; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Hazelcast 3 specific tests for {@link SessionAutoConfiguration}. - * - * @author Vedran Pavic - */ -@ClassPathExclusions("hazelcast*.jar") -@ClassPathOverrides("com.hazelcast:hazelcast:3.12.8") -class SessionAutoConfigurationHazelcast3Tests extends AbstractSessionAutoConfigurationTests { - - private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() - .withConfiguration(AutoConfigurations.of(HazelcastAutoConfiguration.class, SessionAutoConfiguration.class)) - .withPropertyValues( - "spring.hazelcast.config=org/springframework/boot/autoconfigure/session/hazelcast-3.xml"); - - @Test - void defaultConfig() { - this.contextRunner.withPropertyValues("spring.session.store-type=hazelcast").run(this::validateDefaultConfig); - } - - @Test - void defaultConfigWithUniqueStoreImplementation() { - this.contextRunner - .withClassLoader(new FilteredClassLoader(JdbcIndexedSessionRepository.class, - RedisIndexedSessionRepository.class, MongoIndexedSessionRepository.class)) - .run(this::validateDefaultConfig); - } - - private void validateDefaultConfig(AssertableWebApplicationContext context) { - validateSessionRepository(context, HazelcastIndexedSessionRepository.class); - } - - @Test - void customMapName() { - this.contextRunner - .withPropertyValues("spring.session.store-type=hazelcast", - "spring.session.hazelcast.map-name=foo:bar:biz") - .run((context) -> validateSessionRepository(context, HazelcastIndexedSessionRepository.class)); - } - - @Test - void customFlushMode() { - this.contextRunner.withPropertyValues("spring.session.store-type=hazelcast", - "spring.session.hazelcast.flush-mode=immediate").run((context) -> { - HazelcastIndexedSessionRepository repository = validateSessionRepository(context, - HazelcastIndexedSessionRepository.class); - assertThat(repository).hasFieldOrPropertyWithValue("flushMode", FlushMode.IMMEDIATE); - }); - } - - @Test - void customSaveMode() { - this.contextRunner.withPropertyValues("spring.session.store-type=hazelcast", - "spring.session.hazelcast.save-mode=on-get-attribute").run((context) -> { - HazelcastIndexedSessionRepository repository = validateSessionRepository(context, - HazelcastIndexedSessionRepository.class); - assertThat(repository).hasFieldOrPropertyWithValue("saveMode", SaveMode.ON_GET_ATTRIBUTE); - }); - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationHazelcastTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationHazelcastTests.java index d21ad5c84b..447d9bdc64 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationHazelcastTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationHazelcastTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -31,7 +31,7 @@ import org.springframework.session.FlushMode; import org.springframework.session.SaveMode; import org.springframework.session.data.mongo.MongoIndexedSessionRepository; import org.springframework.session.data.redis.RedisIndexedSessionRepository; -import org.springframework.session.hazelcast.Hazelcast4IndexedSessionRepository; +import org.springframework.session.hazelcast.HazelcastIndexedSessionRepository; import org.springframework.session.jdbc.JdbcIndexedSessionRepository; import static org.assertj.core.api.Assertions.assertThat; @@ -68,15 +68,15 @@ class SessionAutoConfigurationHazelcastTests extends AbstractSessionAutoConfigur void defaultConfigWithCustomTimeout() { this.contextRunner.withPropertyValues("spring.session.store-type=hazelcast", "spring.session.timeout=1m") .run((context) -> { - Hazelcast4IndexedSessionRepository repository = validateSessionRepository(context, - Hazelcast4IndexedSessionRepository.class); + HazelcastIndexedSessionRepository repository = validateSessionRepository(context, + HazelcastIndexedSessionRepository.class); assertThat(repository).hasFieldOrPropertyWithValue("defaultMaxInactiveInterval", 60); }); } private void validateDefaultConfig(AssertableWebApplicationContext context) { - Hazelcast4IndexedSessionRepository repository = validateSessionRepository(context, - Hazelcast4IndexedSessionRepository.class); + HazelcastIndexedSessionRepository repository = validateSessionRepository(context, + HazelcastIndexedSessionRepository.class); assertThat(repository).hasFieldOrPropertyWithValue("defaultMaxInactiveInterval", (int) new ServerProperties().getServlet().getSession().getTimeout().getSeconds()); HazelcastInstance hazelcastInstance = context.getBean(HazelcastInstance.class); @@ -87,7 +87,7 @@ class SessionAutoConfigurationHazelcastTests extends AbstractSessionAutoConfigur void customMapName() { this.contextRunner.withPropertyValues("spring.session.store-type=hazelcast", "spring.session.hazelcast.map-name=foo:bar:biz").run((context) -> { - validateSessionRepository(context, Hazelcast4IndexedSessionRepository.class); + validateSessionRepository(context, HazelcastIndexedSessionRepository.class); HazelcastInstance hazelcastInstance = context.getBean(HazelcastInstance.class); verify(hazelcastInstance, times(1)).getMap("foo:bar:biz"); }); @@ -97,8 +97,8 @@ class SessionAutoConfigurationHazelcastTests extends AbstractSessionAutoConfigur void customFlushMode() { this.contextRunner.withPropertyValues("spring.session.store-type=hazelcast", "spring.session.hazelcast.flush-mode=immediate").run((context) -> { - Hazelcast4IndexedSessionRepository repository = validateSessionRepository(context, - Hazelcast4IndexedSessionRepository.class); + HazelcastIndexedSessionRepository repository = validateSessionRepository(context, + HazelcastIndexedSessionRepository.class); assertThat(repository).hasFieldOrPropertyWithValue("flushMode", FlushMode.IMMEDIATE); }); } @@ -107,8 +107,8 @@ class SessionAutoConfigurationHazelcastTests extends AbstractSessionAutoConfigur void customSaveMode() { this.contextRunner.withPropertyValues("spring.session.store-type=hazelcast", "spring.session.hazelcast.save-mode=on-get-attribute").run((context) -> { - Hazelcast4IndexedSessionRepository repository = validateSessionRepository(context, - Hazelcast4IndexedSessionRepository.class); + HazelcastIndexedSessionRepository repository = validateSessionRepository(context, + HazelcastIndexedSessionRepository.class); assertThat(repository).hasFieldOrPropertyWithValue("saveMode", SaveMode.ON_GET_ATTRIBUTE); }); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java index 25233f6144..505aebba95 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.session; import java.util.Collections; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import org.assertj.core.api.InstanceOfAssertFactories; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java index 32b55b67f0..9887f9e4c3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java @@ -23,8 +23,9 @@ import java.util.Properties; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; -import javax.transaction.TransactionManager; -import javax.transaction.UserTransaction; + +import jakarta.transaction.TransactionManager; +import jakarta.transaction.UserTransaction; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java index 30ce1a4bdd..5640bc4f43 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java @@ -19,10 +19,10 @@ package org.springframework.boot.autoconfigure.validation; import java.util.HashSet; import java.util.Set; -import javax.validation.ConstraintViolationException; -import javax.validation.Validator; -import javax.validation.constraints.Min; -import javax.validation.constraints.Size; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Validator; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.Size; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithHibernateValidatorMissingElImplTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithHibernateValidatorMissingElImplTests.java index 7020ef36f3..f5c47be4f9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithHibernateValidatorMissingElImplTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithHibernateValidatorMissingElImplTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.validation; -import javax.validation.Validator; +import jakarta.validation.Validator; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithoutValidatorTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithoutValidatorTests.java index 70dfa9ffb5..6ebfbf9ceb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithoutValidatorTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithoutValidatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.validation; -import javax.validation.Validator; +import jakarta.validation.Validator; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapterTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapterTests.java index ba698845ee..f8458ae84a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapterTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidatorAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.validation; import java.util.HashMap; -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Min; import org.junit.jupiter.api.Test; @@ -86,7 +86,7 @@ class ValidatorAdapterTests { @Test void wrapperWhenValidationProviderNotPresentShouldNotThrowException() { ClassPathResource hibernateValidator = new ClassPathResource( - "META-INF/services/javax.validation.spi.ValidationProvider"); + "META-INF/services/jakarta.validation.spi.ValidationProvider"); this.contextRunner .withClassLoader( new FilteredClassLoader(FilteredClassLoader.ClassPathResourceFilter.of(hibernateValidator), diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index ea1ede9841..c2efe4e3f6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -26,10 +26,10 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.undertow.UndertowOptions; import org.apache.catalina.connector.Connector; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java index 31c071ae25..85b61876eb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java @@ -31,7 +31,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import javax.validation.ValidatorFactory; +import jakarta.validation.ValidatorFactory; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; @@ -275,7 +275,7 @@ class WebFluxAutoConfigurationTests { void validatorWhenNoValidatorShouldUseDefault() { this.contextRunner.run((context) -> { assertThat(context).doesNotHaveBean(ValidatorFactory.class); - assertThat(context).doesNotHaveBean(javax.validation.Validator.class); + assertThat(context).doesNotHaveBean(jakarta.validation.Validator.class); assertThat(context).getBeanNames(Validator.class).containsExactly("webFluxValidator"); }); } @@ -284,7 +284,7 @@ class WebFluxAutoConfigurationTests { void validatorWhenNoCustomizationShouldUseAutoConfigured() { this.contextRunner.withConfiguration(AutoConfigurations.of(ValidationAutoConfiguration.class)) .run((context) -> { - assertThat(context).getBeanNames(javax.validation.Validator.class) + assertThat(context).getBeanNames(jakarta.validation.Validator.class) .containsExactly("defaultValidator"); assertThat(context).getBeanNames(Validator.class).containsExactlyInAnyOrder("defaultValidator", "webFluxValidator"); @@ -302,7 +302,7 @@ class WebFluxAutoConfigurationTests { void validatorWithConfigurerShouldUseSpringValidator() { this.contextRunner.withUserConfiguration(ValidatorWebFluxConfigurer.class).run((context) -> { assertThat(context).doesNotHaveBean(ValidatorFactory.class); - assertThat(context).doesNotHaveBean(javax.validation.Validator.class); + assertThat(context).doesNotHaveBean(jakarta.validation.Validator.class); assertThat(context).getBeanNames(Validator.class).containsOnly("webFluxValidator"); assertThat(context.getBean("webFluxValidator")) .isSameAs(context.getBean(ValidatorWebFluxConfigurer.class).validator); @@ -313,7 +313,7 @@ class WebFluxAutoConfigurationTests { void validatorWithConfigurerDoesNotExposeJsr303() { this.contextRunner.withUserConfiguration(ValidatorJsr303WebFluxConfigurer.class).run((context) -> { assertThat(context).doesNotHaveBean(ValidatorFactory.class); - assertThat(context).doesNotHaveBean(javax.validation.Validator.class); + assertThat(context).doesNotHaveBean(jakarta.validation.Validator.class); assertThat(context).getBeanNames(Validator.class).containsOnly("webFluxValidator"); Validator validator = context.getBean("webFluxValidator", Validator.class); assertThat(validator).isInstanceOf(ValidatorAdapter.class); @@ -327,7 +327,7 @@ class WebFluxAutoConfigurationTests { this.contextRunner.withConfiguration(AutoConfigurations.of(ValidationAutoConfiguration.class)) .withUserConfiguration(ValidatorWebFluxConfigurer.class).run((context) -> { assertThat(context).getBeans(ValidatorFactory.class).hasSize(1); - assertThat(context).getBeans(javax.validation.Validator.class).hasSize(1); + assertThat(context).getBeans(jakarta.validation.Validator.class).hasSize(1); assertThat(context).getBeanNames(Validator.class).containsExactlyInAnyOrder("defaultValidator", "webFluxValidator"); assertThat(context.getBean("webFluxValidator")) @@ -343,7 +343,7 @@ class WebFluxAutoConfigurationTests { void validatorWithCustomSpringValidatorIgnored() { this.contextRunner.withConfiguration(AutoConfigurations.of(ValidationAutoConfiguration.class)) .withUserConfiguration(CustomSpringValidator.class).run((context) -> { - assertThat(context).getBeanNames(javax.validation.Validator.class) + assertThat(context).getBeanNames(jakarta.validation.Validator.class) .containsExactly("defaultValidator"); assertThat(context).getBeanNames(Validator.class).containsExactlyInAnyOrder("customValidator", "defaultValidator", "webFluxValidator"); @@ -361,7 +361,7 @@ class WebFluxAutoConfigurationTests { void validatorWithCustomJsr303ValidatorExposedAsSpringValidator() { this.contextRunner.withUserConfiguration(CustomJsr303Validator.class).run((context) -> { assertThat(context).doesNotHaveBean(ValidatorFactory.class); - assertThat(context).getBeanNames(javax.validation.Validator.class).containsExactly("customValidator"); + assertThat(context).getBeanNames(jakarta.validation.Validator.class).containsExactly("customValidator"); assertThat(context).getBeanNames(Validator.class).containsExactly("webFluxValidator"); Validator validator = context.getBean(Validator.class); assertThat(validator).isInstanceOf(ValidatorAdapter.class); @@ -748,8 +748,8 @@ class WebFluxAutoConfigurationTests { static class CustomJsr303Validator { @Bean - javax.validation.Validator customValidator() { - return mock(javax.validation.Validator.class); + jakarta.validation.Validator customValidator() { + return mock(jakarta.validation.Validator.class); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java index 576935cbd7..a171cfbb3f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java @@ -20,7 +20,7 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DummyBody.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DummyBody.java index 4e520b13e4..7d7db625bb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DummyBody.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DummyBody.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.web.reactive.error; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class DummyBody { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBeanTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBeanTests.java index 4fd7d5a384..ae0c93e863 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBeanTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,11 +19,11 @@ package org.springframework.boot.autoconfigure.web.servlet; import java.io.IOException; import java.util.function.Consumer; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfigurationTests.java index 845610ab42..93ebaef363 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfigurationTests.java @@ -16,8 +16,8 @@ package org.springframework.boot.autoconfigure.web.servlet; -import javax.servlet.MultipartConfigElement; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java index 7e0040c577..a529a47974 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java @@ -21,7 +21,7 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.ConcurrentHashMap; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfigurationTests.java index eaa3a05b1c..dd8ade15b3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -22,7 +22,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MockServletWebServerFactory.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MockServletWebServerFactory.java index 22c7c69a92..9b06ec44d2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MockServletWebServerFactory.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MockServletWebServerFactory.java @@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.web.servlet; import java.util.Arrays; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredFilter; import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredServlet; 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 c93c676f67..910444a7ab 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.web.servlet; import java.net.URI; -import javax.servlet.MultipartConfigElement; +import jakarta.servlet.MultipartConfigElement; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfigurationTests.java index d4c963ecaf..f20d62ef80 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfigurationTests.java @@ -16,11 +16,11 @@ package org.springframework.boot.autoconfigure.web.servlet; -import javax.servlet.Filter; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import io.undertow.Undertow.Builder; import io.undertow.servlet.api.DeploymentInfo; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerServletContextListenerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerServletContextListenerTests.java index b40d7557c7..353bb0833c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerServletContextListenerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerServletContextListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.autoconfigure.web.servlet; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; import org.junit.jupiter.api.Test; 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 2e50b5ce39..bdcc7859d8 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 @@ -33,9 +33,9 @@ import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.ValidatorFactory; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.ValidatorFactory; import org.junit.jupiter.api.Test; @@ -692,7 +692,7 @@ class WebMvcAutoConfigurationTests { void validatorWhenNoValidatorShouldUseDefault() { this.contextRunner.run((context) -> { assertThat(context).doesNotHaveBean(ValidatorFactory.class); - assertThat(context).doesNotHaveBean(javax.validation.Validator.class); + assertThat(context).doesNotHaveBean(jakarta.validation.Validator.class); assertThat(context).getBeanNames(Validator.class).containsOnly("mvcValidator"); }); } @@ -701,7 +701,8 @@ class WebMvcAutoConfigurationTests { void validatorWhenNoCustomizationShouldUseAutoConfigured() { this.contextRunner.withConfiguration(AutoConfigurations.of(ValidationAutoConfiguration.class)) .run((context) -> { - assertThat(context).getBeanNames(javax.validation.Validator.class).containsOnly("defaultValidator"); + assertThat(context).getBeanNames(jakarta.validation.Validator.class) + .containsOnly("defaultValidator"); assertThat(context).getBeanNames(Validator.class).containsOnly("defaultValidator", "mvcValidator"); Validator validator = context.getBean("mvcValidator", Validator.class); assertThat(validator).isInstanceOf(ValidatorAdapter.class); @@ -716,7 +717,7 @@ class WebMvcAutoConfigurationTests { void validatorWithConfigurerAloneShouldUseSpringValidator() { this.contextRunner.withUserConfiguration(MvcValidator.class).run((context) -> { assertThat(context).doesNotHaveBean(ValidatorFactory.class); - assertThat(context).doesNotHaveBean(javax.validation.Validator.class); + assertThat(context).doesNotHaveBean(jakarta.validation.Validator.class); assertThat(context).getBeanNames(Validator.class).containsOnly("mvcValidator"); Validator expectedValidator = context.getBean(MvcValidator.class).validator; assertThat(context.getBean("mvcValidator")).isSameAs(expectedValidator); @@ -729,7 +730,8 @@ class WebMvcAutoConfigurationTests { void validatorWithConfigurerShouldUseSpringValidator() { this.contextRunner.withConfiguration(AutoConfigurations.of(ValidationAutoConfiguration.class)) .withUserConfiguration(MvcValidator.class).run((context) -> { - assertThat(context).getBeanNames(javax.validation.Validator.class).containsOnly("defaultValidator"); + assertThat(context).getBeanNames(jakarta.validation.Validator.class) + .containsOnly("defaultValidator"); assertThat(context).getBeanNames(Validator.class).containsOnly("defaultValidator", "mvcValidator"); Validator expectedValidator = context.getBean(MvcValidator.class).validator; assertThat(context.getBean("mvcValidator")).isSameAs(expectedValidator); @@ -742,7 +744,7 @@ class WebMvcAutoConfigurationTests { void validatorWithConfigurerDoesNotExposeJsr303() { this.contextRunner.withUserConfiguration(MvcJsr303Validator.class).run((context) -> { assertThat(context).doesNotHaveBean(ValidatorFactory.class); - assertThat(context).doesNotHaveBean(javax.validation.Validator.class); + assertThat(context).doesNotHaveBean(jakarta.validation.Validator.class); assertThat(context).getBeanNames(Validator.class).containsOnly("mvcValidator"); Validator validator = context.getBean("mvcValidator", Validator.class); assertThat(validator).isInstanceOf(ValidatorAdapter.class); @@ -756,7 +758,7 @@ class WebMvcAutoConfigurationTests { this.contextRunner.withConfiguration(AutoConfigurations.of(ValidationAutoConfiguration.class)) .withUserConfiguration(MvcValidator.class).run((context) -> { assertThat(context).hasSingleBean(ValidatorFactory.class); - assertThat(context).hasSingleBean(javax.validation.Validator.class); + assertThat(context).hasSingleBean(jakarta.validation.Validator.class); assertThat(context).getBeanNames(Validator.class).containsOnly("defaultValidator", "mvcValidator"); assertThat(context.getBean("mvcValidator")).isSameAs(context.getBean(MvcValidator.class).validator); // Primary Spring validator is the auto-configured one as the MVC one @@ -769,7 +771,8 @@ class WebMvcAutoConfigurationTests { void validatorWithCustomSpringValidatorIgnored() { this.contextRunner.withConfiguration(AutoConfigurations.of(ValidationAutoConfiguration.class)) .withUserConfiguration(CustomSpringValidator.class).run((context) -> { - assertThat(context).getBeanNames(javax.validation.Validator.class).containsOnly("defaultValidator"); + assertThat(context).getBeanNames(jakarta.validation.Validator.class) + .containsOnly("defaultValidator"); assertThat(context).getBeanNames(Validator.class).containsOnly("customSpringValidator", "defaultValidator", "mvcValidator"); Validator validator = context.getBean("mvcValidator", Validator.class); @@ -786,7 +789,7 @@ class WebMvcAutoConfigurationTests { this.contextRunner.withConfiguration(AutoConfigurations.of(ValidationAutoConfiguration.class)) .withUserConfiguration(CustomJsr303Validator.class).run((context) -> { assertThat(context).doesNotHaveBean(ValidatorFactory.class); - assertThat(context).getBeanNames(javax.validation.Validator.class) + assertThat(context).getBeanNames(jakarta.validation.Validator.class) .containsOnly("customJsr303Validator"); assertThat(context).getBeanNames(Validator.class).containsOnly("mvcValidator"); Validator validator = context.getBean(Validator.class); @@ -1281,8 +1284,8 @@ class WebMvcAutoConfigurationTests { static class CustomJsr303Validator { @Bean - javax.validation.Validator customJsr303Validator() { - return mock(javax.validation.Validator.class); + jakarta.validation.Validator customJsr303Validator() { + return mock(jakarta.validation.Validator.class); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMappingTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMappingTests.java index b907cdae2b..5f9433c292 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMappingTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMappingTests.java @@ -19,8 +19,8 @@ package org.springframework.boot.autoconfigure.web.servlet; import java.util.Collections; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerDirectMockMvcTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerDirectMockMvcTests.java index d2153b0775..e6a7f2e008 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerDirectMockMvcTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerDirectMockMvcTests.java @@ -22,7 +22,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerIntegrationTests.java index 77369aed16..f8acbb974e 100755 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerIntegrationTests.java @@ -27,10 +27,10 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java index ececfe5e90..4bb57cd2f8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java @@ -23,10 +23,10 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.util.Map; -import javax.servlet.DispatcherType; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -226,7 +226,7 @@ class BasicErrorControllerMockMvcTests { MockHttpServletRequest request = this.result.getRequest(); request.setDispatcherType(DispatcherType.ERROR); request.setRequestURI(this.path); - request.setAttribute("javax.servlet.error.status_code", this.result.getResponse().getStatus()); + request.setAttribute("jakarta.servlet.error.status_code", this.result.getResponse().getStatus()); return request; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewIntegrationTests.java index 236a9f1d65..acf089b29c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -79,7 +79,7 @@ class DefaultErrorViewIntegrationTests { void testErrorWithHtmlEscape() throws Exception { MvcResult response = this.mockMvc .perform(get("/error") - .requestAttr("javax.servlet.error.exception", + .requestAttr("jakarta.servlet.error.exception", new RuntimeException("")) .accept(MediaType.TEXT_HTML)) .andExpect(status().is5xxServerError()).andReturn(); @@ -93,7 +93,7 @@ class DefaultErrorViewIntegrationTests { void testErrorWithSpelEscape() throws Exception { String spel = "${T(" + getClass().getName() + ").injectCall()}"; MvcResult response = this.mockMvc.perform(get("/error") - .requestAttr("javax.servlet.error.exception", new RuntimeException(spel)).accept(MediaType.TEXT_HTML)) + .requestAttr("jakarta.servlet.error.exception", new RuntimeException(spel)).accept(MediaType.TEXT_HTML)) .andExpect(status().is5xxServerError()).andReturn(); String content = response.getResponse().getContentAsString(); assertThat(content).doesNotContain("injection"); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolverTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolverTests.java index 98781dc002..a0e4f166d5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolverTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfigurationTests.java index 455ed87b38..7271331a70 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfigurationTests.java @@ -103,8 +103,8 @@ class ErrorMvcAutoConfigurationTests { MockHttpServletRequest request = new MockHttpServletRequest("GET", "/path"); MockHttpServletResponse response = new MockHttpServletResponse(); DispatcherServletWebRequest webRequest = new DispatcherServletWebRequest(request, response); - webRequest.setAttribute("javax.servlet.error.exception", ex, RequestAttributes.SCOPE_REQUEST); - webRequest.setAttribute("javax.servlet.error.request_uri", "/path", RequestAttributes.SCOPE_REQUEST); + webRequest.setAttribute("jakarta.servlet.error.exception", ex, RequestAttributes.SCOPE_REQUEST); + webRequest.setAttribute("jakarta.servlet.error.request_uri", "/path", RequestAttributes.SCOPE_REQUEST); response.setCommitted(committed); response.setOutputStreamAccessAllowed(!committed); response.setWriterAccessAllowed(!committed); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfigurationTests.java index f4899b4573..ed55fa3d46 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.websocket.servlet; -import javax.websocket.server.ServerContainer; +import jakarta.websocket.server.ServerContainer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -69,7 +69,7 @@ class WebSocketServletAutoConfigurationTests { this.context.register(configuration); this.context.refresh(); Object serverContainer = this.context.getServletContext() - .getAttribute("javax.websocket.server.ServerContainer"); + .getAttribute("jakarta.websocket.server.ServerContainer"); assertThat(serverContainer).isInstanceOf(ServerContainer.class); } diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/app/SpringApplicationWebApplicationInitializer.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/app/SpringApplicationWebApplicationInitializer.java index 94cea0dc0e..718b08ffc8 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/app/SpringApplicationWebApplicationInitializer.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/app/SpringApplicationWebApplicationInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import java.io.IOException; import java.io.InputStream; import java.util.jar.Manifest; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/JmsCompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/JmsCompilerAutoConfiguration.java index eb3d66d788..3b0c26d23a 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/JmsCompilerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/JmsCompilerAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -41,12 +41,12 @@ public class JmsCompilerAutoConfiguration extends CompilerAutoConfiguration { @Override public void applyDependencies(DependencyCustomizer dependencies) throws CompilationFailedException { - dependencies.add("spring-jms", "javax.jms-api"); + dependencies.add("spring-jms", "jakarta.jms-api"); } @Override public void applyImports(ImportCustomizer imports) throws CompilationFailedException { - imports.addStarImports("javax.jms", "org.springframework.jms.annotation", "org.springframework.jms.config", + imports.addStarImports("jakarta.jms", "org.springframework.jms.annotation", "org.springframework.jms.config", "org.springframework.jms.core", "org.springframework.jms.listener", "org.springframework.jms.listener.adapter"); } diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java index 7c15691c5d..e0a327a9f6 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -45,9 +45,10 @@ public class SpringBootCompilerAutoConfiguration extends CompilerAutoConfigurati @Override public void applyImports(ImportCustomizer imports) { - imports.addImports("javax.annotation.PostConstruct", "javax.annotation.PreDestroy", "groovy.util.logging.Log", - "org.springframework.stereotype.Controller", "org.springframework.stereotype.Service", - "org.springframework.stereotype.Component", "org.springframework.beans.factory.annotation.Autowired", + imports.addImports("jakarta.annotation.PostConstruct", "jakarta.annotation.PreDestroy", + "groovy.util.logging.Log", "org.springframework.stereotype.Controller", + "org.springframework.stereotype.Service", "org.springframework.stereotype.Component", + "org.springframework.beans.factory.annotation.Autowired", "org.springframework.beans.factory.annotation.Value", "org.springframework.context.annotation.Import", "org.springframework.context.annotation.ImportResource", "org.springframework.context.annotation.Profile", "org.springframework.context.annotation.Scope", diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index c5b4534fde..8a661a63e8 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -245,20 +245,14 @@ bom { ] } } - library("Glassfish EL", "3.0.4") { - prohibit("[4.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Glassfish EL", "4.0.2") { group("org.glassfish") { modules = [ "jakarta.el" ] } } - library("Glassfish JAXB", "2.3.5") { - prohibit("[3.0.0-M1,)") { - because "it uses the jakarta.* namespace" - } + library("Glassfish JAXB", "3.0.2") { group("org.glassfish.jaxb") { modules = [ "codemodel", @@ -272,7 +266,7 @@ bom { ] } } - library("Glassfish JSTL", "1.2.6") { + library("Glassfish JSTL", "2.0.0") { group("org.glassfish.web") { modules = [ "jakarta.servlet.jsp.jstl" @@ -309,7 +303,7 @@ bom { ] } } - library("Hazelcast", "4.2.2") { + library("Hazelcast", "5.0") { group("com.hazelcast") { modules = [ "hazelcast", @@ -326,32 +320,26 @@ bom { } } library("Hibernate", "5.6.1.Final") { - prohibit("[6.0.0.Alpha2,)") { - because "it uses the jakarta.* namespace" - } group("org.hibernate") { modules = [ "hibernate-c3p0", - "hibernate-core", + "hibernate-core-jakarta", "hibernate-ehcache", "hibernate-entitymanager", - "hibernate-envers", + "hibernate-envers-jakarta", "hibernate-hikaricp", "hibernate-java8", "hibernate-jcache", - "hibernate-jpamodelgen", + "hibernate-jpamodelgen-jakarta", "hibernate-micrometer", "hibernate-proxool", "hibernate-spatial", - "hibernate-testing", + "hibernate-testing-jakarta", "hibernate-vibur" ] } } - library("Hibernate Validator", "6.2.0.Final") { - prohibit("[7.0.0.Alpha1,)") { - because "it uses the jakarta.* namespace" - } + library("Hibernate Validator", "7.0.1.Final") { group("org.hibernate.validator") { modules = [ "hibernate-validator", @@ -452,10 +440,7 @@ bom { ] } } - library("Jakarta Activation", "1.2.2") { - prohibit("[2.0.0-rc1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Activation", "2.0.1") { group("com.sun.activation") { modules = [ "jakarta.activation" @@ -467,50 +452,35 @@ bom { ] } } - library("Jakarta Annotation", "1.3.5") { - prohibit("[2.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Annotation", "2.0.0") { group("jakarta.annotation") { modules = [ "jakarta.annotation-api" ] } } - library("Jakarta JMS", "2.0.3") { - prohibit("[3.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta JMS", "3.0.0") { group("jakarta.jms") { modules = [ "jakarta.jms-api" ] } } - library("Jakarta Json", "1.1.6") { - prohibit("[2.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Json", "2.0.1") { group("jakarta.json") { modules = [ "jakarta.json-api" ] } } - library("Jakarta Json Bind", "1.0.2") { - prohibit("[2.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Json Bind", "2.0.0") { group("jakarta.json.bind") { modules = [ "jakarta.json.bind-api" ] } } - library("Jakarta Mail", "1.6.7") { - prohibit("[2.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Mail", "2.0.1") { group("jakarta.mail") { modules = [ "jakarta.mail-api" @@ -524,100 +494,70 @@ bom { ] } } - library("Jakarta Persistence", "2.2.3") { - prohibit("[3.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Persistence", "3.0.0") { group("jakarta.persistence") { modules = [ "jakarta.persistence-api" ] } } - library("Jakarta Servlet", "4.0.4") { - prohibit("[5.0.0-M1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Servlet", "5.0.0") { group("jakarta.servlet") { modules = [ "jakarta.servlet-api" ] } } - library("Jakarta Servlet JSP JSTL", "1.2.7") { - prohibit("[2.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Servlet JSP JSTL", "2.0.0") { group("jakarta.servlet.jsp.jstl") { modules = [ "jakarta.servlet.jsp.jstl-api" ] } } - library("Jakarta Transaction", "1.3.3") { - prohibit("[2.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Transaction", "2.0.0") { group("jakarta.transaction") { modules = [ "jakarta.transaction-api" ] } } - library("Jakarta Validation", "2.0.2") { - prohibit("[3.0.0-M1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta Validation", "3.0.1") { group("jakarta.validation") { modules = [ "jakarta.validation-api" ] } } - library("Jakarta WebSocket", "1.1.2") { - prohibit("[2.0.0-M1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta WebSocket", "2.0.0") { group("jakarta.websocket") { modules = [ "jakarta.websocket-api" ] } } - library("Jakarta WS RS", "2.1.6") { - prohibit("[3.0.0-M1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta WS RS", "3.0.0") { group("jakarta.ws.rs") { modules = [ "jakarta.ws.rs-api" ] } } - library("Jakarta XML Bind", "2.3.3") { - prohibit("[3.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta XML Bind", "3.0.1") { group("jakarta.xml.bind") { modules = [ "jakarta.xml.bind-api" ] } } - library("Jakarta XML SOAP", "1.4.2") { - prohibit("[2.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta XML SOAP", "2.0.1") { group("jakarta.xml.soap") { modules = [ "jakarta.xml.soap-api" ] } } - library("Jakarta XML WS", "2.3.3") { - prohibit("[3.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Jakarta XML WS", "3.0.1") { group("jakarta.xml.ws") { modules = [ "jakarta.xml.ws-api" @@ -633,20 +573,6 @@ bom { ] } } - library("Javax Activation", "1.2.0") { - group("javax.activation") { - modules = [ - "javax.activation-api" - ] - } - } - library("Javax Annotation", "1.3.2") { - group("javax.annotation") { - modules = [ - "javax.annotation-api" - ] - } - } library("Javax Cache", "1.1.1") { group("javax.cache") { modules = [ @@ -654,48 +580,6 @@ bom { ] } } - library("Javax JAXB", "2.3.1") { - group("javax.xml.bind") { - modules = [ - "jaxb-api" - ] - } - } - library("Javax JAXWS", "2.3.1") { - group("javax.xml.ws") { - modules = [ - "jaxws-api" - ] - } - } - library("Javax JMS", "2.0.1") { - group("javax.jms") { - modules = [ - "javax.jms-api" - ] - } - } - library("Javax Json", "1.1.4") { - group("javax.json") { - modules = [ - "javax.json-api" - ] - } - } - library("Javax JsonB", "1.0") { - group("javax.json.bind") { - modules = [ - "javax.json.bind-api" - ] - } - } - library("Javax Mail", "1.6.2") { - group("javax.mail") { - modules = [ - "javax.mail-api" - ] - } - } library("Javax Money", "1.1") { group("javax.money") { modules = [ @@ -703,34 +587,6 @@ bom { ] } } - library("Javax Persistence", "2.2") { - group("javax.persistence") { - modules = [ - "javax.persistence-api" - ] - } - } - library("Javax Transaction", "1.3") { - group("javax.transaction") { - modules = [ - "javax.transaction-api" - ] - } - } - library("Javax Validation", "2.0.1.Final") { - group("javax.validation") { - modules = [ - "validation-api" - ] - } - } - library("Javax WebSocket", "1.1") { - group("javax.websocket") { - modules = [ - "javax.websocket-api" - ] - } - } library("Jaxen", "1.2.0") { group("jaxen") { modules = [ @@ -767,40 +623,21 @@ bom { ] } } - library("Jetty EL", "9.0.52") { - prohibit("[10.0.0-M1,)") { - because "it requires Java 11" - } + library("Jetty EL", "10.0.7") { group("org.mortbay.jasper") { modules = [ "apache-el" ] } } - library("Jetty JSP", "2.2.0.v201112011158") { - group("org.eclipse.jetty.orbit") { - modules = [ - "javax.servlet.jsp" - ] - } - } - library("Jetty Reactive HTTPClient", "1.1.10") { - prohibit("[2,)") { - because "it uses the jakarta.* namespace" - } + library("Jetty Reactive HTTPClient", "3.0.4") { group("org.eclipse.jetty") { modules = [ "jetty-reactive-httpclient" ] } } - library("Jetty", "9.4.44.v20210927") { - prohibit("[10.0.0-alpha0,)") { - because "it requires Java 11" - } - prohibit("[11.0.0-alpha0,)") { - because "it uses the jakarta.* namespace" - } + library("Jetty", "11.0.7") { group("org.eclipse.jetty") { imports = [ "jetty-bom" @@ -1355,10 +1192,7 @@ bom { ] } } - library("SAAJ Impl", "1.5.3") { - prohibit("[2.0.0-M1,)") { - because "it uses the jakarta.* namespace" - } + library("SAAJ Impl", "2.0.1") { group("com.sun.xml.messaging.saaj") { modules = [ "saaj-impl" @@ -1447,7 +1281,7 @@ bom { ] } } - library("Spring AMQP", "2.4.0") { + library("Spring AMQP", "3.0.0-SNAPSHOT") { group("org.springframework.amqp") { modules = [ "spring-amqp", @@ -1468,35 +1302,35 @@ bom { ] } } - library("Spring Data Bom", "2021.1.0") { + library("Spring Data Bom", "2022.1.0-SNAPSHOT") { group("org.springframework.data") { imports = [ "spring-data-bom" ] } } - library("Spring Framework", "5.3.13") { + library("Spring Framework", "6.0.0-SNAPSHOT") { group("org.springframework") { imports = [ "spring-framework-bom" ] } } - library("Spring HATEOAS", "1.4.0") { + library("Spring HATEOAS", "2.0.0-SNAPSHOT") { group("org.springframework.hateoas") { modules = [ "spring-hateoas" ] } } - library("Spring Integration", "5.5.6") { + library("Spring Integration", "6.0.0-SNAPSHOT") { group("org.springframework.integration") { imports = [ "spring-integration-bom" ] } } - library("Spring Kafka", "2.8.0") { + library("Spring Kafka", "3.0.0-SNAPSHOT") { group("org.springframework.kafka") { modules = [ "spring-kafka", @@ -1516,7 +1350,7 @@ bom { ] } } - library("Spring RESTDocs", "2.0.5.RELEASE") { + library("Spring RESTDocs", "3.0.0-SNAPSHOT") { group("org.springframework.restdocs") { modules = [ "spring-restdocs-asciidoctor", @@ -1534,21 +1368,25 @@ bom { ] } } - library("Spring Security", "5.6.0") { + library("Spring Security", "6.0.0-SNAPSHOT") { group("org.springframework.security") { imports = [ "spring-security-bom" ] } } - library("Spring Session Bom", "2021.1.0") { + library("Spring Session", "3.0.0-SNAPSHOT") { group("org.springframework.session") { - imports = [ - "spring-session-bom" + modules = [ + "spring-session-core", + "spring-session-data-mongodb", + "spring-session-data-redis", + "spring-session-hazelcast", + "spring-session-jdbc" ] } } - library("Spring WS", "3.1.1") { + library("Spring WS", "4.0.0-SNAPSHOT") { group("org.springframework.ws") { modules = [ "spring-ws-core", @@ -1566,10 +1404,7 @@ bom { ] } } - library("Sun Mail", "1.6.7") { - prohibit("[2.0.0-RC1,)") { - because "it uses the jakarta.* namespace" - } + library("Sun Mail", "2.0.1") { group("com.sun.mail") { modules = [ "jakarta.mail" @@ -1577,9 +1412,6 @@ bom { } } library("Tomcat", "${tomcatVersion}") { - prohibit("[10.0.0-M1,)") { - because "it uses the jakarta.* namespace" - } group("org.apache.tomcat") { modules = [ "tomcat-annotations-api", @@ -1607,8 +1439,8 @@ bom { group("io.undertow") { modules = [ "undertow-core", - "undertow-servlet", - "undertow-websockets-jsr" + "undertow-servlet-jakartaee9", + "undertow-websockets-jsr-jakartaee9" ] } } @@ -1651,7 +1483,7 @@ bom { ] } } - library("Yasson", "1.0.9") { + library("Yasson", "2.0.2") { group("org.eclipse") { modules = [ "yasson" diff --git a/spring-boot-project/spring-boot-devtools/build.gradle b/spring-boot-project/spring-boot-devtools/build.gradle index 883393cd53..25e98d6d1b 100644 --- a/spring-boot-project/spring-boot-devtools/build.gradle +++ b/spring-boot-project/spring-boot-devtools/build.gradle @@ -36,15 +36,9 @@ dependencies { optional("io.projectreactor:reactor-core") optional("io.r2dbc:r2dbc-spi") - optional("jakarta.persistence:jakarta.persistence-api") optional("jakarta.servlet:jakarta.servlet-api") optional("org.apache.derby:derby") - optional("org.hibernate:hibernate-core") { - exclude group: "javax.activation", module:"javax.activation-api" - exclude group: "javax.persistence", module:"javax.persistence-api" - exclude group: "javax.xml.bind", module:"jaxb-api" - exclude group: "org.jboss.spec.javax.transaction", module:"jboss-transaction-api_1.2_spec" - } + optional("org.hibernate:hibernate-core-jakarta") optional("org.springframework:spring-jdbc") optional("org.springframework:spring-orm") optional("org.springframework:spring-web") @@ -64,7 +58,7 @@ dependencies { testImplementation("org.apache.tomcat.embed:tomcat-embed-jasper") testImplementation("org.assertj:assertj-core") testImplementation("org.awaitility:awaitility") - testImplementation("org.eclipse.jetty.websocket:websocket-client") + testImplementation("org.eclipse.jetty.websocket:websocket-jakarta-client") testImplementation("org.hamcrest:hamcrest-library") testImplementation("org.hsqldb:hsqldb") testImplementation("org.junit.jupiter:junit-jupiter") diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.java index 932e299b93..43a0a3039a 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -73,8 +73,8 @@ public class DevToolsDataSourceAutoConfiguration { } /** - * Post processor to ensure that {@link javax.persistence.EntityManagerFactory} beans - * depend on the {@code inMemoryDatabaseShutdownExecutor} bean. + * Post processor to ensure that {@link jakarta.persistence.EntityManagerFactory} + * beans depend on the {@code inMemoryDatabaseShutdownExecutor} bean. */ @ConditionalOnClass(LocalContainerEntityManagerFactoryBean.class) @ConditionalOnBean(AbstractEntityManagerFactoryBean.class) diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java index 49656533c4..f56b25ed49 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.devtools.autoconfigure; import java.util.Collection; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/DispatcherFilter.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/DispatcherFilter.java index 62ccf76307..351f568966 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/DispatcherFilter.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/DispatcherFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,14 +18,14 @@ package org.springframework.boot.devtools.remote.server; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.http.server.ServerHttpRequest; import org.springframework.http.server.ServerHttpResponse; diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java index 81047e28ea..e02fdaa419 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java @@ -19,7 +19,7 @@ package org.springframework.boot.devtools.autoconfigure; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/LiveReloadServerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/LiveReloadServerTests.java index 195dce640e..acf540344b 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/LiveReloadServerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/LiveReloadServerTests.java @@ -37,11 +37,11 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Collectors; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.ClientEndpointConfig.Configurator; -import javax.websocket.Endpoint; -import javax.websocket.HandshakeResponse; -import javax.websocket.WebSocketContainer; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.ClientEndpointConfig.Configurator; +import jakarta.websocket.Endpoint; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.WebSocketContainer; import org.apache.tomcat.websocket.WsWebSocketContainer; import org.awaitility.Awaitility; diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java index 03826f5b4a..3900ff7fba 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,11 +16,11 @@ package org.springframework.boot.devtools.remote.server; -import javax.servlet.FilterChain; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapperTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapperTests.java index d4f425bf7e..2da23ed486 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapperTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.devtools.remote.server; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc index 4df1946045..7418024485 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc @@ -161,7 +161,7 @@ The following metadata snippet corresponds to the standard `server.servlet.jsp.c { "name": "class-reference", "parameters": { - "target": "javax.servlet.http.HttpServlet" + "target": "jakarta.servlet.http.HttpServlet" } } ] diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/system-requirements.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/system-requirements.adoc index 81c4ff4b1c..91cdfd44bf 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/system-requirements.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/system-requirements.adoc @@ -24,17 +24,14 @@ Spring Boot supports the following embedded servlet containers: |=== | Name | Servlet Version -| Tomcat 9.0 -| 4.0 +| Tomcat 10.0 +| 5.0 -| Jetty 9.4 -| 3.1 +| Jetty 11.0 +| 5.1 -| Jetty 10.0 -| 4.0 - -| Undertow 2.0 -| 4.0 +| Undertow 2.2 (Jakarta EE 9 variant) +| 5.0 |=== -You can also deploy Spring Boot applications to any servlet 3.1+ compatible container. +You can also deploy Spring Boot applications to any servlet 5.0+ compatible container. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc index 713719d4ba..38fcadff67 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc @@ -141,7 +141,7 @@ See the {spring-boot-autoconfigure-module-code}/web/servlet/WebMvcAutoConfigurat [[howto.spring-mvc.multipart-file-uploads]] === Handling Multipart File Uploads -Spring Boot embraces the servlet 3 `javax.servlet.http.Part` API to support uploading files. +Spring Boot embraces the servlet 5 `jakarta.servlet.http.Part` API to support uploading files. By default, Spring Boot configures Spring MVC with a maximum size of 1MB per file and a maximum of 10MB of file data in a single request. You may override these values, the location to which intermediate data is stored (for example, to the `/tmp` directory), and the threshold past which data is flushed to disk by using the properties exposed in the `MultipartProperties` class. For example, if you want to specify that files be unlimited, set the configprop:spring.servlet.multipart.max-file-size[] property to `-1`. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc index 2151c03099..3e63cd4794 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc @@ -497,7 +497,7 @@ If you need to register a `Filter` that interacts with other beans, consider usi [[web.servlet.embedded-container.context-initializer]] ==== Servlet Context Initialization -Embedded servlet containers do not directly execute the servlet 3.0+ `javax.servlet.ServletContainerInitializer` interface or Spring's `org.springframework.web.WebApplicationInitializer` interface. +Embedded servlet containers do not directly execute the `jakarta.servlet.ServletContainerInitializer` interface or Spring's `org.springframework.web.WebApplicationInitializer` interface. This is an intentional design decision intended to reduce the risk that third party libraries designed to run inside a war may break Spring Boot applications. If you need to perform servlet context initialization in a Spring Boot application, you should register a bean that implements the `org.springframework.boot.web.servlet.ServletContextInitializer` interface. 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 3712cbc09a..8421bd3fa5 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 @@ -19,13 +19,13 @@ package org.springframework.boot.docs.actuator.cloudfoundry.customcontextpath; import java.io.IOException; import java.util.Collections; -import javax.servlet.GenericServlet; -import javax.servlet.Servlet; -import javax.servlet.ServletContainerInitializer; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.apache.catalina.Host; import org.apache.catalina.core.StandardContext; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/nosql/elasticsearch/connectingusingspringdata/MyBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/nosql/elasticsearch/connectingusingspringdata/MyBean.java index d6d9f7833e..bc8eec0e32 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/nosql/elasticsearch/connectingusingspringdata/MyBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/nosql/elasticsearch/connectingusingspringdata/MyBean.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.data.nosql.elasticsearch.connectingusingspringdata; -import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; +import org.springframework.data.elasticsearch.backend.elasticsearch7.ElasticsearchRestTemplate; import org.springframework.stereotype.Component; @Component diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/sql/jpaandspringdata/entityclasses/City.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/sql/jpaandspringdata/entityclasses/City.java index 04b849000f..5fa3bdd562 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/sql/jpaandspringdata/entityclasses/City.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/sql/jpaandspringdata/entityclasses/City.java @@ -18,10 +18,10 @@ package org.springframework.boot.docs.data.sql.jpaandspringdata.entityclasses; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; @Entity public class City implements Serializable { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/sql/jpaandspringdata/entityclasses/Country.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/sql/jpaandspringdata/entityclasses/Country.java index 508f240b90..60d1b818e8 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/sql/jpaandspringdata/entityclasses/Country.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/data/sql/jpaandspringdata/entityclasses/Country.java @@ -18,10 +18,10 @@ package org.springframework.boot.docs.data.sql.jpaandspringdata.entityclasses; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; import org.hibernate.envers.Audited; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/MyProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/MyProperties.java index 138b8d4ecc..b5cdeb5e7d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/MyProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/MyProperties.java @@ -18,7 +18,7 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat import java.net.InetAddress; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/MyProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/MyProperties.java index fd87eeaf46..fdc8cea4c1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/MyProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/MyProperties.java @@ -18,9 +18,9 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat import java.net.InetAddress; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredwebservices/client/Request.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredwebservices/client/Request.java index 6fa7e99808..42fbbeeaf8 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredwebservices/client/Request.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredwebservices/client/Request.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.features.testing.springbootapplications.autoconfiguredwebservices.client; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "request") class Request { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredwebservices/client/Response.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredwebservices/client/Response.java index 4eecf9c3c6..31a93c5328 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredwebservices/client/Response.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredwebservices/client/Response.java @@ -16,9 +16,9 @@ package org.springframework.boot.docs.features.testing.springbootapplications.autoconfiguredwebservices.client; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "response") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java index b9bb55de1c..6dcc96daab 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.howto.dataaccess.configureacomponentthatisusedbyjpa; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryDependsOnPostProcessor; import org.springframework.stereotype.Component; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.java index b11cb79126..4772f76c53 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.howto.messaging.disabletransactedjmssession; -import javax.jms.ConnectionFactory; +import jakarta.jms.ConnectionFactory; import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springmvc/writexmlrestservice/MyThing.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springmvc/writexmlrestservice/MyThing.java index 7b69c1ee62..d0d7e393e9 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springmvc/writexmlrestservice/MyThing.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springmvc/writexmlrestservice/MyThing.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.howto.springmvc.writexmlrestservice; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement public class MyThing { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/addservletfilterlistener/springbean/disable/MyFilter.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/addservletfilterlistener/springbean/disable/MyFilter.java index 9c448efa72..3655176fe4 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/addservletfilterlistener/springbean/disable/MyFilter.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/addservletfilterlistener/springbean/disable/MyFilter.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.howto.webserver.addservletfilterlistener.springbean.disable; -import javax.servlet.Filter; +import jakarta.servlet.Filter; public abstract class MyFilter implements Filter { 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 218a9cc9d6..dd904984b8 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 @@ -16,46 +16,25 @@ package org.springframework.boot.docs.howto.webserver.enablemultipleconnectorsintomcat; -import java.io.IOException; -import java.net.URL; - import org.apache.catalina.connector.Connector; -import org.apache.coyote.http11.Http11NioProtocol; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.util.ResourceUtils; @Configuration(proxyBeanMethods = false) public class MyTomcatConfiguration { @Bean public WebServerFactoryCustomizer sslConnectorCustomizer() { - return (tomcat) -> tomcat.addAdditionalTomcatConnectors(createSslConnector()); + return (tomcat) -> tomcat.addAdditionalTomcatConnectors(createConnectorConnector()); } - private Connector createSslConnector() { + private Connector createConnectorConnector() { Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol"); - Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler(); - try { - URL keystore = ResourceUtils.getURL("keystore"); - URL truststore = ResourceUtils.getURL("truststore"); - connector.setScheme("https"); - connector.setSecure(true); - connector.setPort(8443); - protocol.setSSLEnabled(true); - protocol.setKeystoreFile(keystore.toString()); - protocol.setKeystorePass("changeit"); - protocol.setTruststoreFile(truststore.toString()); - protocol.setTruststorePass("changeit"); - protocol.setKeyAlias("apitester"); - return connector; - } - catch (IOException ex) { - throw new IllegalStateException("Fail to create ssl connector", ex); - } + connector.setPort(8080); + return connector; } } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/nonxa/MyBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/nonxa/MyBean.java index 2aa30d95b6..a7d843c9b1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/nonxa/MyBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/nonxa/MyBean.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.io.jta.mixingxaandnonxaconnections.nonxa; -import javax.jms.ConnectionFactory; +import jakarta.jms.ConnectionFactory; import org.springframework.beans.factory.annotation.Qualifier; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/primary/MyBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/primary/MyBean.java index d1764296b0..d4d11c7cc3 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/primary/MyBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/primary/MyBean.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.io.jta.mixingxaandnonxaconnections.primary; -import javax.jms.ConnectionFactory; +import jakarta.jms.ConnectionFactory; public class MyBean { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/xa/MyBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/xa/MyBean.java index ea5f0adaf7..ab5c4f63a9 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/xa/MyBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/jta/mixingxaandnonxaconnections/xa/MyBean.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.io.jta.mixingxaandnonxaconnections.xa; -import javax.jms.ConnectionFactory; +import jakarta.jms.ConnectionFactory; import org.springframework.beans.factory.annotation.Qualifier; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/validation/MyBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/validation/MyBean.java index cce98d15e7..654b80b1f3 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/validation/MyBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/validation/MyBean.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.io.validation; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Size; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.java index 0ca31c7e15..fbfbe0633f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.messaging.jms.receiving.custom; -import javax.jms.ConnectionFactory; +import jakarta.jms.ConnectionFactory; import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyMessageConverter.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyMessageConverter.java index f1d007d540..fb943d3cfb 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyMessageConverter.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyMessageConverter.java @@ -16,9 +16,9 @@ package org.springframework.boot.docs.messaging.jms.receiving.custom; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Session; +import jakarta.jms.JMSException; +import jakarta.jms.Message; +import jakarta.jms.Session; import org.springframework.jms.support.converter.MessageConversionException; import org.springframework.jms.support.converter.MessageConverter; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/MyController.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/MyController.java index e677f2d29e..e93f0ba92b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/MyController.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/MyController.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.boot.web.servlet.error.ErrorAttributes; import org.springframework.stereotype.Controller; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/MyControllerAdvice.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/MyControllerAdvice.java index 48b9748ebf..379aab2c28 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/MyControllerAdvice.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/MyControllerAdvice.java @@ -16,8 +16,8 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling; -import javax.servlet.RequestDispatcher; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpages/MyErrorViewResolver.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpages/MyErrorViewResolver.java index 12e814efa1..74210488a5 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpages/MyErrorViewResolver.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpages/MyErrorViewResolver.java @@ -18,7 +18,7 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling.errorp import java.util.Map; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver; import org.springframework.http.HttpStatus; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilter.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilter.java index e92921d848..a30fa7ea82 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilter.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilter.java @@ -18,10 +18,10 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling.errorp import java.io.IOException; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.springframework.web.filter.GenericFilterBean; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilterConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilterConfiguration.java index e9402fe5b7..aebc332bfa 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilterConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilterConfiguration.java @@ -18,7 +18,7 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling.errorp import java.util.EnumSet; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index a809e9c646..086704cfa3 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -41,7 +41,7 @@ bom { ] } } - library("Jakarta Inject", "1.0.5") { + library("Jakarta Inject", "2.0.1") { group("jakarta.inject") { modules = [ "jakarta.inject-api" diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/build.gradle index dda75c8bc8..a3a1cabf52 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/build.gradle @@ -6,7 +6,5 @@ description = "Starter for using Elasticsearch search and analytics engine and S dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) - api("org.springframework.data:spring-data-elasticsearch") { - exclude group: "org.elasticsearch.client", module: "transport" - } -} \ No newline at end of file + api("org.springframework.data:spring-data-elasticsearch") +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/build.gradle index 274823f429..7659d5f8e2 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/build.gradle @@ -7,13 +7,8 @@ description = "Starter for using Spring Data JPA with Hibernate" dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-aop")) api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc")) - api("jakarta.transaction:jakarta.transaction-api") - api("jakarta.persistence:jakarta.persistence-api") - api("org.hibernate:hibernate-core") { - exclude group: "javax.activation", module: "javax.activation-api" - exclude group: "javax.persistence", module: "javax.persistence-api" - exclude group: "javax.xml.bind", module: "jaxb-api" - exclude group: "org.jboss.spec.javax.transaction", module: "jboss-transaction-api_1.2_spec" + api("org.hibernate:hibernate-core-jakarta") { + exclude group: "jakarta.activation", module: "jakarta.activation-api" } api("org.springframework.data:spring-data-jpa") api("org.springframework:spring-aspects") diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle index a771c7c82f..c93edebb0a 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle @@ -5,21 +5,11 @@ plugins { description = "Starter for using Jetty as the embedded servlet container. An alternative to spring-boot-starter-tomcat" dependencies { - api("jakarta.servlet:jakarta.servlet-api") - api("jakarta.websocket:jakarta.websocket-api") api("org.apache.tomcat.embed:tomcat-embed-el") api("org.eclipse.jetty:jetty-servlets") - api("org.eclipse.jetty:jetty-webapp") { - exclude group: "javax.servlet", module: "javax.servlet-api" - } - api("org.eclipse.jetty.websocket:websocket-server") { - exclude group: "javax.servlet", module: "javax.servlet-api" - } - api("org.eclipse.jetty.websocket:javax-websocket-server-impl") { - exclude group: "javax.annotation", module: "javax.annotation-api" - exclude group: "javax.servlet", module: "javax.servlet-api" - exclude group: "javax.websocket", module: "javax.websocket-api" - exclude group: "javax.websocket", module: "javax.websocket-client-api" + api("org.eclipse.jetty:jetty-webapp") + api("org.eclipse.jetty.websocket:websocket-jakarta-server") + api("org.eclipse.jetty.websocket:websocket-jetty-server") { exclude group: "org.eclipse.jetty", module: "jetty-jndi" } } diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle index 9c4d02300b..7387e4c2c1 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle @@ -6,16 +6,13 @@ description = "Starter for using Undertow as the embedded servlet container. An dependencies { api("io.undertow:undertow-core") - api("io.undertow:undertow-servlet") { + api("io.undertow:undertow-servlet-jakartaee9") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" - exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_4.0_spec" } - api("io.undertow:undertow-websockets-jsr") { + api("io.undertow:undertow-websockets-jsr-jakartaee9") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" - exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_4.0_spec" - exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec" + exclude group: "jakarta.websocket", module: "jakarta.websocket-client-api" } - api("jakarta.servlet:jakarta.servlet-api") api("jakarta.websocket:jakarta.websocket-api") api("org.apache.tomcat.embed:tomcat-embed-el") } diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle index c8e2854b60..a284e23f1d 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle @@ -7,9 +7,9 @@ description = "Starter for using Spring Web Services" dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) api("com.sun.xml.messaging.saaj:saaj-impl") - api("jakarta.xml.ws:jakarta.xml.ws-api") { - exclude group: "jakarta.activation", module: "jakarta.activation-api" - } + api("jakarta.xml.ws:jakarta.xml.ws-api") api("org.springframework:spring-oxm") - api("org.springframework.ws:spring-ws-core") + api("org.springframework.ws:spring-ws-core") { + exclude group: "jakarta.servlet", module: "jakarta.servlet-api" + } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle index 0745c03a1c..454c62176b 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -23,13 +23,7 @@ dependencies { optional("net.sourceforge.htmlunit:htmlunit") { exclude group: "commons-logging", module: "commons-logging" } - optional("org.hibernate:hibernate-core") { - exclude group: "commons-logging", module: "commons-logging" - exclude group: "javax.activation", module: "javax.activation-api" - exclude group: "javax.persistence", module: "javax.persistence-api" - exclude group: "javax.xml.bind", module: "jaxb-api" - exclude group: "org.jboss.spec.javax.transaction", module: "jboss-transaction-api_1.2_spec" - } + optional("org.hibernate:hibernate-core-jakarta") optional("org.junit.jupiter:junit-jupiter-api") optional("org.seleniumhq.selenium:htmlunit-driver") { exclude group: "commons-logging", module: "commons-logging" diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java index 183657b91e..12787f2d4f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java @@ -19,7 +19,7 @@ package org.springframework.boot.test.autoconfigure.json; import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import javax.json.bind.Jsonb; +import jakarta.json.bind.Jsonb; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManager.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManager.java index 0a6c993074..0c11bfcace 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManager.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManager.java @@ -16,9 +16,9 @@ package org.springframework.boot.test.autoconfigure.orm.jpa; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.PersistenceUnitUtil; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.PersistenceUnitUtil; import org.springframework.orm.jpa.EntityManagerFactoryUtils; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerAutoConfiguration.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerAutoConfiguration.java index a1a1691a70..05d2083932 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.test.autoconfigure.orm.jpa; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java index 20d4e0e6d0..53f87ff56a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTypeExcludeFilter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTypeExcludeFilter.java index dca2350b12..6085cbbc32 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTypeExcludeFilter.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTypeExcludeFilter.java @@ -63,7 +63,7 @@ public final class WebMvcTypeExcludeFilter extends StandardAnnotationCustomizabl includes.add(JsonComponent.class); includes.add(WebMvcConfigurer.class); includes.add(WebMvcRegistrations.class); - includes.add(javax.servlet.Filter.class); + includes.add(jakarta.servlet.Filter.class); includes.add(FilterRegistrationBean.class); includes.add(DelegatingFilterProxyRegistrationBean.class); includes.add(HandlerMethodArgumentResolver.class); diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/SpringBootDependencyInjectionTestExecutionListenerPostConstructIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/SpringBootDependencyInjectionTestExecutionListenerPostConstructIntegrationTests.java index 6a3e1be014..e53be2aa47 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/SpringBootDependencyInjectionTestExecutionListenerPostConstructIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/SpringBootDependencyInjectionTestExecutionListenerPostConstructIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -21,7 +21,7 @@ import java.io.StringWriter; import java.util.ArrayList; import java.util.List; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/ExampleRepository.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/ExampleRepository.java index 76e28fd542..9ac32aeba4 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/ExampleRepository.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/ExampleRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.Collection; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/ExampleEntity.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/ExampleEntity.java index ce1c350b14..b163c93538 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/ExampleEntity.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/ExampleEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,9 @@ package org.springframework.boot.test.autoconfigure.orm.jpa; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; /** * Example entity used with {@link DataJpaTest @DataJpaTest} tests. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerTests.java index 330f27b3a1..91ce2a6f71 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,9 @@ package org.springframework.boot.test.autoconfigure.orm.jpa; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.PersistenceUnitUtil; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.PersistenceUnitUtil; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizerTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizerTests.java index 4ae8388bc9..a927a40c2c 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizerTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -22,12 +22,12 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServlet; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServlet; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/AfterSecurityFilter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/AfterSecurityFilter.java index 86dcf3e538..c97122a7fb 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/AfterSecurityFilter.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/AfterSecurityFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -19,12 +19,12 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc; import java.io.IOException; import java.security.Principal; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.core.Ordered; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleController3.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleController3.java index 225e3edb20..444acb4891 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleController3.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleController3.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Size; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.stereotype.Controller; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleFilter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleFilter.java index 0899634328..1f03552bfb 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleFilter.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,13 +18,13 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestAllControllersIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestAllControllersIntegrationTests.java index c5065ddd99..2c2fe21cd2 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestAllControllersIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestAllControllersIntegrationTests.java @@ -16,7 +16,7 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc; -import javax.validation.ConstraintViolationException; +import jakarta.validation.ConstraintViolationException; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestServletContextResourceTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestServletContextResourceTests.java index d2bd7a3497..4a94f3ab7f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestServletContextResourceTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestServletContextResourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,7 +19,7 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc; import java.net.MalformedURLException; import java.net.URL; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWithWebAppConfigurationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWithWebAppConfigurationTests.java index a3d447d4a8..581e823e2f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWithWebAppConfigurationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWithWebAppConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,7 +19,7 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc; import java.net.MalformedURLException; import java.net.URL; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/client/Request.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/client/Request.java index 8fead68404..a6bd952fce 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/client/Request.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/client/Request.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.test.autoconfigure.webservices.client; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; /** * Test request. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/client/Response.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/client/Response.java index 82e5f923e8..7ee4760231 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/client/Response.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/client/Response.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,9 @@ package org.springframework.boot.test.autoconfigure.webservices.client; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlRootElement; /** * Test response. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/server/Request.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/server/Request.java index c9f8ea50b3..4ff7ba8f1d 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/server/Request.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/server/Request.java @@ -16,8 +16,8 @@ package org.springframework.boot.test.autoconfigure.webservices.server; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; /** * Test request. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/server/Response.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/server/Response.java index 549572912f..f37cafc0eb 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/server/Response.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/webservices/server/Response.java @@ -16,8 +16,8 @@ package org.springframework.boot.test.autoconfigure.webservices.server; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; /** * Test response. diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java index 205949f4c0..31ae6e769a 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java @@ -82,7 +82,7 @@ import org.springframework.util.StringUtils; */ public class SpringBootTestContextBootstrapper extends DefaultTestContextBootstrapper { - private static final String[] WEB_ENVIRONMENT_CLASSES = { "javax.servlet.Servlet", + private static final String[] WEB_ENVIRONMENT_CLASSES = { "jakarta.servlet.Servlet", "org.springframework.web.context.ConfigurableWebApplicationContext" }; private static final String REACTIVE_WEB_ENVIRONMENT_CLASS = "org.springframework." diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java index ad876ec97e..988e5d3032 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,7 +19,7 @@ package org.springframework.boot.test.json; import java.io.IOException; import java.io.Reader; -import javax.json.bind.Jsonb; +import jakarta.json.bind.Jsonb; import org.springframework.beans.factory.ObjectFactory; import org.springframework.core.ResolvableType; 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 a7ff851e6f..2849e3a4e7 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.test.context; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderMockMvcTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderMockMvcTests.java index 103d757d55..e7982625a7 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderMockMvcTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderMockMvcTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.test.context; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockTests.java index 97d4481755..8e64c1b5df 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.test.context; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockWithWebAppConfigurationTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockWithWebAppConfigurationTests.java index 9b2210aa90..e165b2f3aa 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockWithWebAppConfigurationTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockWithWebAppConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.test.context; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java index 92237238c2..cfd7090cd4 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java @@ -18,8 +18,8 @@ package org.springframework.boot.test.json; import java.util.List; -import javax.json.bind.Jsonb; -import javax.json.bind.JsonbBuilder; +import jakarta.json.bind.Jsonb; +import jakarta.json.bind.JsonbBuilder; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/web/SpringBootMockServletContextTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/web/SpringBootMockServletContextTests.java index a738ddf560..e618b86259 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/web/SpringBootMockServletContextTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/web/SpringBootMockServletContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -21,7 +21,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLDecoder; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; 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 c1f24ab379..79cda99e3b 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,10 +19,10 @@ package org.springframework.boot.test.web.client; import java.io.IOException; import java.io.PrintWriter; -import javax.servlet.GenericServlet; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.junit.jupiter.api.Test; 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 8c592f9e88..5c1858864c 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,10 +19,10 @@ package org.springframework.boot.test.web.client; import java.io.IOException; import java.io.PrintWriter; -import javax.servlet.GenericServlet; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataGenerationEnvironment.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataGenerationEnvironment.java index 4e5ad965c5..c4cf34c06b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataGenerationEnvironment.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataGenerationEnvironment.java @@ -63,7 +63,7 @@ class MetadataGenerationEnvironment { excludes.add("java.io.PrintWriter"); excludes.add("java.lang.ClassLoader"); excludes.add("java.util.concurrent.ThreadFactory"); - excludes.add("javax.jms.XAConnectionFactory"); + excludes.add("jakarta.jms.XAConnectionFactory"); excludes.add("javax.sql.DataSource"); excludes.add("javax.sql.XADataSource"); excludes.add("org.apache.tomcat.jdbc.pool.PoolConfiguration"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/AnnotatedGetter.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/AnnotatedGetter.java index 1bb731af53..1cfba404cb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/AnnotatedGetter.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/AnnotatedGetter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.configurationsample.specific; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; import org.springframework.boot.configurationsample.ConfigurationProperties; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java index bd33959159..c8e9bda5b5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java @@ -63,7 +63,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests { }).hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context") .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-core") .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") - .hasEntryWithNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-4") + .hasEntryWithNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-5") .hasEntryWithName("BOOT-INF/classes/org/test/SampleApplication.class") .hasEntryWithName("org/springframework/boot/loader/JarLauncher.class"); assertThat(buildLog(project)).contains("Replacing main artifact with repackaged archive") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java index 979baa0682..ad48c78297 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java @@ -56,7 +56,7 @@ class WarIntegrationTests extends AbstractArchiveIntegrationTests { .hasEntryWithNameStartingWith("WEB-INF/lib/spring-context") .hasEntryWithNameStartingWith("WEB-INF/lib/spring-core") .hasEntryWithNameStartingWith("WEB-INF/lib/spring-jcl") - .hasEntryWithNameStartingWith("WEB-INF/lib-provided/jakarta.servlet-api-4") + .hasEntryWithNameStartingWith("WEB-INF/lib-provided/jakarta.servlet-api-5") .hasEntryWithName("org/springframework/boot/loader/WarLauncher.class") .hasEntryWithName("WEB-INF/classes/org/test/SampleApplication.class") .hasEntryWithName("index.html") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/src/main/java/org/test/SampleApplication.java index 56892c15b9..1d84a4b298 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/src/main/java/org/test/SampleApplication.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/src/main/java/org/test/SampleApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -22,7 +22,7 @@ public class SampleApplication { if (isClassPresent("org.apache.log4j.Logger")) { throw new IllegalStateException("Log4j was present and should not"); } - if (isClassPresent("javax.servlet.Servlet")) { + if (isClassPresent("jakarta.servlet.Servlet")) { throw new IllegalStateException("servlet-api was present and should not"); } System.out.println("I haz been run"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/ExampleFilter.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/ExampleFilter.java index 2123789471..0df0692c82 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/ExampleFilter.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/ExampleFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,12 +18,12 @@ package org.springframework.boot.testsupport.web.servlet; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; /** * Simple example Filter used for testing. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/ExampleServlet.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/ExampleServlet.java index a3b7b209d5..6a9a349184 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/ExampleServlet.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/ExampleServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,11 +18,11 @@ package org.springframework.boot.testsupport.web.servlet; import java.io.IOException; -import javax.servlet.GenericServlet; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.springframework.util.StreamUtils; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java index 7c8d35bd03..e4687d793f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java @@ -23,13 +23,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.servlet.Filter; -import javax.servlet.FilterRegistration; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration; -import javax.servlet.SessionCookieConfig; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterRegistration; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRegistration; +import jakarta.servlet.SessionCookieConfig; import org.springframework.mock.web.MockSessionCookieConfig; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java index dba1a03e77..5cfdd53c0a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -30,7 +30,7 @@ import static org.hamcrest.Matchers.isA; @ClassPathExclusions("hibernate-validator-*.jar") class ModifiedClassPathExtensionExclusionsTests { - private static final String EXCLUDED_RESOURCE = "META-INF/services/javax.validation.spi.ValidationProvider"; + private static final String EXCLUDED_RESOURCE = "META-INF/services/jakarta.validation.spi.ValidationProvider"; @Test void entriesAreFilteredFromTestClassClassLoader() { diff --git a/spring-boot-project/spring-boot/build.gradle b/spring-boot-project/spring-boot/build.gradle index b8e19b0600..3b96ab0bf7 100644 --- a/spring-boot-project/spring-boot/build.gradle +++ b/spring-boot-project/spring-boot/build.gradle @@ -35,9 +35,8 @@ dependencies { optional("io.r2dbc:r2dbc-pool") optional("io.rsocket:rsocket-core") optional("io.rsocket:rsocket-transport-netty") - optional("io.undertow:undertow-servlet") { + optional("io.undertow:undertow-servlet-jakartaee9") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" - exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_4.0_spec" } optional("jakarta.jms:jakarta.jms-api") optional("jakarta.persistence:jakarta.persistence-api") @@ -72,12 +71,7 @@ dependencies { } optional("org.flywaydb:flyway-core") optional("org.hamcrest:hamcrest-library") - optional("org.hibernate:hibernate-core") { - exclude(group: "javax.activation", module: "javax.activation-api") - exclude(group: "javax.persistence", module: "javax.persistence-api") - exclude(group: "javax.xml.bind", module: "jaxb-api") - exclude(group: "org.jboss.spec.javax.transaction", module: "jboss-transaction-api_1.2_spec") - } + optional("org.hibernate:hibernate-core-jakarta") optional("org.hibernate.validator:hibernate-validator") optional("org.liquibase:liquibase-core") { exclude(group: "javax.xml.bind", module: "jaxb-api") @@ -94,7 +88,13 @@ dependencies { optional("org.springframework:spring-webflux") optional("org.springframework:spring-webmvc") optional("org.springframework.security:spring-security-web") - optional("org.springframework.ws:spring-ws-core") + optional("org.springframework.ws:spring-ws-core") { + exclude group: "com.sun.mail", module: "jakarta.mail" + exclude group: "jakarta.platform", module: "jakarta.jakartaee-api" + exclude group: "org.eclipse.jetty", module: "jetty-server" + exclude group: "org.eclipse.jetty", module: "jetty-servlet" + exclude group: "jakarta.mail", module: "jakarta.mail-api" + } optional("org.yaml:snakeyaml") optional("org.jetbrains.kotlin:kotlin-reflect") optional("org.jetbrains.kotlin:kotlin-stdlib") @@ -110,7 +110,7 @@ dependencies { testImplementation("com.sun.xml.messaging.saaj:saaj-impl") testImplementation("io.projectreactor:reactor-test") testImplementation("io.r2dbc:r2dbc-h2") - testImplementation("jakarta.persistence:jakarta.persistence-api") + testImplementation("jakarta.inject:jakarta.inject-api") testImplementation("jakarta.xml.ws:jakarta.xml.ws-api") testImplementation("mysql:mysql-connector-java") testImplementation("net.sourceforge.jtds:jtds") diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java index b9c31d989f..8597f78826 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java @@ -45,7 +45,7 @@ public enum WebApplicationType { */ REACTIVE; - private static final String[] SERVLET_INDICATOR_CLASSES = { "javax.servlet.Servlet", + private static final String[] SERVLET_INDICATOR_CLASSES = { "jakarta.servlet.Servlet", "org.springframework.web.context.ConfigurableWebApplicationContext" }; private static final String WEBMVC_INDICATOR_CLASS = "org.springframework.web.servlet.DispatcherServlet"; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesJsr303Validator.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesJsr303Validator.java index f926b98933..5308a71b53 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesJsr303Validator.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesJsr303Validator.java @@ -32,8 +32,8 @@ import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; */ final class ConfigurationPropertiesJsr303Validator implements Validator { - private static final String[] VALIDATOR_CLASSES = { "javax.validation.Validator", - "javax.validation.ValidatorFactory", "javax.validation.bootstrap.GenericBootstrap" }; + private static final String[] VALIDATOR_CLASSES = { "jakarta.validation.Validator", + "jakarta.validation.ValidatorFactory", "jakarta.validation.bootstrap.GenericBootstrap" }; private final Delegate delegate; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/ValidationExceptionFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/ValidationExceptionFailureAnalyzer.java index 90fb65dae3..47b849308b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/ValidationExceptionFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/ValidationExceptionFailureAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.diagnostics.analyzer; -import javax.validation.ValidationException; +import jakarta.validation.ValidationException; import org.springframework.boot.diagnostics.AbstractFailureAnalyzer; import org.springframework.boot.diagnostics.FailureAnalysis; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/XADataSourceWrapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/XADataSourceWrapper.java index 800b14fe35..c3771996e4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/XADataSourceWrapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/XADataSourceWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,8 @@ package org.springframework.boot.jdbc; import javax.sql.DataSource; import javax.sql.XADataSource; -import javax.transaction.TransactionManager; + +import jakarta.transaction.TransactionManager; /** * Strategy interface used to wrap an {@link XADataSource} enrolling it with a JTA diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java index bfcd401931..d93dfa62c8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,9 @@ package org.springframework.boot.jms; -import javax.jms.ConnectionFactory; -import javax.jms.XAConnectionFactory; -import javax.transaction.TransactionManager; +import jakarta.jms.ConnectionFactory; +import jakarta.jms.XAConnectionFactory; +import jakarta.transaction.TransactionManager; /** * Strategy interface used to wrap a JMS {@link XAConnectionFactory} enrolling it with a diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/JpaDatabaseInitializerDetector.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/JpaDatabaseInitializerDetector.java index 81da74c6a1..aaff7d27e1 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/JpaDatabaseInitializerDetector.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/JpaDatabaseInitializerDetector.java @@ -21,7 +21,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/JpaDependsOnDatabaseInitializationDetector.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/JpaDependsOnDatabaseInitializationDetector.java index 327eadada2..27dc8c9c09 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/JpaDependsOnDatabaseInitializationDetector.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/JpaDependsOnDatabaseInitializationDetector.java @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import org.springframework.boot.sql.init.dependency.AbstractBeansOfTypeDependsOnDatabaseInitializationDetector; import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringJtaPlatform.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringJtaPlatform.java index 640b641431..8622e0cdcb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringJtaPlatform.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringJtaPlatform.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.orm.jpa.hibernate; -import javax.transaction.TransactionManager; -import javax.transaction.UserTransaction; +import jakarta.transaction.TransactionManager; +import jakarta.transaction.UserTransaction; import org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcher.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcher.java index a56626e873..6946817cca 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcher.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.security.servlet; import java.util.function.Supplier; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/validation/MessageInterpolatorFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/validation/MessageInterpolatorFactory.java index 236a14af2c..cd7f53bb91 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/validation/MessageInterpolatorFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/validation/MessageInterpolatorFactory.java @@ -20,9 +20,9 @@ import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; -import javax.validation.MessageInterpolator; -import javax.validation.Validation; -import javax.validation.ValidationException; +import jakarta.validation.MessageInterpolator; +import jakarta.validation.Validation; +import jakarta.validation.ValidationException; import org.springframework.beans.BeanUtils; import org.springframework.beans.BeansException; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/validation/MessageSourceMessageInterpolator.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/validation/MessageSourceMessageInterpolator.java index df797dc9b1..e63ce39c98 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/validation/MessageSourceMessageInterpolator.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/validation/MessageSourceMessageInterpolator.java @@ -20,7 +20,7 @@ import java.util.LinkedHashSet; import java.util.Locale; import java.util.Set; -import javax.validation.MessageInterpolator; +import jakarta.validation.MessageInterpolator; import org.springframework.context.MessageSource; import org.springframework.context.i18n.LocaleContextHolder; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JasperInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JasperInitializer.java index 7d80985329..0fe0ec4bf5 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JasperInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JasperInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -23,7 +23,7 @@ import java.net.URLConnection; import java.net.URLStreamHandler; import java.net.URLStreamHandlerFactory; -import javax.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletContainerInitializer; import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory; import org.eclipse.jetty.util.component.AbstractLifeCycle; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedErrorHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedErrorHandler.java index f07f95d926..068616a5dc 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedErrorHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedErrorHandler.java @@ -21,9 +21,9 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Set; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.server.Request; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyHandlerWrappers.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyHandlerWrappers.java index a928ef1114..1ddeef6216 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyHandlerWrappers.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyHandlerWrappers.java @@ -18,9 +18,9 @@ package org.springframework.boot.web.embedded.jetty; import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.server.Request; @@ -46,14 +46,6 @@ final class JettyHandlerWrappers { for (HttpMethod httpMethod : HttpMethod.values()) { handler.addIncludedMethods(httpMethod.name()); } - if (compression.getExcludedUserAgents() != null) { - try { - handler.setExcludedAgentPatterns(compression.getExcludedUserAgents()); - } - catch (NoSuchMethodError ex) { - // Jetty 10 does not support User-Agent-based exclusions - } - } return handler; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java index 0fbaf1a37b..f4171adfe4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java @@ -19,9 +19,9 @@ package org.springframework.boot.web.embedded.jetty; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.lang.reflect.Method; import java.net.InetSocketAddress; import java.net.MalformedURLException; +import java.net.URI; import java.net.URL; import java.nio.channels.ReadableByteChannel; import java.time.Duration; @@ -33,11 +33,11 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; -import javax.servlet.ServletException; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; import org.eclipse.jetty.http.HttpCookie; import org.eclipse.jetty.http.MimeTypes; @@ -84,7 +84,6 @@ import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.ResourceLoader; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; -import org.springframework.util.ReflectionUtils; import org.springframework.util.StringUtils; /** @@ -332,15 +331,7 @@ public class JettyServletWebServerFactory extends AbstractServletWebServerFactor holder.setInitOrder(1); context.getServletHandler().addServletWithMapping(holder, "/"); ServletMapping servletMapping = context.getServletHandler().getServletMapping("/"); - try { - servletMapping.setDefault(true); - } - catch (NoSuchMethodError ex) { - // Jetty 10 - Method setFromDefaultDescriptor = ReflectionUtils.findMethod(servletMapping.getClass(), - "setFromDefaultDescriptor", boolean.class); - ReflectionUtils.invokeMethod(setFromDefaultDescriptor, servletMapping, true); - } + servletMapping.setFromDefaultDescriptor(true); } /** @@ -601,9 +592,8 @@ public class JettyServletWebServerFactory extends AbstractServletWebServerFactor } @Override - @Deprecated - public URL getURL() { - return this.delegate.getURL(); + public URI getURI() { + return this.delegate.getURI(); } @Override diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/ServletContextInitializerConfiguration.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/ServletContextInitializerConfiguration.java index a3a1a714c2..d4f0ecf494 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/ServletContextInitializerConfiguration.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/ServletContextInitializerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.embedded.jetty; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.Configuration; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizer.java index 77eb0e09c2..8c9ebee325 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,7 @@ package org.springframework.boot.web.embedded.tomcat; import org.apache.catalina.connector.Connector; import org.apache.coyote.ProtocolHandler; -import org.apache.coyote.UpgradeProtocol; import org.apache.coyote.http11.AbstractHttp11Protocol; -import org.apache.coyote.http2.Http2Protocol; import org.springframework.boot.web.server.Compression; import org.springframework.util.StringUtils; @@ -46,21 +44,6 @@ class CompressionConnectorCustomizer implements TomcatConnectorCustomizer { if (handler instanceof AbstractHttp11Protocol) { customize((AbstractHttp11Protocol) handler); } - for (UpgradeProtocol upgradeProtocol : connector.findUpgradeProtocols()) { - if (upgradeProtocol instanceof Http2Protocol) { - customize((Http2Protocol) upgradeProtocol); - } - } - } - } - - private void customize(Http2Protocol protocol) { - Compression compression = this.compression; - protocol.setCompression("on"); - protocol.setCompressionMinSize(getMinResponseSize(compression)); - protocol.setCompressibleMimeType(getMimeTypes(compression)); - if (this.compression.getExcludedUserAgents() != null) { - protocol.setNoCompressionUserAgents(getExcludedUserAgents()); } } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java index 959844cb8f..144a47fffb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -19,11 +19,12 @@ package org.springframework.boot.web.embedded.tomcat; import java.io.FileNotFoundException; import org.apache.catalina.connector.Connector; -import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory; import org.apache.coyote.ProtocolHandler; import org.apache.coyote.http11.AbstractHttp11JsseProtocol; import org.apache.coyote.http11.Http11NioProtocol; import org.apache.tomcat.util.net.SSLHostConfig; +import org.apache.tomcat.util.net.SSLHostConfigCertificate; +import org.apache.tomcat.util.net.SSLHostConfigCertificate.Type; import org.springframework.boot.web.server.Ssl; import org.springframework.boot.web.server.SslStoreProvider; @@ -67,56 +68,63 @@ class SslConnectorCustomizer implements TomcatConnectorCustomizer { */ protected void configureSsl(AbstractHttp11JsseProtocol protocol, Ssl ssl, SslStoreProvider sslStoreProvider) { protocol.setSSLEnabled(true); - protocol.setSslProtocol(ssl.getProtocol()); - configureSslClientAuth(protocol, ssl); + SSLHostConfig sslHostConfig = new SSLHostConfig(); + sslHostConfig.setHostName(protocol.getDefaultSSLHostConfigName()); + sslHostConfig.setSslProtocol(ssl.getProtocol()); + protocol.addSslHostConfig(sslHostConfig); + configureSslClientAuth(sslHostConfig, ssl); + SSLHostConfigCertificate certificate = new SSLHostConfigCertificate(sslHostConfig, Type.UNDEFINED); if (ssl.getKeyStorePassword() != null) { - protocol.setKeystorePass(ssl.getKeyStorePassword()); + certificate.setCertificateKeystorePassword(ssl.getKeyStorePassword()); } if (ssl.getKeyPassword() != null) { - protocol.setKeyPass(ssl.getKeyPassword()); + certificate.setCertificateKeyPassword(ssl.getKeyPassword()); } - protocol.setKeyAlias(ssl.getKeyAlias()); + if (ssl.getKeyAlias() != null) { + certificate.setCertificateKeyAlias(ssl.getKeyAlias()); + } + sslHostConfig.addCertificate(certificate); String ciphers = StringUtils.arrayToCommaDelimitedString(ssl.getCiphers()); if (StringUtils.hasText(ciphers)) { - protocol.setCiphers(ciphers); + sslHostConfig.setCiphers(ciphers); + } + configureEnabledProtocols(protocol, ssl); + if (sslStoreProvider != null) { + configureSslStoreProvider(protocol, sslHostConfig, certificate, sslStoreProvider); } + else { + configureSslKeyStore(certificate, ssl); + configureSslTrustStore(sslHostConfig, ssl); + } + } + + private void configureEnabledProtocols(AbstractHttp11JsseProtocol protocol, Ssl ssl) { if (ssl.getEnabledProtocols() != null) { for (SSLHostConfig sslHostConfig : protocol.findSslHostConfigs()) { sslHostConfig.setProtocols(StringUtils.arrayToCommaDelimitedString(ssl.getEnabledProtocols())); } } - if (sslStoreProvider != null) { - configureSslStoreProvider(protocol, sslStoreProvider); - } - else { - configureSslKeyStore(protocol, ssl); - configureSslTrustStore(protocol, ssl); - } } - private void configureSslClientAuth(AbstractHttp11JsseProtocol protocol, Ssl ssl) { + private void configureSslClientAuth(SSLHostConfig config, Ssl ssl) { if (ssl.getClientAuth() == Ssl.ClientAuth.NEED) { - protocol.setClientAuth(Boolean.TRUE.toString()); + config.setCertificateVerification("required"); } else if (ssl.getClientAuth() == Ssl.ClientAuth.WANT) { - protocol.setClientAuth("want"); + config.setCertificateVerification("optional"); } } - protected void configureSslStoreProvider(AbstractHttp11JsseProtocol protocol, - SslStoreProvider sslStoreProvider) { + protected void configureSslStoreProvider(AbstractHttp11JsseProtocol protocol, SSLHostConfig sslHostConfig, + SSLHostConfigCertificate certificate, SslStoreProvider sslStoreProvider) { Assert.isInstanceOf(Http11NioProtocol.class, protocol, "SslStoreProvider can only be used with Http11NioProtocol"); - TomcatURLStreamHandlerFactory instance = TomcatURLStreamHandlerFactory.getInstance(); - instance.addUserFactory(new SslStoreProviderUrlStreamHandlerFactory(sslStoreProvider)); try { if (sslStoreProvider.getKeyStore() != null) { - protocol.setKeystorePass(""); - protocol.setKeystoreFile(SslStoreProviderUrlStreamHandlerFactory.KEY_STORE_URL); + certificate.setCertificateKeystore(sslStoreProvider.getKeyStore()); } if (sslStoreProvider.getTrustStore() != null) { - protocol.setTruststorePass(""); - protocol.setTruststoreFile(SslStoreProviderUrlStreamHandlerFactory.TRUST_STORE_URL); + sslHostConfig.setTrustStore(sslStoreProvider.getTrustStore()); } } catch (Exception ex) { @@ -124,38 +132,38 @@ class SslConnectorCustomizer implements TomcatConnectorCustomizer { } } - private void configureSslKeyStore(AbstractHttp11JsseProtocol protocol, Ssl ssl) { + private void configureSslKeyStore(SSLHostConfigCertificate certificate, Ssl ssl) { try { - protocol.setKeystoreFile(ResourceUtils.getURL(ssl.getKeyStore()).toString()); + certificate.setCertificateKeystoreFile(ResourceUtils.getURL(ssl.getKeyStore()).toString()); } catch (Exception ex) { throw new WebServerException("Could not load key store '" + ssl.getKeyStore() + "'", ex); } if (ssl.getKeyStoreType() != null) { - protocol.setKeystoreType(ssl.getKeyStoreType()); + certificate.setCertificateKeystoreType(ssl.getKeyStoreType()); } if (ssl.getKeyStoreProvider() != null) { - protocol.setKeystoreProvider(ssl.getKeyStoreProvider()); + certificate.setCertificateKeystoreProvider(ssl.getKeyStoreProvider()); } } - private void configureSslTrustStore(AbstractHttp11JsseProtocol protocol, Ssl ssl) { + private void configureSslTrustStore(SSLHostConfig sslHostConfig, Ssl ssl) { if (ssl.getTrustStore() != null) { try { - protocol.setTruststoreFile(ResourceUtils.getURL(ssl.getTrustStore()).toString()); + sslHostConfig.setTruststoreFile(ResourceUtils.getURL(ssl.getTrustStore()).toString()); } catch (FileNotFoundException ex) { throw new WebServerException("Could not load trust store: " + ex.getMessage(), ex); } } if (ssl.getTrustStorePassword() != null) { - protocol.setTruststorePass(ssl.getTrustStorePassword()); + sslHostConfig.setTruststorePassword(ssl.getTrustStorePassword()); } if (ssl.getTrustStoreType() != null) { - protocol.setTruststoreType(ssl.getTrustStoreType()); + sslHostConfig.setTruststoreType(ssl.getTrustStoreType()); } if (ssl.getTrustStoreProvider() != null) { - protocol.setTruststoreProvider(ssl.getTrustStoreProvider()); + sslHostConfig.setTruststoreProvider(ssl.getTrustStoreProvider()); } } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslStoreProviderUrlStreamHandlerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslStoreProviderUrlStreamHandlerFactory.java deleted file mode 100644 index be27b21095..0000000000 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslStoreProviderUrlStreamHandlerFactory.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.web.embedded.tomcat; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLStreamHandler; -import java.net.URLStreamHandlerFactory; -import java.security.KeyStore; - -import org.springframework.boot.web.server.SslStoreProvider; - -/** - * A {@link URLStreamHandlerFactory} that provides a {@link URLStreamHandler} for - * accessing an {@link SslStoreProvider}'s key store and trust store from a URL. - * - * @author Andy Wilkinson - */ -class SslStoreProviderUrlStreamHandlerFactory implements URLStreamHandlerFactory { - - private static final String PROTOCOL = "springbootssl"; - - private static final String KEY_STORE_PATH = "keyStore"; - - static final String KEY_STORE_URL = PROTOCOL + ":" + KEY_STORE_PATH; - - private static final String TRUST_STORE_PATH = "trustStore"; - - static final String TRUST_STORE_URL = PROTOCOL + ":" + TRUST_STORE_PATH; - - private final SslStoreProvider sslStoreProvider; - - SslStoreProviderUrlStreamHandlerFactory(SslStoreProvider sslStoreProvider) { - this.sslStoreProvider = sslStoreProvider; - } - - @Override - public URLStreamHandler createURLStreamHandler(String protocol) { - if (PROTOCOL.equals(protocol)) { - return new URLStreamHandler() { - - @Override - protected URLConnection openConnection(URL url) throws IOException { - try { - if (KEY_STORE_PATH.equals(url.getPath())) { - return new KeyStoreUrlConnection(url, - SslStoreProviderUrlStreamHandlerFactory.this.sslStoreProvider.getKeyStore()); - } - if (TRUST_STORE_PATH.equals(url.getPath())) { - return new KeyStoreUrlConnection(url, - SslStoreProviderUrlStreamHandlerFactory.this.sslStoreProvider.getTrustStore()); - } - } - catch (Exception ex) { - throw new IOException(ex); - } - throw new IOException("Invalid path: " + url.getPath()); - } - }; - } - return null; - } - - private static final class KeyStoreUrlConnection extends URLConnection { - - private final KeyStore keyStore; - - private KeyStoreUrlConnection(URL url, KeyStore keyStore) { - super(url); - this.keyStore = keyStore; - } - - @Override - public void connect() throws IOException { - - } - - @Override - public InputStream getInputStream() throws IOException { - - try { - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - this.keyStore.store(stream, new char[0]); - return new ByteArrayInputStream(stream.toByteArray()); - } - catch (Exception ex) { - throw new IOException(ex); - } - } - - } - -} diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TldPatterns.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TldPatterns.java index 0b8b07b564..04b16d2976 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TldPatterns.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TldPatterns.java @@ -72,6 +72,7 @@ final class TldPatterns { skipPatterns.add("hibernate*.jar"); skipPatterns.add("httpclient*.jar"); skipPatterns.add("icu4j-*.jar"); + skipPatterns.add("jakartaee-migration-*.jar"); skipPatterns.add("jasper-el.jar"); skipPatterns.add("jasper.jar"); skipPatterns.add("jaspic-api.jar"); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatEmbeddedContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatEmbeddedContext.java index 3ed36e2d59..907b1af15b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatEmbeddedContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatEmbeddedContext.java @@ -22,7 +22,7 @@ import java.util.Map; import java.util.TreeMap; import java.util.stream.Stream; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import org.apache.catalina.Container; import org.apache.catalina.LifecycleException; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java index 9e1bced220..d66c658a19 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java @@ -33,9 +33,9 @@ import java.util.Locale; import java.util.Set; import java.util.stream.Collectors; -import javax.servlet.ServletContainerInitializer; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.ServletContainerInitializer; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; import org.apache.catalina.Context; import org.apache.catalina.Engine; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatStarter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatStarter.java index 6b360b90ca..bde72e36f6 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatStarter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatStarter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,9 @@ package org.springframework.boot.web.embedded.tomcat; import java.util.Set; -import javax.servlet.ServletContainerInitializer; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; +import jakarta.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/DeploymentManagerHttpHandlerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/DeploymentManagerHttpHandlerFactory.java index b9312c7bca..56f1972e79 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/DeploymentManagerHttpHandlerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/DeploymentManagerHttpHandlerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -19,7 +19,7 @@ package org.springframework.boot.web.embedded.undertow; import java.io.Closeable; import java.io.IOException; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java index f60c40b486..67b746b0fc 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java @@ -34,9 +34,9 @@ import java.util.Map; import java.util.Set; import java.util.regex.Pattern; -import javax.servlet.ServletContainerInitializer; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; +import jakarta.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; import io.undertow.Undertow.Builder; import io.undertow.server.HttpHandler; @@ -640,9 +640,9 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac } } - private javax.servlet.http.Cookie asServletCookie(Cookie cookie) { + private jakarta.servlet.http.Cookie asServletCookie(Cookie cookie) { PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull(); - javax.servlet.http.Cookie result = new javax.servlet.http.Cookie(cookie.getName(), cookie.getValue()); + jakarta.servlet.http.Cookie result = new jakarta.servlet.http.Cookie(cookie.getName(), cookie.getValue()); map.from(cookie::getComment).to(result::setComment); map.from(cookie::getDomain).to(result::setDomain); map.from(cookie::getMaxAge).to(result::setMaxAge); @@ -653,7 +653,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac return result; } - private SameSite getSameSite(javax.servlet.http.Cookie cookie) { + private SameSite getSameSite(jakarta.servlet.http.Cookie cookie) { for (CookieSameSiteSupplier supplier : this.suppliers) { SameSite sameSite = supplier.getSameSite(cookie); if (sameSite != null) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java index 45ea170184..30550c0599 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -23,11 +23,11 @@ import java.util.EnumSet; import java.util.LinkedHashSet; import java.util.Set; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.FilterRegistration; -import javax.servlet.FilterRegistration.Dynamic; -import javax.servlet.ServletContext; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterRegistration; +import jakarta.servlet.FilterRegistration.Dynamic; +import jakarta.servlet.ServletContext; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBean.java index ba45a59627..60c199aea8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBean.java @@ -16,9 +16,9 @@ package org.springframework.boot.web.servlet; -import javax.servlet.Filter; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; +import jakarta.servlet.Filter; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DispatcherType.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DispatcherType.java index c369b5b173..ed1a4fda3f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DispatcherType.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DispatcherType.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.web.servlet; /** * Enumeration of filter dispatcher types, identical to - * {@link javax.servlet.DispatcherType} and used in configuration as the servlet API may + * {@link jakarta.servlet.DispatcherType} and used in configuration as the servlet API may * not be present. * * @author Stephane Nicoll diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java index b5377eb7a0..0b0b6ce4b9 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,8 +19,8 @@ package org.springframework.boot.web.servlet; import java.util.LinkedHashMap; import java.util.Map; -import javax.servlet.Registration; -import javax.servlet.ServletContext; +import jakarta.servlet.Registration; +import jakarta.servlet.ServletContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -30,7 +30,7 @@ import org.springframework.util.Assert; import org.springframework.util.StringUtils; /** - * Base class for Servlet 3.0+ {@link javax.servlet.Registration.Dynamic dynamic} based + * Base class for Servlet 3.0+ {@link jakarta.servlet.Registration.Dynamic dynamic} based * registration beans. * * @param the dynamic registration result diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java index 48e86aeb18..d2cc4fb585 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java @@ -16,8 +16,8 @@ package org.springframework.boot.web.servlet; -import javax.servlet.Filter; -import javax.servlet.ServletContext; +import jakarta.servlet.Filter; +import jakarta.servlet.ServletContext; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/MultipartConfigFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/MultipartConfigFactory.java index 91bc1db34f..038b009997 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/MultipartConfigFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/MultipartConfigFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet; -import javax.servlet.MultipartConfigElement; +import jakarta.servlet.MultipartConfigElement; import org.springframework.util.unit.DataSize; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/RegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/RegistrationBean.java index 9e0897f877..d49790495b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/RegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/RegistrationBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.web.servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScan.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScan.java index c9ffb87c25..1da66cc579 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScan.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScan.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -22,9 +22,9 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import javax.servlet.annotation.WebFilter; -import javax.servlet.annotation.WebListener; -import javax.servlet.annotation.WebServlet; +import jakarta.servlet.annotation.WebFilter; +import jakarta.servlet.annotation.WebListener; +import jakarta.servlet.annotation.WebServlet; import org.springframework.context.annotation.Import; import org.springframework.core.annotation.AliasFor; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializer.java index 0a7f693a28..e71b6e9db8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,9 @@ package org.springframework.boot.web.servlet; -import javax.servlet.ServletContainerInitializer; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; +import jakarta.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; import org.springframework.web.SpringServletContainerInitializer; import org.springframework.web.WebApplicationInitializer; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java index bd0cc2645e..5b361ea3be 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -30,9 +30,9 @@ import java.util.Map.Entry; import java.util.Set; import java.util.stream.Collectors; -import javax.servlet.Filter; -import javax.servlet.MultipartConfigElement; -import javax.servlet.Servlet; +import jakarta.servlet.Filter; +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.Servlet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java index f8f7896334..1a9d86bf00 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java @@ -21,14 +21,14 @@ import java.util.EventListener; import java.util.HashSet; import java.util.Set; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextAttributeListener; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletRequestAttributeListener; -import javax.servlet.ServletRequestListener; -import javax.servlet.http.HttpSessionAttributeListener; -import javax.servlet.http.HttpSessionIdListener; -import javax.servlet.http.HttpSessionListener; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextAttributeListener; +import jakarta.servlet.ServletContextListener; +import jakarta.servlet.ServletRequestAttributeListener; +import jakarta.servlet.ServletRequestListener; +import jakarta.servlet.http.HttpSessionAttributeListener; +import jakarta.servlet.http.HttpSessionIdListener; +import jakarta.servlet.http.HttpSessionListener; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java index 1a7533c45b..9f16f05ef8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -21,10 +21,10 @@ import java.util.Collection; import java.util.LinkedHashSet; import java.util.Set; -import javax.servlet.MultipartConfigElement; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletRegistration; +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletRegistration; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java index 85cd1026ef..73544147fb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import java.util.Arrays; import java.util.EnumSet; import java.util.Map; -import javax.servlet.DispatcherType; -import javax.servlet.annotation.WebFilter; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.annotation.WebFilter; import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.config.BeanDefinition; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java index 00463e4401..3f8c2f1275 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package org.springframework.boot.web.servlet; import java.util.Map; -import javax.servlet.annotation.WebListener; +import jakarta.servlet.annotation.WebListener; import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistrar.java index e964010300..deb8333fee 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet; -import javax.servlet.annotation.WebListener; +import jakarta.servlet.annotation.WebListener; /** * Interface to be implemented by types that register {@link WebListener @WebListeners}. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistry.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistry.java index 31ccf76d24..68f0dde6e2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistry.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet; -import javax.servlet.annotation.WebListener; +import jakarta.servlet.annotation.WebListener; /** * A registry that holds {@link WebListener @WebListeners}. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java index 815e57344f..73b401b2c2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,9 @@ package org.springframework.boot.web.servlet; import java.util.Map; -import javax.servlet.MultipartConfigElement; -import javax.servlet.annotation.MultipartConfig; -import javax.servlet.annotation.WebServlet; +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.annotation.MultipartConfig; +import jakarta.servlet.annotation.WebServlet; import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.config.BeanDefinition; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java index 40dd4f99b9..04c32463fd 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java @@ -24,11 +24,11 @@ import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; -import javax.servlet.Filter; -import javax.servlet.Servlet; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; +import jakarta.servlet.Filter; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebApplicationContextServletContextAwareProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebApplicationContextServletContextAwareProcessor.java index 192a6a76e4..f38d5476f5 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebApplicationContextServletContextAwareProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebApplicationContextServletContextAwareProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package org.springframework.boot.web.servlet.context; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; import org.springframework.util.Assert; import org.springframework.web.context.ConfigurableWebApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributes.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributes.java index 1672ec7a28..8ee4f850b0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributes.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributes.java @@ -22,10 +22,10 @@ import java.util.Date; import java.util.LinkedHashMap; import java.util.Map; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.web.error.ErrorAttributeOptions; import org.springframework.boot.web.error.ErrorAttributeOptions.Include; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/ErrorAttributes.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/ErrorAttributes.java index 55f31327ef..898363885e 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/ErrorAttributes.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/ErrorAttributes.java @@ -35,7 +35,7 @@ import org.springframework.web.servlet.ModelAndView; public interface ErrorAttributes { /** - * Name of the {@link javax.servlet.http.HttpServletRequest#getAttribute(String) + * Name of the {@link jakarta.servlet.http.HttpServletRequest#getAttribute(String) * request attribute} holding the error resolved by the {@code ErrorAttributes} * implementation. * @since 2.5.0 diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java index 21f184a2a2..106687794c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,10 +18,10 @@ package org.springframework.boot.web.servlet.filter; import java.io.IOException; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.context.ApplicationContext; import org.springframework.web.filter.OncePerRequestFilter; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ErrorPageSecurityFilter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ErrorPageSecurityFilter.java index 1140efc8de..838a593f2d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ErrorPageSecurityFilter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ErrorPageSecurityFilter.java @@ -18,15 +18,15 @@ package org.springframework.boot.web.servlet.filter; import java.io.IOException; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFilter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFilter.java index 518f9db285..ea44ab4523 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFilter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,12 +16,12 @@ package org.springframework.boot.web.servlet.filter; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.springframework.core.Ordered; /** - * An {@link Ordered} {@link javax.servlet.Filter}. + * An {@link Ordered} {@link jakarta.servlet.Filter}. * * @author Phillip Webb * @since 2.1.0 diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/package-info.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/package-info.java index 874452eb9a..b81de5bd19 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/package-info.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -15,6 +15,6 @@ */ /** - * Spring Boot specific {@link javax.servlet.Filter} implementations. + * Spring Boot specific {@link jakarta.servlet.Filter} implementations. */ package org.springframework.boot.web.servlet.filter; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/package-info.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/package-info.java index 2c876e5574..a831e8261d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/package-info.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/package-info.java @@ -15,6 +15,6 @@ */ /** - * Classes and utilities designed to work with the {@code javax.servlet} specification. + * Classes and utilities designed to work with the {@code jakarta.servlet} specification. */ package org.springframework.boot.web.servlet; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java index b866fc27fc..521e1b0ae4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java @@ -31,9 +31,9 @@ import java.util.Locale; import java.util.Map; import java.util.Set; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.SessionCookieConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.SessionCookieConfig; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -347,13 +347,13 @@ public abstract class AbstractServletWebServerFactory extends AbstractConfigurab map.from(cookie::getMaxAge).asInt(Duration::getSeconds).to(config::setMaxAge); } - private Set unwrap(Set modes) { + private Set unwrap(Set modes) { if (modes == null) { return null; } - Set result = new LinkedHashSet<>(); + Set result = new LinkedHashSet<>(); for (Session.SessionTrackingMode mode : modes) { - result.add(javax.servlet.SessionTrackingMode.valueOf(mode.name())); + result.add(jakarta.servlet.SessionTrackingMode.valueOf(mode.name())); } return result; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/ConfigurableServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/ConfigurableServletWebServerFactory.java index 98c5c1c922..0aa2783446 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/ConfigurableServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/ConfigurableServletWebServerFactory.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.springframework.boot.web.server.ConfigurableWebServerFactory; import org.springframework.boot.web.server.Cookie.SameSite; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/CookieSameSiteSupplier.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/CookieSameSiteSupplier.java index 6c7128e895..89de9ac1dd 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/CookieSameSiteSupplier.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/CookieSameSiteSupplier.java @@ -23,7 +23,7 @@ import java.util.regex.Pattern; /** * @author Phillip Webb */ -import javax.servlet.http.Cookie; +import jakarta.servlet.http.Cookie; import org.springframework.boot.web.server.Cookie.SameSite; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/Session.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/Session.java index 125bd98e13..72766bec1f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/Session.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/Session.java @@ -126,7 +126,7 @@ public class Session { /** * Available session tracking modes (mirrors - * {@link javax.servlet.SessionTrackingMode}. + * {@link jakarta.servlet.SessionTrackingMode}. */ public enum SessionTrackingMode { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java index 556959ebde..fc8c9aceac 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -25,16 +25,16 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -67,18 +67,18 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry, Ordered { // From RequestDispatcher but not referenced to remain compatible with Servlet 2.5 - private static final String ERROR_EXCEPTION = "javax.servlet.error.exception"; + private static final String ERROR_EXCEPTION = "jakarta.servlet.error.exception"; - private static final String ERROR_EXCEPTION_TYPE = "javax.servlet.error.exception_type"; + private static final String ERROR_EXCEPTION_TYPE = "jakarta.servlet.error.exception_type"; - private static final String ERROR_MESSAGE = "javax.servlet.error.message"; + private static final String ERROR_MESSAGE = "jakarta.servlet.error.message"; /** * The name of the servlet attribute containing request URI. */ - public static final String ERROR_REQUEST_URI = "javax.servlet.error.request_uri"; + public static final String ERROR_REQUEST_URI = "jakarta.servlet.error.request_uri"; - private static final String ERROR_STATUS_CODE = "javax.servlet.error.status_code"; + private static final String ERROR_STATUS_CODE = "jakarta.servlet.error.status_code"; private static final Set> CLIENT_ABORT_EXCEPTIONS; static { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilterConfiguration.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilterConfiguration.java index 68dd15974d..2ce5d44713 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilterConfiguration.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilterConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet.support; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ServletContextApplicationContextInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ServletContextApplicationContextInitializer.java index e99ec8a368..66987b71aa 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ServletContextApplicationContextInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ServletContextApplicationContextInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet.support; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextInitializer; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializer.java index 61d4595fa9..f3f5d2fc9d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializer.java @@ -21,11 +21,11 @@ import java.sql.DriverManager; import java.sql.SQLException; import java.util.Collections; -import javax.servlet.Filter; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletException; +import jakarta.servlet.Filter; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -198,7 +198,7 @@ public abstract class SpringBootServletInitializer implements WebApplicationInit /** * {@link ApplicationListener} to trigger - * {@link ConfigurableWebEnvironment#initPropertySources(ServletContext, javax.servlet.ServletConfig)}. + * {@link ConfigurableWebEnvironment#initPropertySources(ServletContext, jakarta.servlet.ServletConfig)}. */ private static final class WebEnvironmentPropertySourceInitializer implements ApplicationListener, Ordered { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/view/MustacheView.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/view/MustacheView.java index 738440b50b..a45ec2e4ad 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/view/MustacheView.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/view/MustacheView.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -22,8 +22,8 @@ import java.io.Reader; import java.util.Locale; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import com.samskivert.mustache.Mustache.Compiler; import com.samskivert.mustache.Template; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java index 07dd481234..341974d366 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java @@ -33,9 +33,10 @@ import java.util.Properties; import java.util.Set; import javax.annotation.PostConstruct; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java index 0325ecd3f8..942b796a30 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.Validation; +import jakarta.validation.Validation; import org.junit.jupiter.api.Test; import org.mockito.Answers; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java index 34480b24a3..f1665a0415 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java @@ -22,9 +22,9 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.validation.Valid; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java index c0b5cdb418..4e51c255ca 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Min; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java index d5a5714ea8..7ba0d8c415 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,9 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests.java deleted file mode 100644 index a1fa0b7b42..0000000000 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2012-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.diagnostics.analyzer; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.testsupport.classpath.ClassPathExclusions; -import org.springframework.boot.testsupport.classpath.ClassPathOverrides; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import org.springframework.validation.annotation.Validated; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - -/** - * Tests for {@link ValidationExceptionFailureAnalyzer} - * - * @author Andy Wilkinson - */ -@ClassPathExclusions("hibernate-validator-*.jar") -@ClassPathOverrides("javax.validation:validation-api:2.0.1.Final") -class JavaxApiValidationExceptionFailureAnalyzerTests { - - @Test - void validatedPropertiesTest() { - assertThatExceptionOfType(Exception.class) - .isThrownBy(() -> new AnnotationConfigApplicationContext(TestConfiguration.class).close()) - .satisfies((ex) -> assertThat(new ValidationExceptionFailureAnalyzer().analyze(ex)).isNotNull()); - } - - @Test - void nonValidatedPropertiesTest() { - new AnnotationConfigApplicationContext(NonValidatedTestConfiguration.class).close(); - } - - @EnableConfigurationProperties(TestProperties.class) - static class TestConfiguration { - - TestConfiguration(TestProperties testProperties) { - } - - } - - @ConfigurationProperties("test") - @Validated - static class TestProperties { - - } - - @EnableConfigurationProperties(NonValidatedTestProperties.class) - static class NonValidatedTestConfiguration { - - NonValidatedTestConfiguration(NonValidatedTestProperties testProperties) { - } - - } - - @ConfigurationProperties("test") - static class NonValidatedTestProperties { - - } - -} diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java index a185391c43..d445cddd83 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java @@ -18,9 +18,6 @@ package org.springframework.boot.diagnostics.analyzer; import java.util.List; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServlet; - import org.junit.jupiter.api.Test; import org.springframework.boot.diagnostics.FailureAnalysis; @@ -28,9 +25,9 @@ import org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzer import org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzer.NoSuchMethodDescriptor; import org.springframework.boot.testsupport.classpath.ClassPathOverrides; import org.springframework.data.r2dbc.mapping.R2dbcMappingContext; +import org.springframework.util.MimeType; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.mock; /** * Tests for {@link NoSuchMethodFailureAnalyzer}. @@ -39,70 +36,38 @@ import static org.mockito.Mockito.mock; * @author Stephane Nicoll * @author Scott Frederick */ -@ClassPathOverrides({ "javax.servlet:servlet-api:2.5", +@ClassPathOverrides({ "org.springframework:spring-core:5.3.12", "org.springframework.data:spring-data-relational:1.1.7.RELEASE" }) class NoSuchMethodFailureAnalyzerTests { @Test - void parseJava8ErrorMessage() { - NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( - "javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" - + "Ljavax/servlet/ServletRegistration$Dynamic;"); - assertThat(descriptor).isNotNull(); - assertThat(descriptor.getErrorMessage()) - .isEqualTo("javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" - + "Ljavax/servlet/ServletRegistration$Dynamic;"); - assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); - assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); - List typeHierarchy = descriptor.getTypeHierarchy(); - assertThat(typeHierarchy).hasSize(1); - assertThat(typeHierarchy.get(0).getLocation()).asString().contains("servlet-api-2.5.jar"); - } - - @Test - void parseJavaOpenJ9ErrorMessage() { - NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( - "javax/servlet/ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" - + "Ljavax/servlet/ServletRegistration$Dynamic; (loaded from file..."); - assertThat(descriptor).isNotNull(); - assertThat(descriptor.getErrorMessage()) - .isEqualTo("javax/servlet/ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" - + "Ljavax/servlet/ServletRegistration$Dynamic;"); - assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); - assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); - List typeHierarchy = descriptor.getTypeHierarchy(); - assertThat(typeHierarchy).hasSize(1); - assertThat(typeHierarchy.get(0).getLocation()).asString().contains("servlet-api-2.5.jar"); - } - - @Test - void parseJavaImprovedHotspotErrorMessage() { + void parseHotspotErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( - "'javax.servlet.ServletRegistration$Dynamic javax.servlet.ServletContext.addServlet(" - + "java.lang.String, javax.servlet.Servlet)'"); + "'boolean org.springframework.util.MimeType.isMoreSpecific(org.springframework.util.MimeType)'"); assertThat(descriptor).isNotNull(); - assertThat(descriptor.getErrorMessage()) - .isEqualTo("'javax.servlet.ServletRegistration$Dynamic javax.servlet.ServletContext.addServlet(" - + "java.lang.String, javax.servlet.Servlet)'"); - assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); + assertThat(descriptor.getErrorMessage()).isEqualTo( + "'boolean org.springframework.util.MimeType.isMoreSpecific(org.springframework.util.MimeType)'"); + assertThat(descriptor.getClassName()).isEqualTo("org.springframework.util.MimeType"); assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); List typeHierarchy = descriptor.getTypeHierarchy(); assertThat(typeHierarchy).hasSize(1); - assertThat(typeHierarchy.get(0).getLocation()).asString().contains("servlet-api-2.5.jar"); + assertThat(typeHierarchy.get(0).getLocation()).asString().contains("spring-core-5.3.12.jar"); } @Test - void whenAMethodOnAnInterfaceIsMissingThenNoSuchMethodErrorIsAnalyzed() { - Throwable failure = createFailure(); + void whenAMethodOnAClassIsMissingThenNoSuchMethodErrorIsAnalyzed() { + Throwable failure = createFailureForMissingMethod(); assertThat(failure).isNotNull(); + failure.printStackTrace(); FailureAnalysis analysis = new NoSuchMethodFailureAnalyzer().analyze(failure); assertThat(analysis).isNotNull(); assertThat(analysis.getDescription()) - .contains(NoSuchMethodFailureAnalyzerTests.class.getName() + ".createFailure(").contains("addServlet(") + .contains(NoSuchMethodFailureAnalyzerTests.class.getName() + ".createFailureForMissingMethod(") + .contains("isMoreSpecific(") .contains("calling method's class, " + NoSuchMethodFailureAnalyzerTests.class.getName() + ",") - .contains("called method's class, javax.servlet.ServletContext,"); + .contains("called method's class, org.springframework.util.MimeType,"); assertThat(analysis.getAction()).contains(NoSuchMethodFailureAnalyzerTests.class.getName()) - .contains("javax.servlet.ServletContext"); + .contains("org.springframework.util.MimeType"); } @Test @@ -121,11 +86,11 @@ class NoSuchMethodFailureAnalyzerTests { assertThat(analysis.getAction()).contains("org.springframework.data.r2dbc.mapping.R2dbcMappingContext"); } - private Throwable createFailure() { + private Throwable createFailureForMissingMethod() { try { - ServletContext servletContext = mock(ServletContext.class); - servletContext.addServlet("example", new HttpServlet() { - }); + System.out.println(MimeType.class.getProtectionDomain().getCodeSource().getLocation()); + MimeType mimeType = new MimeType("application", "json"); + System.out.println(mimeType.isMoreSpecific(null)); return null; } catch (Throwable ex) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/orm/jpa/hibernate/TelephoneNumber.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/orm/jpa/hibernate/TelephoneNumber.java index 5a2e7ad904..7ddcd93539 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/orm/jpa/hibernate/TelephoneNumber.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/orm/jpa/hibernate/TelephoneNumber.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,9 @@ package org.springframework.boot.orm.jpa.hibernate; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; /** * Simple entity used in {@link SpringPhysicalNamingStrategyTests}. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/sampleconfig/MyNamedComponent.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/sampleconfig/MyNamedComponent.java index 662c3869ec..44e2373eee 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/sampleconfig/MyNamedComponent.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/sampleconfig/MyNamedComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.sampleconfig; -import javax.inject.Named; +import jakarta.inject.Named; @Named public class MyNamedComponent { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java index 6329867be0..59c1cee170 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -22,7 +22,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageInterpolatorFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageInterpolatorFactoryTests.java index e45c92679c..6f9fbfe8af 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageInterpolatorFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageInterpolatorFactoryTests.java @@ -16,7 +16,7 @@ package org.springframework.boot.validation; -import javax.validation.MessageInterpolator; +import jakarta.validation.MessageInterpolator; import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageInterpolatorFactoryWithoutElIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageInterpolatorFactoryWithoutElIntegrationTests.java index 817c3586fc..072838a350 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageInterpolatorFactoryWithoutElIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageInterpolatorFactoryWithoutElIntegrationTests.java @@ -16,9 +16,9 @@ package org.springframework.boot.validation; -import javax.validation.MessageInterpolator; -import javax.validation.Validation; -import javax.validation.ValidationException; +import jakarta.validation.MessageInterpolator; +import jakarta.validation.Validation; +import jakarta.validation.ValidationException; import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; import org.junit.jupiter.api.Test; @@ -44,7 +44,7 @@ class MessageInterpolatorFactoryWithoutElIntegrationTests { // Sanity test assertThatExceptionOfType(ValidationException.class) .isThrownBy(Validation.byDefaultProvider().configure()::getDefaultMessageInterpolator) - .withMessageContaining("javax.el.ExpressionFactory"); + .withMessageContaining("jakarta.el.ExpressionFactory"); } @Test diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageSourceMessageInterpolatorIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageSourceMessageInterpolatorIntegrationTests.java index 9d0809e03e..f83a48ff93 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageSourceMessageInterpolatorIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageSourceMessageInterpolatorIntegrationTests.java @@ -22,9 +22,9 @@ import java.util.Locale; import java.util.Set; import java.util.function.Supplier; -import javax.validation.ConstraintViolation; -import javax.validation.Validator; -import javax.validation.constraints.NotNull; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validator; +import jakarta.validation.constraints.NotNull; import org.junit.jupiter.api.Test; @@ -130,8 +130,8 @@ class MessageSourceMessageInterpolatorIntegrationTests { private static Validator buildValidator() { Locale locale = LocaleContextHolder.getLocale(); StaticMessageSource messageSource = new StaticMessageSource(); - messageSource.addMessage("blank", locale, "{null} or {javax.validation.constraints.NotBlank.message}"); - messageSource.addMessage("null", locale, "{javax.validation.constraints.NotNull.message}"); + messageSource.addMessage("blank", locale, "{null} or {jakarta.validation.constraints.NotBlank.message}"); + messageSource.addMessage("null", locale, "{jakarta.validation.constraints.NotNull.message}"); messageSource.addMessage("recursion", locale, "{middle}"); messageSource.addMessage("middle", locale, "{recursion}"); MessageInterpolatorFactory messageInterpolatorFactory = new MessageInterpolatorFactory(messageSource); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageSourceMessageInterpolatorTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageSourceMessageInterpolatorTests.java index c33d4997ee..387db16348 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageSourceMessageInterpolatorTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/validation/MessageSourceMessageInterpolatorTests.java @@ -18,8 +18,8 @@ package org.springframework.boot.validation; import java.util.Locale; -import javax.validation.MessageInterpolator; -import javax.validation.MessageInterpolator.Context; +import jakarta.validation.MessageInterpolator; +import jakarta.validation.MessageInterpolator.Context; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ReactiveWebServerFactoryTests.java deleted file mode 100644 index db8cee18ff..0000000000 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ReactiveWebServerFactoryTests.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2012-2021 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.web.embedded.jetty; - -import org.eclipse.jetty.server.handler.ErrorHandler; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link JettyReactiveWebServerFactory} with Jetty 10. - * - * @author Andy Wilkinson - */ -@TestWithJetty10 -class Jetty10ReactiveWebServerFactoryTests extends JettyReactiveWebServerFactoryTests { - - @Test - void correctVersionOfJettyUsed() { - String jettyVersion = ErrorHandler.class.getPackage().getImplementationVersion(); - assertThat(jettyVersion).startsWith("10.0"); - } - - @Test - @Override - @Disabled("Jetty 10 does not support User-Agent-based compression") - protected void noCompressionForUserAgent() { - - } - -} diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ServletWebServerFactoryTests.java deleted file mode 100644 index 1878a578e9..0000000000 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ServletWebServerFactoryTests.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012-2021 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.web.embedded.jetty; - -import org.eclipse.jetty.server.handler.ErrorHandler; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link JettyServletWebServerFactory} with Jetty 10. - * - * @author Andy Wilkinson - */ -@TestWithJetty10 -class Jetty10ServletWebServerFactoryTests extends JettyServletWebServerFactoryTests { - - @Test - @Override - protected void correctVersionOfJettyUsed() { - String jettyVersion = ErrorHandler.class.getPackage().getImplementationVersion(); - assertThat(jettyVersion).startsWith("10.0"); - } - - @Test - @Override - @Disabled("Jetty 10 does not support User-Agent-based compression") - protected void noCompressionForUserAgent() { - - } - - @Test - @Override - @Disabled("Jetty 10 adds methods to Configuration that we can't mock while compiling against 9") - protected void jettyConfigurations() { - } - -} diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyReactiveWebServerFactoryTests.java index e6a93f8033..052eec2211 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyReactiveWebServerFactoryTests.java @@ -25,6 +25,7 @@ import org.awaitility.Awaitility; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.InOrder; @@ -53,6 +54,13 @@ class JettyReactiveWebServerFactoryTests extends AbstractReactiveWebServerFactor return new JettyReactiveWebServerFactory(0); } + @Test + @Override + @Disabled("Jetty 11 does not support User-Agent-based compression") + protected void noCompressionForUserAgent() { + + } + @Test void setNullServerCustomizersShouldThrowException() { JettyReactiveWebServerFactory factory = getFactory(); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java index bed60b0209..62f151be0d 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java @@ -29,12 +29,10 @@ import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicReference; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletRegistration.Dynamic; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; +import jakarta.servlet.ServletRegistration.Dynamic; import org.apache.http.Header; import org.apache.http.HttpResponse; @@ -48,7 +46,6 @@ import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.SslConnectionFactory; -import org.eclipse.jetty.server.handler.ErrorHandler; import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.server.handler.HandlerWrapper; import org.eclipse.jetty.servlet.ErrorPageErrorHandler; @@ -57,8 +54,10 @@ import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.ThreadPool; import org.eclipse.jetty.webapp.AbstractConfiguration; +import org.eclipse.jetty.webapp.ClassMatcher; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.WebAppContext; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.InOrder; @@ -76,6 +75,7 @@ import org.springframework.util.ReflectionUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; @@ -139,6 +139,13 @@ class JettyServletWebServerFactoryTests extends AbstractServletWebServerFactoryT handleExceptionCausedByBlockedPortOnPrimaryConnector(ex, blockedPort); } + @Test + @Override + @Disabled("Jetty 11 does not support User-Agent-based compression") + protected void noCompressionForUserAgent() { + + } + @Test void contextPathIsLoggedOnStartupWhenCompressionIsEnabled(CapturedOutput output) { AbstractServletWebServerFactory factory = getFactory(); @@ -152,18 +159,11 @@ class JettyServletWebServerFactoryTests extends AbstractServletWebServerFactoryT } @Test - protected void correctVersionOfJettyUsed() { - String jettyVersion = ErrorHandler.class.getPackage().getImplementationVersion(); - Matcher matcher = Pattern.compile("[0-9]+.[0-9]+.([0-9]+)[\\.-].*").matcher(jettyVersion); - assertThat(matcher.find()).isTrue(); - assertThat(Integer.valueOf(matcher.group(1))).isGreaterThan(19); - } - - @Test - protected void jettyConfigurations() throws Exception { + void jettyConfigurations() throws Exception { JettyServletWebServerFactory factory = getFactory(); - Configuration[] configurations = new Configuration[4]; - Arrays.setAll(configurations, (i) -> mock(Configuration.class)); + Configuration[] configurations = new Configuration[] { mockConfiguration(Configuration1.class), + mockConfiguration(Configuration2.class), mockConfiguration(Configuration3.class), + mockConfiguration(Configuration4.class) }; factory.setConfigurations(Arrays.asList(configurations[0], configurations[1])); factory.addConfigurations(configurations[2], configurations[3]); this.webServer = factory.getWebServer(); @@ -173,6 +173,14 @@ class JettyServletWebServerFactoryTests extends AbstractServletWebServerFactoryT } } + Configuration mockConfiguration(Class type) { + Configuration mock = mock(type); + ClassMatcher classMatcher = new ClassMatcher(); + given(mock.getSystemClasses()).willReturn(classMatcher); + given(mock.getServerClasses()).willReturn(classMatcher); + return mock; + } + @Test void jettyCustomizations() { JettyServletWebServerFactory factory = getFactory(); @@ -527,4 +535,20 @@ class JettyServletWebServerFactoryTests extends AbstractServletWebServerFactoryT } + interface Configuration1 extends Configuration { + + } + + interface Configuration2 extends Configuration { + + } + + interface Configuration3 extends Configuration { + + } + + interface Configuration4 extends Configuration { + + } + } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/TestWithJetty10.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/TestWithJetty10.java deleted file mode 100644 index 3cfe9631a3..0000000000 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/TestWithJetty10.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012-2021 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.web.embedded.jetty; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.junit.jupiter.api.condition.EnabledForJreRange; -import org.junit.jupiter.api.condition.JRE; - -import org.springframework.boot.testsupport.classpath.ClassPathExclusions; -import org.springframework.boot.testsupport.classpath.ClassPathOverrides; - -/** - * Configure a test class to run its tests with Jetty 10 on the classpath. - * - * @author Andy Wilkinson - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@EnabledForJreRange(min = JRE.JAVA_11) -@ClassPathExclusions({ "jetty-*.jar", "tomcat-embed*.jar", "http2-*.jar" }) -@ClassPathOverrides({ "org.slf4j:slf4j-api:1.7.25", "org.eclipse.jetty:jetty-client:10.0.2", - "org.eclipse.jetty:jetty-io:10.0.2", "org.eclipse.jetty:jetty-server:10.0.2", - "org.eclipse.jetty:jetty-servlet:10.0.2", "org.eclipse.jetty:jetty-util:10.0.2", - "org.eclipse.jetty:jetty-webapp:10.0.2", "org.eclipse.jetty.http2:http2-common:10.0.2", - "org.eclipse.jetty.http2:http2-hpack:10.0.2", "org.eclipse.jetty.http2:http2-http-client-transport:10.0.2", - "org.eclipse.jetty.http2:http2-server:10.0.2", "org.mortbay.jasper:apache-jsp:8.5.40" }) -@interface TestWithJetty10 { - -} diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizerTests.java index cb1c8c7867..d12e9f0f31 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,6 +16,7 @@ package org.springframework.boot.web.embedded.tomcat; +import org.apache.catalina.LifecycleException; import org.apache.catalina.connector.Connector; import org.apache.coyote.http11.AbstractHttp11Protocol; import org.apache.coyote.http2.Http2Protocol; @@ -52,30 +53,19 @@ class CompressionConnectorCustomizerTests { } @Test - void shouldCustomizeCompressionForHttp1AndHttp2Protocol() { + void shouldCustomizeCompression() throws LifecycleException { CompressionConnectorCustomizer compressionConnectorCustomizer = new CompressionConnectorCustomizer( this.compression); Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol"); - connector.addUpgradeProtocol(new Http2Protocol()); + Http2Protocol upgradeProtocol = new Http2Protocol(); + upgradeProtocol.setHttp11Protocol((AbstractHttp11Protocol) connector.getProtocolHandler()); + connector.addUpgradeProtocol(upgradeProtocol); compressionConnectorCustomizer.customize(connector); AbstractHttp11Protocol abstractHttp11Protocol = (AbstractHttp11Protocol) connector.getProtocolHandler(); - verifyHttp1(abstractHttp11Protocol); - Http2Protocol http2Protocol = (Http2Protocol) connector.findUpgradeProtocols()[0]; - verifyHttp2Upgrade(http2Protocol); - } - - private void verifyHttp1(AbstractHttp11Protocol protocol) { - compressionOn(protocol.getCompression()); - minSize(protocol.getCompressionMinSize()); - mimeType(protocol.getCompressibleMimeTypes()); - excludedUserAgents(protocol.getNoCompressionUserAgents()); - } - - private void verifyHttp2Upgrade(Http2Protocol protocol) { - compressionOn(protocol.getCompression()); - minSize(protocol.getCompressionMinSize()); - mimeType(protocol.getCompressibleMimeTypes()); - excludedUserAgents(protocol.getNoCompressionUserAgents()); + compressionOn(abstractHttp11Protocol.getCompression()); + minSize(abstractHttp11Protocol.getCompressionMinSize()); + mimeType(abstractHttp11Protocol.getCompressibleMimeTypes()); + excludedUserAgents(abstractHttp11Protocol.getNoCompressionUserAgents()); } private void compressionOn(String compression) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java index 7c0deaa985..1a35f84bd5 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java @@ -23,13 +23,15 @@ import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; +import java.util.Set; +import java.util.stream.Collectors; import org.apache.catalina.LifecycleState; import org.apache.catalina.connector.Connector; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory; -import org.apache.coyote.http11.Http11NioProtocol; import org.apache.tomcat.util.net.SSLHostConfig; +import org.apache.tomcat.util.net.SSLHostConfigCertificate; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -129,7 +131,8 @@ class SslConnectorCustomizerTests { ssl.setKeyPassword("password"); ssl.setTrustStore("src/test/resources/test.jks"); SslStoreProvider sslStoreProvider = mock(SslStoreProvider.class); - given(sslStoreProvider.getKeyStore()).willReturn(loadStore()); + KeyStore keyStore = loadStore(); + given(sslStoreProvider.getKeyStore()).willReturn(keyStore); SslConnectorCustomizer customizer = new SslConnectorCustomizer(ssl, sslStoreProvider); Connector connector = this.tomcat.getConnector(); customizer.customize(connector); @@ -137,8 +140,9 @@ class SslConnectorCustomizerTests { SSLHostConfig sslHostConfig = connector.getProtocolHandler().findSslHostConfigs()[0]; SSLHostConfig sslHostConfigWithDefaults = new SSLHostConfig(); assertThat(sslHostConfig.getTruststoreFile()).isEqualTo(sslHostConfigWithDefaults.getTruststoreFile()); - assertThat(sslHostConfig.getCertificateKeystoreFile()) - .isEqualTo(SslStoreProviderUrlStreamHandlerFactory.KEY_STORE_URL); + Set certificates = sslHostConfig.getCertificates(); + assertThat(certificates).hasSize(1); + assertThat(certificates.iterator().next().getCertificateKeystore()).isEqualTo(keyStore); } @Test @@ -147,7 +151,8 @@ class SslConnectorCustomizerTests { ssl.setKeyPassword("password"); ssl.setKeyStore("src/test/resources/test.jks"); SslStoreProvider sslStoreProvider = mock(SslStoreProvider.class); - given(sslStoreProvider.getTrustStore()).willReturn(loadStore()); + KeyStore trustStore = loadStore(); + given(sslStoreProvider.getTrustStore()).willReturn(trustStore); SslConnectorCustomizer customizer = new SslConnectorCustomizer(ssl, sslStoreProvider); Connector connector = this.tomcat.getConnector(); customizer.customize(connector); @@ -156,10 +161,11 @@ class SslConnectorCustomizerTests { sslHostConfig.getCertificates(true); SSLHostConfig sslHostConfigWithDefaults = new SSLHostConfig(); sslHostConfigWithDefaults.getCertificates(true); - assertThat(sslHostConfig.getTruststoreFile()) - .isEqualTo(SslStoreProviderUrlStreamHandlerFactory.TRUST_STORE_URL); - assertThat(sslHostConfig.getCertificateKeystoreFile()) - .contains(sslHostConfigWithDefaults.getCertificateKeystoreFile()); + assertThat(sslHostConfig.getTruststore()).isEqualTo(trustStore); + System.out.println(sslHostConfig.getCertificates(false).stream() + .map(SSLHostConfigCertificate::getCertificateFile).collect(Collectors.toList())); + System.out.println(sslHostConfigWithDefaults.getCertificates(false).stream() + .map(SSLHostConfigCertificate::getCertificateFile).collect(Collectors.toList())); } @Test @@ -186,37 +192,6 @@ class SslConnectorCustomizerTests { .withMessageContaining("Could not load key store 'null'"); } - @Test - void keyStorePasswordIsNotSetWhenNull() { - Http11NioProtocol protocol = (Http11NioProtocol) this.tomcat.getConnector().getProtocolHandler(); - protocol.setKeystorePass("password"); - Ssl ssl = new Ssl(); - ssl.setKeyStore("src/test/resources/test.jks"); - new SslConnectorCustomizer(ssl, null).customize(this.tomcat.getConnector()); - assertThat(protocol.getKeystorePass()).isEqualTo("password"); - } - - @Test - void keyPasswordIsNotSetWhenNull() { - Http11NioProtocol protocol = (Http11NioProtocol) this.tomcat.getConnector().getProtocolHandler(); - protocol.setKeyPass("password"); - Ssl ssl = new Ssl(); - ssl.setKeyStore("src/test/resources/test.jks"); - new SslConnectorCustomizer(ssl, null).customize(this.tomcat.getConnector()); - assertThat(protocol.getKeyPass()).isEqualTo("password"); - } - - @Test - void trustStorePasswordIsNotSetWhenNull() { - Http11NioProtocol protocol = (Http11NioProtocol) this.tomcat.getConnector().getProtocolHandler(); - protocol.setTruststorePass("password"); - Ssl ssl = new Ssl(); - ssl.setKeyStore("src/test/resources/test.jks"); - ssl.setTrustStore("src/test/resources/test.jks"); - new SslConnectorCustomizer(ssl, null).customize(this.tomcat.getConnector()); - assertThat(protocol.getTruststorePass()).isEqualTo("password"); - } - private KeyStore loadStore() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException { KeyStore keyStore = KeyStore.getInstance("JKS"); Resource resource = new ClassPathResource("test.jks"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java index 0a9b456e2b..6c10eda8dd 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -32,13 +32,14 @@ import java.util.concurrent.atomic.AtomicReference; import javax.naming.InitialContext; import javax.naming.NamingException; -import javax.servlet.MultipartConfigElement; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration.Dynamic; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; + +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRegistration.Dynamic; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.catalina.Container; import org.apache.catalina.Context; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java index e833dd92b2..0eb6176c02 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java @@ -30,7 +30,8 @@ import java.util.concurrent.atomic.AtomicReference; import javax.net.ssl.SSLException; import javax.net.ssl.SSLHandshakeException; -import javax.servlet.ServletRegistration.Dynamic; + +import jakarta.servlet.ServletRegistration.Dynamic; import io.undertow.Undertow; import io.undertow.Undertow.Builder; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java index f8ece0a60d..bec7dfc777 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java @@ -44,7 +44,7 @@ import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import org.assertj.core.api.ThrowableAssert.ThrowingCallable; import org.awaitility.Awaitility; import org.eclipse.jetty.client.api.ContentResponse; -import org.eclipse.jetty.client.util.StringContentProvider; +import org.eclipse.jetty.client.util.StringRequestContent; import org.eclipse.jetty.http2.client.HTTP2Client; import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2; import org.junit.jupiter.api.AfterEach; @@ -492,7 +492,7 @@ public abstract class AbstractReactiveWebServerFactoryTests { client.start(); try { ContentResponse response = client.POST("http://localhost:" + this.webServer.getPort()) - .content(new StringContentProvider("Hello World"), "text/plain").send(); + .body(new StringRequestContent("text/plain", "Hello World")).send(); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(response.getContentAsString()).isEqualTo("Hello World"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBeanTests.java index 77c9e95139..3fa73ab2f4 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -23,10 +23,10 @@ import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.FilterRegistration; -import javax.servlet.ServletContext; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterRegistration; +import jakarta.servlet.ServletContext; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java index 10450eb49e..1683072dff 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,10 +16,10 @@ package org.springframework.boot.web.servlet; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationBeanTests.java index e36060d0a2..c9da9dc7a1 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationBeanTests.java @@ -19,12 +19,12 @@ package org.springframework.boot.web.servlet; import java.io.IOException; import java.util.EnumSet; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java index 6524219fb2..1a296fb468 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MultipartConfigFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MultipartConfigFactoryTests.java index cb0b18a06b..cbbaf13134 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MultipartConfigFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MultipartConfigFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet; -import javax.servlet.MultipartConfigElement; +import jakarta.servlet.MultipartConfigElement; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/NoSpringWebFilterRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/NoSpringWebFilterRegistrationBeanTests.java index 2eb325306b..7aa6bbd21c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/NoSpringWebFilterRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/NoSpringWebFilterRegistrationBeanTests.java @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet; -import javax.servlet.Filter; +import jakarta.servlet.Filter; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; import org.springframework.boot.web.servlet.mock.MockFilter; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java index 5792bd96e7..172d328781 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -25,10 +25,10 @@ import java.util.Map; import java.util.Properties; import java.util.stream.Stream; -import javax.servlet.MultipartConfigElement; -import javax.servlet.annotation.WebFilter; -import javax.servlet.annotation.WebListener; -import javax.servlet.annotation.WebServlet; +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.annotation.WebFilter; +import jakarta.servlet.annotation.WebListener; +import jakarta.servlet.annotation.WebServlet; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.io.TempDir; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java index 319c7e525a..f73f7d75da 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java @@ -16,15 +16,15 @@ package org.springframework.boot.web.servlet; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpSessionIdListener; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpSessionIdListener; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBeanTests.java index ca1e9587a0..0180480393 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,8 +18,8 @@ package org.springframework.boot.web.servlet; import java.util.EventListener; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextListener; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java index d94ef06850..8f41923299 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java @@ -22,10 +22,10 @@ import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; -import javax.servlet.FilterRegistration; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletRegistration; +import jakarta.servlet.FilterRegistration; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletRegistration; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java index 5174ee38ec..9c0f32702e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java @@ -21,14 +21,14 @@ import java.util.EnumSet; import java.util.Map; import java.util.Set; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.annotation.WebFilter; -import javax.servlet.annotation.WebInitParam; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.annotation.WebFilter; +import jakarta.servlet.annotation.WebInitParam; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebListenerHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebListenerHandlerTests.java index f787927469..ec27dcbd8b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebListenerHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebListenerHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,9 @@ package org.springframework.boot.web.servlet; import java.io.IOException; -import javax.servlet.ServletContextAttributeEvent; -import javax.servlet.ServletContextAttributeListener; -import javax.servlet.annotation.WebListener; +import jakarta.servlet.ServletContextAttributeEvent; +import jakarta.servlet.ServletContextAttributeListener; +import jakarta.servlet.annotation.WebListener; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java index 8ecee00645..93a5b233c7 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java @@ -19,9 +19,9 @@ package org.springframework.boot.web.servlet; import java.io.IOException; import java.util.Map; -import javax.servlet.annotation.WebInitParam; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; +import jakarta.servlet.annotation.WebInitParam; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java index d4d78c1981..8411bdf442 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java @@ -16,11 +16,11 @@ package org.springframework.boot.web.servlet.context; -import javax.servlet.GenericServlet; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java index 1ba3f1d3e0..e0f7ee0ae6 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java @@ -23,14 +23,14 @@ import java.util.EnumSet; import java.util.List; import java.util.Properties; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextListener; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContextTests.java index 9b8fab137d..329576aad3 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet.context; -import javax.servlet.Servlet; +import jakarta.servlet.Servlet; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java index 2c8da4155f..0e1cd911a8 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet.context.config; -import javax.servlet.Servlet; +import jakarta.servlet.Servlet; import org.springframework.boot.web.servlet.mock.MockServlet; import org.springframework.boot.web.servlet.server.MockServletWebServerFactory; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributesTests.java index 6658819dd3..d1a0c7b2f7 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributesTests.java @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.Date; import java.util.Map; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import org.junit.jupiter.api.Test; @@ -66,7 +66,7 @@ class DefaultErrorAttributesTests { @Test void specificStatusCode() { - this.request.setAttribute("javax.servlet.error.status_code", 404); + this.request.setAttribute("jakarta.servlet.error.status_code", 404); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.defaults()); assertThat(attributes.get("error")).isEqualTo(HttpStatus.NOT_FOUND.getReasonPhrase()); @@ -85,7 +85,7 @@ class DefaultErrorAttributesTests { void mvcError() { RuntimeException ex = new RuntimeException("Test"); ModelAndView modelAndView = this.errorAttributes.resolveException(this.request, null, null, ex); - this.request.setAttribute("javax.servlet.error.exception", new RuntimeException("Ignored")); + this.request.setAttribute("jakarta.servlet.error.exception", new RuntimeException("Ignored")); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.of(Include.MESSAGE)); assertThat(this.errorAttributes.getError(this.webRequest)).isSameAs(ex); @@ -99,7 +99,7 @@ class DefaultErrorAttributesTests { @Test void servletErrorWithMessage() { RuntimeException ex = new RuntimeException("Test"); - this.request.setAttribute("javax.servlet.error.exception", ex); + this.request.setAttribute("jakarta.servlet.error.exception", ex); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.of(Include.MESSAGE)); assertThat(this.errorAttributes.getError(this.webRequest)).isSameAs(ex); @@ -112,7 +112,7 @@ class DefaultErrorAttributesTests { @Test void servletErrorWithoutMessage() { RuntimeException ex = new RuntimeException("Test"); - this.request.setAttribute("javax.servlet.error.exception", ex); + this.request.setAttribute("jakarta.servlet.error.exception", ex); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.defaults()); assertThat(this.errorAttributes.getError(this.webRequest)).isSameAs(ex); @@ -124,7 +124,7 @@ class DefaultErrorAttributesTests { @Test void servletMessageWithMessage() { - this.request.setAttribute("javax.servlet.error.message", "Test"); + this.request.setAttribute("jakarta.servlet.error.message", "Test"); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.of(Include.MESSAGE)); assertThat(attributes).doesNotContainKey("exception"); @@ -133,7 +133,7 @@ class DefaultErrorAttributesTests { @Test void servletMessageWithoutMessage() { - this.request.setAttribute("javax.servlet.error.message", "Test"); + this.request.setAttribute("jakarta.servlet.error.message", "Test"); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.defaults()); assertThat(attributes).doesNotContainKey("exception"); @@ -142,8 +142,8 @@ class DefaultErrorAttributesTests { @Test void nullExceptionMessage() { - this.request.setAttribute("javax.servlet.error.exception", new RuntimeException()); - this.request.setAttribute("javax.servlet.error.message", "Test"); + this.request.setAttribute("jakarta.servlet.error.exception", new RuntimeException()); + this.request.setAttribute("jakarta.servlet.error.message", "Test"); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.of(Include.MESSAGE)); assertThat(attributes).doesNotContainKey("exception"); @@ -152,7 +152,7 @@ class DefaultErrorAttributesTests { @Test void nullExceptionMessageAndServletMessage() { - this.request.setAttribute("javax.servlet.error.exception", new RuntimeException()); + this.request.setAttribute("jakarta.servlet.error.exception", new RuntimeException()); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.of(Include.MESSAGE)); assertThat(attributes).doesNotContainKey("exception"); @@ -163,7 +163,7 @@ class DefaultErrorAttributesTests { void unwrapServletException() { RuntimeException ex = new RuntimeException("Test"); ServletException wrapped = new ServletException(new ServletException(ex)); - this.request.setAttribute("javax.servlet.error.exception", wrapped); + this.request.setAttribute("jakarta.servlet.error.exception", wrapped); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.of(Include.MESSAGE)); assertThat(this.errorAttributes.getError(this.webRequest)).isSameAs(wrapped); @@ -176,7 +176,7 @@ class DefaultErrorAttributesTests { @Test void getError() { Error error = new OutOfMemoryError("Test error"); - this.request.setAttribute("javax.servlet.error.exception", error); + this.request.setAttribute("jakarta.servlet.error.exception", error); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.of(Include.MESSAGE)); assertThat(this.errorAttributes.getError(this.webRequest)).isSameAs(error); @@ -213,7 +213,7 @@ class DefaultErrorAttributesTests { } private void testBindingResult(BindingResult bindingResult, Exception ex, ErrorAttributeOptions options) { - this.request.setAttribute("javax.servlet.error.exception", ex); + this.request.setAttribute("jakarta.servlet.error.exception", ex); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, options); if (options.isIncluded(Include.MESSAGE)) { assertThat(attributes.get("message")) @@ -234,7 +234,7 @@ class DefaultErrorAttributesTests { void withExceptionAttribute() { DefaultErrorAttributes errorAttributes = new DefaultErrorAttributes(); RuntimeException ex = new RuntimeException("Test"); - this.request.setAttribute("javax.servlet.error.exception", ex); + this.request.setAttribute("jakarta.servlet.error.exception", ex); Map attributes = errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.of(Include.EXCEPTION, Include.MESSAGE)); assertThat(attributes.get("exception")).isEqualTo(RuntimeException.class.getName()); @@ -244,7 +244,7 @@ class DefaultErrorAttributesTests { @Test void withStackTraceAttribute() { RuntimeException ex = new RuntimeException("Test"); - this.request.setAttribute("javax.servlet.error.exception", ex); + this.request.setAttribute("jakarta.servlet.error.exception", ex); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.of(Include.STACK_TRACE)); assertThat(attributes.get("trace").toString()).startsWith("java.lang"); @@ -253,7 +253,7 @@ class DefaultErrorAttributesTests { @Test void withoutStackTraceAttribute() { RuntimeException ex = new RuntimeException("Test"); - this.request.setAttribute("javax.servlet.error.exception", ex); + this.request.setAttribute("jakarta.servlet.error.exception", ex); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.defaults()); assertThat(attributes).doesNotContainKey("trace"); @@ -261,7 +261,7 @@ class DefaultErrorAttributesTests { @Test void path() { - this.request.setAttribute("javax.servlet.error.request_uri", "path"); + this.request.setAttribute("jakarta.servlet.error.request_uri", "path"); Map attributes = this.errorAttributes.getErrorAttributes(this.webRequest, ErrorAttributeOptions.defaults()); assertThat(attributes.get("path")).isEqualTo("path"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/filter/ErrorPageSecurityFilterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/filter/ErrorPageSecurityFilterTests.java index bfa5dfebf6..cdd1327bc2 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/filter/ErrorPageSecurityFilterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/filter/ErrorPageSecurityFilterTests.java @@ -16,9 +16,9 @@ package org.springframework.boot.web.servlet.filter; -import javax.servlet.DispatcherType; -import javax.servlet.FilterChain; -import javax.servlet.RequestDispatcher; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.FilterChain; +import jakarta.servlet.RequestDispatcher; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockFilter.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockFilter.java index 00442d036d..e17a35cb0a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockFilter.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,12 +18,12 @@ package org.springframework.boot.web.servlet.mock; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; /** * Simple mock Filter that does nothing. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockServlet.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockServlet.java index b3f108f9a8..65321bb41a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockServlet.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockServlet.java @@ -18,10 +18,10 @@ package org.springframework.boot.web.servlet.mock; import java.io.IOException; -import javax.servlet.GenericServlet; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; /** * Simple mock Servlet that does nothing. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java index f56d26a69d..b606806e1b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java @@ -61,24 +61,25 @@ import java.util.zip.GZIPInputStream; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLException; -import javax.servlet.AsyncContext; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.GenericServlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration.Dynamic; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.SessionCookieConfig; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; + +import jakarta.servlet.AsyncContext; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRegistration.Dynamic; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.SessionCookieConfig; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory; import org.apache.http.HttpResponse; @@ -878,7 +879,7 @@ public abstract class AbstractServletWebServerFactoryTests { AtomicReference contextReference = new AtomicReference<>(); this.webServer = factory.getWebServer(contextReference::set); assertThat(contextReference.get().getEffectiveSessionTrackingModes()) - .isEqualTo(EnumSet.of(javax.servlet.SessionTrackingMode.SSL)); + .isEqualTo(EnumSet.of(jakarta.servlet.SessionTrackingMode.SSL)); } @Test @@ -1077,8 +1078,8 @@ public abstract class AbstractServletWebServerFactoryTests { AtomicReference contextReference = new AtomicReference<>(); factory.getWebServer(contextReference::set).start(); ServletContext servletContext = contextReference.get(); - assertThat(servletContext.getEffectiveSessionTrackingModes()) - .isEqualTo(EnumSet.of(javax.servlet.SessionTrackingMode.COOKIE, javax.servlet.SessionTrackingMode.URL)); + assertThat(servletContext.getEffectiveSessionTrackingModes()).isEqualTo( + EnumSet.of(jakarta.servlet.SessionTrackingMode.COOKIE, jakarta.servlet.SessionTrackingMode.URL)); assertThat(servletContext.getSessionCookieConfig().getName()).isEqualTo("testname"); assertThat(servletContext.getSessionCookieConfig().getDomain()).isEqualTo("testdomain"); assertThat(servletContext.getSessionCookieConfig().getPath()).isEqualTo("/testpath"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/CookieSameSiteSupplierTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/CookieSameSiteSupplierTests.java index f676d86217..f663f9959e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/CookieSameSiteSupplierTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/CookieSameSiteSupplierTests.java @@ -19,7 +19,7 @@ package org.springframework.boot.web.servlet.server; import java.util.function.Supplier; import java.util.regex.Pattern; -import javax.servlet.http.Cookie; +import jakarta.servlet.http.Cookie; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/MockServletWebServerFactory.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/MockServletWebServerFactory.java index ab5ea2c14a..eed4ce0164 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/MockServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/MockServletWebServerFactory.java @@ -18,7 +18,7 @@ package org.springframework.boot.web.servlet.server; import java.util.Arrays; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredFilter; import org.springframework.boot.testsupport.web.servlet.MockServletWebServer.RegisteredServlet; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java index 0037850a59..36807dd9d6 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import java.net.URI; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java index e3110ab02c..2d33ea3955 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java @@ -22,13 +22,13 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; import org.apache.catalina.connector.ClientAbortException; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ServletContextApplicationContextInitializerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ServletContextApplicationContextInitializerTests.java index 557ddeb9d2..2c2887c732 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ServletContextApplicationContextInitializerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ServletContextApplicationContextInitializerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package org.springframework.boot.web.servlet.support; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java index eb4d3fa58a..b80fddf6a3 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java @@ -22,11 +22,11 @@ import java.util.Map; import java.util.Vector; import java.util.concurrent.atomic.AtomicBoolean; -import javax.servlet.DispatcherType; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletException; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; +import jakarta.servlet.ServletException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestFilter.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestFilter.java index d4f226c04d..8e734aef2d 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestFilter.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,13 +18,13 @@ package org.springframework.boot.web.servlet.testcomponents; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.annotation.WebFilter; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.annotation.WebFilter; @WebFilter("/*") class TestFilter implements Filter { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestListener.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestListener.java index 0a8b0caeb8..824061f787 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestListener.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -19,15 +19,15 @@ package org.springframework.boot.web.servlet.testcomponents; import java.io.IOException; import java.util.EnumSet; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.annotation.WebListener; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.annotation.WebListener; @WebListener public class TestListener implements ServletContextListener { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestMultipartServlet.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestMultipartServlet.java index ec18453df6..1985e452a9 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestMultipartServlet.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestMultipartServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,9 +16,9 @@ package org.springframework.boot.web.servlet.testcomponents; -import javax.servlet.annotation.MultipartConfig; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; +import jakarta.servlet.annotation.MultipartConfig; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; @WebServlet("/test-multipart") @MultipartConfig(location = "test", maxFileSize = 1024, maxRequestSize = 2048, fileSizeThreshold = 512) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestServlet.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestServlet.java index 0887548827..5405ed7389 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestServlet.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,11 +18,11 @@ package org.springframework.boot.web.servlet.testcomponents; import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; @WebServlet("/test") public class TestServlet extends HttpServlet { diff --git a/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomcatDeploymentTests.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomcatDeploymentTests.java index d959ba578e..3e02d5618b 100644 --- a/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomcatDeploymentTests.java +++ b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomcatDeploymentTests.java @@ -29,7 +29,7 @@ import org.testcontainers.junit.jupiter.Testcontainers; class TomcatDeploymentTests extends AbstractDeploymentTests { @Container - static WarDeploymentContainer container = new WarDeploymentContainer("tomcat:9-jdk8-openjdk", + static WarDeploymentContainer container = new WarDeploymentContainer("tomcat:10.0.13-jdk17-openjdk", "/usr/local/tomcat/webapps", DEFAULT_PORT); @Override 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 566218f11c..b295c94a7d 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 @@ -31,4 +31,5 @@ war { bootBuildImage { archiveFile = war.archiveFile + environment = ['BP_TOMCAT_VERSION': '10.*'] } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/src/main/java/sample/AnnotatedSample.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/src/main/java/sample/AnnotatedSample.java index 06c9695d29..fbb0abad47 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/src/main/java/sample/AnnotatedSample.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/src/main/java/sample/AnnotatedSample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package sample; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java index 8bf6791404..a9da06c992 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java @@ -21,10 +21,10 @@ import java.net.URL; import java.security.CodeSource; import java.security.ProtectionDomain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.catalina.Context; import org.apache.catalina.LifecycleException; diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/src/main/java/org/springframework/boot/loaderapp/LoaderTestApplication.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/src/main/java/org/springframework/boot/loaderapp/LoaderTestApplication.java index 8829ffda79..81b7c41cbd 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/src/main/java/org/springframework/boot/loaderapp/LoaderTestApplication.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/spring-boot-loader-tests-app/src/main/java/org/springframework/boot/loaderapp/LoaderTestApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -21,7 +21,7 @@ import java.net.JarURLConnection; import java.net.URL; import java.util.Arrays; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/autoconfig/ExampleAutoConfiguration.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/autoconfig/ExampleAutoConfiguration.java index 7b11408097..26b523c627 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/autoconfig/ExampleAutoConfiguration.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/autoconfig/ExampleAutoConfiguration.java @@ -18,10 +18,10 @@ package com.autoconfig; import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.autoconfigure.condition.ConditionalOnWarDeployment; import org.springframework.boot.web.servlet.ServletRegistrationBean; diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/JettyServerCustomizerConfig.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/JettyServerCustomizerConfig.java index 2c934be6b4..0c93ab0d23 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/JettyServerCustomizerConfig.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/JettyServerCustomizerConfig.java @@ -16,6 +16,10 @@ package com.example; +import org.eclipse.jetty.http.UriCompliance; +import org.eclipse.jetty.server.AllowedResourceAliasChecker; +import org.eclipse.jetty.server.Connector; +import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.handler.ContextHandler; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -24,10 +28,15 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** - * {@link JettyServerCustomizer} that approves all aliases (Used for Windows CI on - * Concourse). + * {@link JettyServerCustomizer} that: + *

    + *
  • Approves all aliases (Used for Windows CI on + * Concourse) + *
  • Relaxes URI compliance to allow access to static resources with {@code %} in their file name. + *
* * @author Madhura Bhave + * @author Andy Wilkinson */ @ConditionalOnClass(name = {"org.eclipse.jetty.server.handler.ContextHandler"}) @Configuration(proxyBeanMethods = false) @@ -37,7 +46,12 @@ public class JettyServerCustomizerConfig { public JettyServerCustomizer jettyServerCustomizer() { return (server) -> { ContextHandler handler = (ContextHandler) server.getHandler(); - handler.addAliasCheck(new ContextHandler.ApproveAliases()); + handler.addAliasCheck(new AllowedResourceAliasChecker(handler)); + + for (Connector connector : server.getConnectors()) { + connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration() + .setUriCompliance(UriCompliance.LEGACY); + } }; } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/ResourceHandlingApplication.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/ResourceHandlingApplication.java index 8c9092af8d..e165edd781 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/ResourceHandlingApplication.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/ResourceHandlingApplication.java @@ -21,10 +21,10 @@ import java.net.URL; import java.util.LinkedHashSet; import java.util.Set; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplication.java index 8ecc5d5255..a7dd8347f3 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,10 +19,10 @@ package smoketest.actuator.customsecurity; import java.io.IOException; import java.util.function.Supplier; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.SpringApplication; import org.springframework.boot.actuate.endpoint.web.EndpointServlet; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/main/java/smoketest/actuator/SampleController.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/main/java/smoketest/actuator/SampleController.java index 63bce2060e..ead945ec0d 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/main/java/smoketest/actuator/SampleController.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/main/java/smoketest/actuator/SampleController.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -21,7 +21,7 @@ import java.util.Date; import java.util.LinkedHashMap; import java.util.Map; -import javax.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; import org.springframework.context.annotation.Description; import org.springframework.http.MediaType; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/City.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/City.java index df1dd403b1..87d605497b 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/City.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/City.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,11 +18,11 @@ package smoketest.data.jpa.domain; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.SequenceGenerator; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.SequenceGenerator; @Entity public class City implements Serializable { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/Hotel.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/Hotel.java index 7340bf8ecb..2b0132b92e 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/Hotel.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/Hotel.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,14 +19,14 @@ package smoketest.data.jpa.domain; import java.io.Serializable; import java.util.Set; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.SequenceGenerator; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.SequenceGenerator; import org.hibernate.annotations.NaturalId; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/Review.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/Review.java index 341745744d..0015230183 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/Review.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/domain/Review.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,16 +19,16 @@ package smoketest.data.jpa.domain; import java.io.Serializable; import java.util.Date; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.ManyToOne; -import javax.persistence.SequenceGenerator; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; import org.springframework.util.Assert; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/City.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/City.java index b233379bdd..4e11aa953a 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/City.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/City.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,11 +18,11 @@ package smoketest.data.rest.domain; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.SequenceGenerator; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.SequenceGenerator; @Entity public class City implements Serializable { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/Hotel.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/Hotel.java index fec1c813b2..a5ff26a256 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/Hotel.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/Hotel.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,12 +18,12 @@ package smoketest.data.rest.domain; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.ManyToOne; -import javax.persistence.SequenceGenerator; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.SequenceGenerator; import org.hibernate.annotations.NaturalId; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/src/main/java/smoketest/devtools/MyController.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/src/main/java/smoketest/devtools/MyController.java index d415d303d5..9a84606943 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/src/main/java/smoketest/devtools/MyController.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/src/main/java/smoketest/devtools/MyController.java @@ -16,7 +16,7 @@ package smoketest.devtools; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import org.springframework.stereotype.Controller; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/Person.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/Person.java index d459639777..87589370d8 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/Person.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/Person.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,10 +16,10 @@ package smoketest.flyway; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.SequenceGenerator; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.SequenceGenerator; @Entity public class Person { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle index 9706eb1384..310c4eda14 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle @@ -21,7 +21,7 @@ dependencies { providedRuntime("org.eclipse.jetty:apache-jsp") { exclude group: "javax.annotation", module: "javax.annotation-api" - exclude group: "javax.servlet", module: "javax.servlet-api" + exclude group: "jakarta.servlet", module: "jakarta.servlet-api" } runtimeOnly("org.glassfish.web:jakarta.servlet.jsp.jstl") diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/src/test/java/smoketest/jetty/jsp/SampleWebJspApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/src/test/java/smoketest/jetty/jsp/SampleWebJspApplicationTests.java index 22dd4b5882..3961c7d2c6 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/src/test/java/smoketest/jetty/jsp/SampleWebJspApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/src/test/java/smoketest/jetty/jsp/SampleWebJspApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,6 +16,7 @@ package smoketest.jetty.jsp; +import org.eclipse.jetty.server.AllowedResourceAliasChecker; import org.eclipse.jetty.server.handler.ContextHandler; import org.junit.jupiter.api.Test; @@ -59,7 +60,7 @@ class SampleWebJspApplicationTests { JettyServerCustomizer jettyServerCustomizer() { return (server) -> { ContextHandler handler = (ContextHandler) server.getHandler(); - handler.addAliasCheck(new ContextHandler.ApproveAliases()); + handler.addAliasCheck(new AllowedResourceAliasChecker(handler)); }; } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/src/main/java/smoketest/jetty/ExampleServletContextListener.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/src/main/java/smoketest/jetty/ExampleServletContextListener.java index 4eb8bf7830..c8d3555350 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/src/main/java/smoketest/jetty/ExampleServletContextListener.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/src/main/java/smoketest/jetty/ExampleServletContextListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package smoketest.jetty; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; import org.springframework.stereotype.Component; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/build.gradle index 2168014f55..724003bc4b 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/build.gradle @@ -12,7 +12,7 @@ dependencies { if (JavaVersion.current().java9Compatible) { implementation("jakarta.xml.bind:jakarta.xml.bind-api") } - implementation("org.hibernate:hibernate-core") { + implementation("org.hibernate:hibernate-core-jakarta") { exclude group: "javax.activation", module: "javax.activation-api" exclude group: "javax.persistence", module: "javax.persistence-api" exclude group: "javax.xml.bind", module: "jaxb-api" diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/domain/Note.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/domain/Note.java index 5ba294fa89..f1c4720f6e 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/domain/Note.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/domain/Note.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,11 +18,11 @@ package smoketest.jpa.domain; import java.util.List; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.ManyToMany; -import javax.persistence.SequenceGenerator; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.SequenceGenerator; @Entity public class Note { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/domain/Tag.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/domain/Tag.java index 07008b9052..c3464b8337 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/domain/Tag.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/domain/Tag.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,11 +18,11 @@ package smoketest.jpa.domain; import java.util.List; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.ManyToMany; -import javax.persistence.SequenceGenerator; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.SequenceGenerator; @Entity public class Tag { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/repository/JpaNoteRepository.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/repository/JpaNoteRepository.java index b32c84f76b..839b60705f 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/repository/JpaNoteRepository.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/repository/JpaNoteRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,8 +18,8 @@ package smoketest.jpa.repository; import java.util.List; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; import smoketest.jpa.domain.Note; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/repository/JpaTagRepository.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/repository/JpaTagRepository.java index a8e804a5ff..67103dc6e5 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/repository/JpaTagRepository.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/src/main/java/smoketest/jpa/repository/JpaTagRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,8 +18,8 @@ package smoketest.jpa.repository; import java.util.List; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; import smoketest.jpa.domain.Tag; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/src/main/java/smoketest/logback/SampleLogbackApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/src/main/java/smoketest/logback/SampleLogbackApplication.java index e331c1fe15..19dd1e42b8 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/src/main/java/smoketest/logback/SampleLogbackApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/src/main/java/smoketest/logback/SampleLogbackApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package smoketest.logback; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/src/main/java/smoketest/servlet/SampleServletApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/src/main/java/smoketest/servlet/SampleServletApplication.java index cc39d41b46..b9b9e3483e 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/src/main/java/smoketest/servlet/SampleServletApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/src/main/java/smoketest/servlet/SampleServletApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,11 +18,11 @@ package smoketest.servlet; import java.io.IOException; -import javax.servlet.GenericServlet; -import javax.servlet.Servlet; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.GenericServlet; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringBootConfiguration; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/src/main/resources/hazelcast.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/src/main/resources/hazelcast.xml index 4abe5ce1cb..8d2a3bd29e 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/src/main/resources/hazelcast.xml +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/src/main/resources/hazelcast.xml @@ -5,7 +5,7 @@ - principalName + principalName diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-jdbc/src/main/java/smoketest/session/HelloRestController.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-jdbc/src/main/java/smoketest/session/HelloRestController.java index da03243de0..3137566849 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-jdbc/src/main/java/smoketest/session/HelloRestController.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-jdbc/src/main/java/smoketest/session/HelloRestController.java @@ -16,7 +16,7 @@ package smoketest.session; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpSession; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/SampleConfigurationProperties.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/SampleConfigurationProperties.java index 449e6aea59..5782a3281f 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/SampleConfigurationProperties.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/SampleConfigurationProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -16,7 +16,7 @@ package smoketest.simple; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/User.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/User.java index 05fef4cc70..b2d2db0f83 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/User.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/User.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,10 +16,10 @@ package smoketest.test.domain; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; import org.springframework.util.Assert; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/VehicleIdentificationNumberAttributeConverter.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/VehicleIdentificationNumberAttributeConverter.java index f5ae75ee22..5e681faf1c 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/VehicleIdentificationNumberAttributeConverter.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/VehicleIdentificationNumberAttributeConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package smoketest.test.domain; -import javax.persistence.AttributeConverter; -import javax.persistence.Converter; +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; /** * JPA {@link AttributeConverter} for {@link VehicleIdentificationNumber}. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/SampleTestNGApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/SampleTestNGApplication.java index a6b46d4c8f..102ff8e70a 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/SampleTestNGApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/SampleTestNGApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package smoketest.testng; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/main/java/smoketest/tomcat/SampleTomcatApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/main/java/smoketest/tomcat/SampleTomcatApplication.java index c5b501ab2e..00e8c7590e 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/main/java/smoketest/tomcat/SampleTomcatApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/main/java/smoketest/tomcat/SampleTomcatApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -16,8 +16,8 @@ package smoketest.tomcat; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/Message.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/Message.java index 4cac51f446..413137f97a 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/Message.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/Message.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,7 +18,7 @@ package smoketest.groovytemplates; import java.util.Date; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public class Message { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/mvc/MessageController.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/mvc/MessageController.java index f16f3733c7..6557b3a21c 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/mvc/MessageController.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/mvc/MessageController.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -19,7 +19,7 @@ package smoketest.groovytemplates.mvc; import java.util.HashMap; import java.util.Map; -import javax.validation.Valid; +import jakarta.validation.Valid; import smoketest.groovytemplates.Message; import smoketest.groovytemplates.MessageRepository; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/reverse/ReverseWebSocketEndpoint.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/reverse/ReverseWebSocketEndpoint.java index 2522e0ff5b..ea4325cf5e 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/reverse/ReverseWebSocketEndpoint.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/reverse/ReverseWebSocketEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,9 @@ package smoketest.websocket.jetty.reverse; import java.io.IOException; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; @ServerEndpoint("/reverse") public class ReverseWebSocketEndpoint { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/reverse/ReverseWebSocketEndpoint.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/reverse/ReverseWebSocketEndpoint.java index 2e99cff342..e1b9521370 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/reverse/ReverseWebSocketEndpoint.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/reverse/ReverseWebSocketEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,9 @@ package smoketest.websocket.tomcat.reverse; import java.io.IOException; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; @ServerEndpoint("/reverse") public class ReverseWebSocketEndpoint { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/reverse/ReverseWebSocketEndpoint.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/reverse/ReverseWebSocketEndpoint.java index fcfcd11738..c2e9ecfa21 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/reverse/ReverseWebSocketEndpoint.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/reverse/ReverseWebSocketEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 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. @@ -18,9 +18,9 @@ package smoketest.websocket.undertow.reverse; import java.io.IOException; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; @ServerEndpoint("/reverse") public class ReverseWebSocketEndpoint { diff --git a/src/checkstyle/import-control.xml b/src/checkstyle/import-control.xml index af145b76d5..936300d8b5 100644 --- a/src/checkstyle/import-control.xml +++ b/src/checkstyle/import-control.xml @@ -11,7 +11,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -97,7 +97,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -142,7 +142,7 @@ - +