Migrate to Spring Boot 3.0
Recipe ID
org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0Artifact
org.openrewrite.recipe:rewrite-springMigrate 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 2.7.
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-spring:6.36.0Definition
This recipe runs the following recipes in order.
- Migrate to Spring Boot 2.7
org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7 - Enable Spring Batch Annotation
org.openrewrite.java.spring.boot3.RemoveEnableBatchProcessing - Migrate to Java 17
org.openrewrite.java.migrate.UpgradeToJava17 - Upgrade Gradle or Maven dependency versions
org.openrewrite.java.dependencies.UpgradeDependencyVersion - Upgrade Gradle or Maven dependency versions
org.openrewrite.java.dependencies.UpgradeDependencyVersion - Upgrade Gradle or Maven dependency versions
org.openrewrite.java.dependencies.UpgradeDependencyVersion - Upgrade Gradle or Maven dependency versions
org.openrewrite.java.dependencies.UpgradeDependencyVersion - Upgrade Maven plugin version
org.openrewrite.maven.UpgradePluginVersion - Upgrade Maven parent project version
org.openrewrite.maven.UpgradeParentVersion - Update a Gradle plugin by id
org.openrewrite.gradle.plugins.UpgradePluginVersion - Update a Gradle plugin by id
org.openrewrite.gradle.plugins.UpgradePluginVersion - Update Gradle wrapper
org.openrewrite.gradle.UpdateGradleWrapper - Migrate to Spring Framework 6.0
org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_0 - Remove Unnecessary
@ConstructorBindingorg.openrewrite.java.spring.boot3.RemoveConstructorBindingAnnotation - Use
AutoConfiguration#importsorg.openrewrite.java.spring.boot2.MoveAutoConfigurationToImportsFile - Remove the deprecated properties
additional-keys-to-sanitizefrom theconfigpropsandenvend pointsorg.openrewrite.java.spring.boot3.ActuatorEndpointSanitization - Rename
server.max-http-header-sizetoserver.max-http-request-header-sizeorg.openrewrite.java.spring.boot3.MigrateMaxHttpHeaderSize - Downgrade Jakarta Servlet API to 5.0 when using Jetty
org.openrewrite.java.spring.boot3.DowngradeServletApiWhenUsingJetty - Add
@Configurationto classes with@EnableXXXSecurityannotationsorg.openrewrite.java.spring.boot3.ConfigurationOverEnableSecurity - Migrate Spring Boot properties to 3.0
org.openrewrite.java.spring.boot3.SpringBootProperties_3_0 - Migrate thymeleaf dependencies to Spring Boot 3.x
org.openrewrite.java.spring.boot3.MigrateThymeleafDependencies - Migrate dropWizard dependencies to Spring Boot 3.x
org.openrewrite.java.spring.boot3.MigrateDropWizardDependencies - Rename
logback.xmltologback-spring.xmlorg.openrewrite.java.spring.boot3.RenameLogbackToLogbackSpring - Remove
SolrAutoConfigurationorg.openrewrite.java.spring.boot3.RemoveSolrAutoConfigurationExclude - Migrate
WebMvcTagsProvidertoDefaultServerRequestObservationConventionorg.openrewrite.java.spring.boot3.MigrateWebMvcTagsToObservationConvention @Beanmethods may not returnvoidorg.openrewrite.java.spring.framework.BeanMethodReturnNull- Migrate to Spring Batch 5.0 from 4.3
org.openrewrite.java.spring.batch.SpringBatch4To5Migration - Migrate to Spring Security 6.0
org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_0 - Migrate to Spring Cloud 2022
org.openrewrite.java.spring.cloud2022.UpgradeSpringCloud_2022 - Upgrade to SpringDoc 2.1
org.openrewrite.java.springdoc.UpgradeSpringDoc_2 - Migrate to Hibernate 6.1.x
org.openrewrite.hibernate.MigrateToHibernate61 - Upgrade MyBatis to Spring Boot 3.0
org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_3_0 - Migrate SAP cloud foundry logging support to Spring Boot 3.x
org.openrewrite.java.spring.boot3.MigrateSapCfJavaLoggingSupport
Data tables
Structured output this recipe can produce.
- Maven metadata failuresAttempts to resolve maven metadata that failed.
org.openrewrite.maven.table.MavenMetadataFailures - Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats