Definition
Preconditions1
Recipes124
124 recipes
- Migrate to Spring Boot 3.5
- Migrate to Spring Cloud 2025.1
- Migrate to Spring Framework 7.0
- Migrate to Spring Security 7.0
- Migrate to Spring Batch 6.0 from 5.2
- Change type
- Change type
- Add
setJobRegistry(..)to manually configuredTaskExecutorJobOperator - Migrate Spring Boot properties to 4.0
- Replace
@MockBeanand@SpyBean - Migrate to Hibernate 7.2.x
- Migrate to testcontainers-java 2.x
- Upgrade to SpringDoc 3.0
- Upgrade Gradle or Maven dependency versions
- Upgrade Gradle or Maven dependency versions
- Upgrade Maven plugin version
- Upgrade Maven parent project version
- Update a Gradle plugin by id
- Update Gradle wrapper
- Update a Gradle plugin by id
- Upgrade Maven plugin version
- Upgrade Gradle or Maven dependency versions
- Migrate
@AutoConfigureMockMvcHtmlUnit attributes to nested@HtmlUnit - Migrate to Spring Boot 4.0 modular starters
- Rename Spring Boot 4.0 starters with managed versions
- Change Gradle or Maven dependency
- Change Gradle or Maven dependency
- Change Gradle or Maven dependency
- Change Gradle or Maven dependency
- Change Gradle or Maven dependency
- Remove a Gradle or Maven dependency
- Change Gradle or Maven dependency
- Upgrade Gradle or Maven dependency versions
- Upgrade Gradle or Maven dependency versions
- Add
@AutoConfigureTestRestTemplateif necessary - Add
@AutoConfigureWebTestClientif necessary - Spring Security 7 modularization
- Sync Gradle ext properties with BOM
- Migrate Spring Cloud properties to 2025.1
- Upgrade Gradle or Maven dependency versions
- Migrate Spring Cloud AWS (awspring) to 4.0
- Upgrade MyBatis to Spring Boot 4.0
- Migrate Spring Retry to Spring Resilience
- Add explicit version for REST Assured
- Upgrade Gradle or Maven dependency versions
- Change type
- Find and replace
- Change type
- Find and replace
- Change type
- Find and replace
- Change type
- Find and replace
- Change type
- Find and replace
- Change type
- Find and replace
- Change type
- Find and replace
- Migrate to Jakarta EE 11
- Migrate to JSpecify
- Change type
- Change type
- Migrate from Elasticsearch 8 to 9
- Migrate to Kafka 4.1
- Migrate
DefaultResponseErrorHandler.handleErrormethod signature - Migrate
handleErrormethod invocations to new signature - Remove path extension content negotiation methods
- Migrate deprecated path mapping options
- Remove deprecated
setPathMatcher()calls - Migrate
HttpHeadersmethods removed whenMultiValueMapcontract was dropped - Add
@MockitoSettings(strictness = Strictness.LENIENT)for@MockitoBeantests - Add
@AutoConfigureMockMvcto@SpringBootTestclasses usingMockMvc - Add MongoDB representation properties for UUID and BigDecimal
- Replace deprecated
org.springframework.boot.autoconfigure.mongoAPI - Replace deprecated
DockerApi - Replace deprecated RequestMatcherProvider with new API
- Replace deprecated
ThreadPoolTaskSchedulerBuilderconstructor - Remove
HttpMessageConvertersAutoConfigurationreferences - Migrate
PropertyMapperAPI for Spring Boot 4.0 - Add
useDefaultJaasConfig=trueto MSSQL Kerberos JDBC URLs - Replace Kotlin property assignment with setter call
- Replace Kotlin property assignment with setter call
- Replace Kotlin property assignment with setter call
- Replace Kotlin property assignment with setter call
- Replace Kotlin property assignment with setter call
- Replace Kotlin property assignment with setter call
- Replace Kotlin property assignment with setter call
- Replace Kotlin property assignment with setter call
- Replace Kotlin property assignment with setter call
- Change type
- Find and replace
- Change type
- Change type
- Flag deprecated ReactorNettyHttpClientMapper for migration
- Change type
- Change type
- Change type
- Change type
- Change type
- Change type
- Change type
- Change type
- Change type
- Rename Maven property key
- Change a Gradle plugin version by id
- Rename package name
- Rename package name
- Change type
- Change type
- Add
spring-boot-starter-validationdependency - Add Jackson2 for Jersey using JSON
- Adopt Jackson 3
- Migrate
JsonFactoryDecoratortoTokenStreamFactoryBuilderDecorator - Remove
ContentNegotiationConfigurer.favorPathExtension()calls - Migrate Spring Session Hazelcast to Hazelcast Spring Session
- Remove Spring Pulsar Reactive support
- Remove
ZipkinAutoConfiguration - Remove
SslBundlesparameter fromKafkaPropertiesbuild methods - Migrate to Spring Boot 4.0 modular starters
- Remove redundant explicit dependencies and versions
- Remove redundant explicit dependency and plugin versions
- Remove
loaderImplementationfrom Gradle - Remove XML tag
Examples
java, java, java
- java
- Diff
Before
import org.springframework.boot.BootstrapContext;
import org.springframework.boot.BootstrapContextClosedEvent;
class A {
void configure(BootstrapContext context, BootstrapContextClosedEvent event) {}
}
After
import org.springframework.boot.bootstrap.BootstrapContext;
import org.springframework.boot.bootstrap.BootstrapContextClosedEvent;
class A {
void configure(BootstrapContext context, BootstrapContextClosedEvent event) {}
}
@@ -1,2 +1,2 @@
-import org.springframework.boot.BootstrapContext;
-import org.springframework.boot.BootstrapContextClosedEvent;
+import org.springframework.boot.bootstrap.BootstrapContext;
+import org.springframework.boot.bootstrap.BootstrapContextClosedEvent;
- java
- Diff
Before
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.BootstrapRegistryInitializer;
class B {
void configure(BootstrapRegistry registry, BootstrapRegistryInitializer initializer) {}
}
After
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.BootstrapRegistryInitializer;
class B {
void configure(BootstrapRegistry registry, BootstrapRegistryInitializer initializer) {}
}
@@ -1,2 +1,2 @@
-import org.springframework.boot.BootstrapRegistry;
-import org.springframework.boot.BootstrapRegistryInitializer;
+import org.springframework.boot.bootstrap.BootstrapRegistry;
+import org.springframework.boot.bootstrap.BootstrapRegistryInitializer;
- java
- Diff
Before
import org.springframework.boot.ConfigurableBootstrapContext;
import org.springframework.boot.DefaultBootstrapContext;
class C {
void configure(ConfigurableBootstrapContext configurableContext, DefaultBootstrapContext defaultContext) {}
}
After
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
import org.springframework.boot.bootstrap.DefaultBootstrapContext;
class C {
void configure(ConfigurableBootstrapContext configurableContext, DefaultBootstrapContext defaultContext) {}
}
@@ -1,2 +1,2 @@
-import org.springframework.boot.ConfigurableBootstrapContext;
-import org.springframework.boot.DefaultBootstrapContext;
+import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
+import org.springframework.boot.bootstrap.DefaultBootstrapContext;
java
- java
- Diff
Before
import org.springframework.boot.env.EnvironmentPostProcessor;
class MyConfig {
void configure(EnvironmentPostProcessor processor) {
}
}
After
import org.springframework.boot.EnvironmentPostProcessor;
class MyConfig {
void configure(EnvironmentPostProcessor processor) {
}
}
@@ -1,1 +1,1 @@
-import org.springframework.boot.env.EnvironmentPostProcessor;
+import org.springframework.boot.EnvironmentPostProcessor;
java
- java
- Diff
Before
import org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksObservabilityAutoConfiguration;
class A {
void configure(ScheduledTasksObservabilityAutoConfiguration config) {}
}
After
import org.springframework.boot.micrometer.observation.autoconfigure.ScheduledTasksObservationAutoConfiguration;
class A {
void configure(ScheduledTasksObservationAutoConfiguration config) {}
}
@@ -1,1 +1,1 @@
-import org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksObservabilityAutoConfiguration;
+import org.springframework.boot.micrometer.observation.autoconfigure.ScheduledTasksObservationAutoConfiguration;
@@ -4,1 +4,1 @@
class A {
- void configure(ScheduledTasksObservabilityAutoConfiguration config) {}
+ void configure(ScheduledTasksObservationAutoConfiguration config) {}
}
java, java, java
- java
- Diff
Before
import org.springframework.boot.BootstrapContext;
import org.springframework.boot.BootstrapContextClosedEvent;
class A {
void configure(BootstrapContext context, BootstrapContextClosedEvent event) {}
}
After
import org.springframework.boot.bootstrap.BootstrapContext;
import org.springframework.boot.bootstrap.BootstrapContextClosedEvent;
class A {
void configure(BootstrapContext context, BootstrapContextClosedEvent event) {}
}
@@ -1,2 +1,2 @@
-import org.springframework.boot.BootstrapContext;
-import org.springframework.boot.BootstrapContextClosedEvent;
+import org.springframework.boot.bootstrap.BootstrapContext;
+import org.springframework.boot.bootstrap.BootstrapContextClosedEvent;
- java
- Diff
Before
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.BootstrapRegistryInitializer;
class B {
void configure(BootstrapRegistry registry, BootstrapRegistryInitializer initializer) {}
}
After
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.BootstrapRegistryInitializer;
class B {
void configure(BootstrapRegistry registry, BootstrapRegistryInitializer initializer) {}
}
@@ -1,2 +1,2 @@
-import org.springframework.boot.BootstrapRegistry;
-import org.springframework.boot.BootstrapRegistryInitializer;
+import org.springframework.boot.bootstrap.BootstrapRegistry;
+import org.springframework.boot.bootstrap.BootstrapRegistryInitializer;
- java
- Diff
Before
import org.springframework.boot.ConfigurableBootstrapContext;
import org.springframework.boot.DefaultBootstrapContext;
class C {
void configure(ConfigurableBootstrapContext configurableContext, DefaultBootstrapContext defaultContext) {}
}
After
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
import org.springframework.boot.bootstrap.DefaultBootstrapContext;
class C {
void configure(ConfigurableBootstrapContext configurableContext, DefaultBootstrapContext defaultContext) {}
}
@@ -1,2 +1,2 @@
-import org.springframework.boot.ConfigurableBootstrapContext;
-import org.springframework.boot.DefaultBootstrapContext;
+import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
+import org.springframework.boot.bootstrap.DefaultBootstrapContext;
java
- java
- Diff
Before
import org.springframework.boot.env.EnvironmentPostProcessor;
class MyConfig {
void configure(EnvironmentPostProcessor processor) {
}
}
After
import org.springframework.boot.EnvironmentPostProcessor;
class MyConfig {
void configure(EnvironmentPostProcessor processor) {
}
}
@@ -1,1 +1,1 @@
-import org.springframework.boot.env.EnvironmentPostProcessor;
+import org.springframework.boot.EnvironmentPostProcessor;
java
- java
- Diff
Before
import org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksObservabilityAutoConfiguration;
class A {
void configure(ScheduledTasksObservabilityAutoConfiguration config) {}
}
After
import org.springframework.boot.micrometer.observation.autoconfigure.ScheduledTasksObservationAutoConfiguration;
class A {
void configure(ScheduledTasksObservationAutoConfiguration config) {}
}
@@ -1,1 +1,1 @@
-import org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksObservabilityAutoConfiguration;
+import org.springframework.boot.micrometer.observation.autoconfigure.ScheduledTasksObservationAutoConfiguration;
@@ -4,1 +4,1 @@
class A {
- void configure(ScheduledTasksObservabilityAutoConfiguration config) {}
+ void configure(ScheduledTasksObservationAutoConfiguration config) {}
}
Usage
Run this recipe
This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI.
You will need to have configured the Moderne CLI on your machine before you can run the following command.
shell
mod run . --recipe io.moderne.java.spring.boot4.UpgradeSpringBoot_4_0
If the recipe is not available locally, then you can install it using:
mod config recipes jar install io.moderne.recipe:rewrite-spring:0.35.0
Data tables
Maven metadata failures
org.openrewrite.maven.table.MavenMetadataFailuresAttempts to resolve maven metadata that failed.
| Column | Description |
|---|---|
| Group id | The groupId of the artifact for which the metadata download failed. |
| Artifact id | The artifactId of the artifact for which the metadata download failed. |
| Version | The version of the artifact for which the metadata download failed. |
| Maven repository | The URL of the Maven repository that the metadata download failed on. |
| Snapshots | Does the repository support snapshots. |
| Releases | Does the repository support releases. |
| Failure | The reason the metadata download failed. |
Source files that had results
org.openrewrite.table.SourcesFileResultsSource files that were modified by the recipe run.
| Column | Description |
|---|---|
| Source path before the run | The source path of the file before the run. null when a source file was created during the run. |
| Source path after the run | A recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run. |
| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. |
| Recipe that made changes | The specific recipe that made a change. |
| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. |
| Cycle | The recipe cycle in which the change was made. |
Source files that had search results
org.openrewrite.table.SearchResultsSearch results that were found during the recipe run.
| Column | Description |
|---|---|
| Source path of search result before the run | The source path of the file with the search result markers present. |
| Source path of search result after run the run | A recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run. |
| Result | The trimmed printed tree of the LST element that the marker is attached to. |
| Description | The content of the description of the marker. |
| Recipe that added the search marker | The specific recipe that added the Search marker. |
Source files that errored on a recipe
org.openrewrite.table.SourcesFileErrorsThe details of all errors produced by a recipe run.
| Column | Description |
|---|---|
| Source path | The file that failed to parse. |
| Recipe that made changes | The specific recipe that made a change. |
| Stack trace | The stack trace of the failure. |
Recipe performance
org.openrewrite.table.RecipeRunStatsStatistics used in analyzing the performance of recipes.
| Column | Description |
|---|---|
| The recipe | The recipe whose stats are being measured both individually and cumulatively. |
| Source file count | The number of source files the recipe ran over. |
| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. |
| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. |
| Max scanning time (ns) | The max time scanning any one source file. |
| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. |
| Max edit time (ns) | The max time editing any one source file. |