Use WebServerFactoryCustomizer

MSAL

Use 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.MigrateToWebServerFactoryCustomizer
mod run . --recipe=org.openrewrite.java.spring.boot2.MigrateToWebServerFactoryCustomizer

Install 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.

  1. Adjust configuration classes to use the WebServerFactoryCustomizer interface
  2. Change type ConfigurableEmbeddedServletContainer to ConfigurableServletWebServerFactory
  3. Change type TomcatEmbeddedServletContainerFactory to TomcatServletWebServerFactory
  4. Change type JettyEmbeddedServletContainerFactory to JettyServletWebServerFactory
  5. Change type UndertowEmbeddedServletContainerFactory to UndertowServletWebServerFactory