Use WebServerFactoryCustomizer
MSALUse WebServerFactoryCustomizer instead of the deprecated EmbeddedServletContainerCustomizer in Spring Boot 2.0 or higher. This recipe will replace look for any classes that implement EmbeddedServletContainerCustomizer and change the interface to WebServerFactoryCustomizer<ConfigurableServletWebServerFactory>. This recipe also adjusts the types used in the customize() method from *EmbeddedServletContainerFactory to their *ServletWebServerFactory counterparts.
org. openrewrite. java. spring. boot2. MigrateToWebServerFactoryCustomizermod run . --recipe= org. openrewrite. java. spring. boot2. MigrateToWebServerFactoryCustomizerInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Adjust configuration classes to use the
WebServerFactoryCustomizerinterface - Change type
ConfigurableEmbeddedServletContainertoConfigurableServletWebServerFactory - Change type
TomcatEmbeddedServletContainerFactorytoTomcatServletWebServerFactory - Change type
JettyEmbeddedServletContainerFactorytoJettyServletWebServerFactory - Change type
UndertowEmbeddedServletContainerFactorytoUndertowServletWebServerFactory