Migrate to Spring Boot 3.0
MSALMigrate applications to the latest Spring Boot 3.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.0.
org. openrewrite. java. spring. boot3. UpgradeSpringBoot_3_0mod run . --recipe= org. openrewrite. java. spring. boot3. UpgradeSpringBoot_3_0Install 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.
- Migrate to Spring Boot 2.7
- Remove
@EnableBatchProcessingfrom Spring Boot applications - Change type
org.hibernate.validator.internal.constraintvalidators.hv.EmailValidatortoorg.hibernate.validator.internal.constraintvalidators.bv.EmailValidator - Migrate to Java 17
- Upgrade Gradle or Maven dependency versions
org.springframework.boot:*:3.0.x - Upgrade Gradle or Maven dependency versions
org.springframework.boot:spring-boot-dependencies:3.0.x - Upgrade Gradle or Maven dependency versions
org.springframework:*:6.0.x - Upgrade Gradle or Maven dependency versions
org.springframework.ws:*:4.x - Upgrade Maven plugin version
org.springframework.boot:spring-boot-maven-plugin:3.0.x - Upgrade Maven parent project version to
org.springframework.boot:spring-boot-starter-parent:3.0.x - Update a Gradle plugin by id
org.springframework.boot - Update a Gradle plugin by id
io.spring.dependency-management - Update Gradle wrapper ^7.4-bin
- Migrate to Spring Framework 6.0
- Remove Unnecessary
@ConstructorBinding - Use
AutoConfiguration#imports - Remove the deprecated properties
additional-keys-to-sanitizefrom theconfigpropsandenvend points - Rename
server.max-http-header-sizetoserver.max-http-request-header-size - Downgrade Jakarta Servlet API to 5.0 when using Jetty
- Add
@Configurationto classes with@EnableXXXSecurityannotationsfalse - Migrate Spring Boot properties to 3.0
- Migrate Thymeleaf dependencies to Spring Boot 3.x
- Migrate Dropwizard dependencies to Spring Boot 3.x
- Rename
logback.xmltologback-spring.xml - Remove
SolrAutoConfiguration - Migrate
WebMvcTagsProvidertoDefaultServerRequestObservationConvention @Beanmethods may not returnvoid- Migrate to Spring Batch 5.0 from 4.3
- Migrate to Spring Security 6.0
- Migrate to Spring Cloud 2022
- Upgrade to SpringDoc 2.1
- Migrate to Hibernate 6.1.x
- Upgrade MyBatis to Spring Boot 3.0
- Migrate SAP Cloud Foundry logging support to Spring Boot 3.x