Migrate packages to modular starters
Recipe ID
org.openrewrite.java.spring.boot4.MigrateAutoconfigurePackagesArtifactorg.openrewrite.recipe:rewrite-springMigrate to new packages used for autoconfiguration by Spring Boot 4.0 modules.
Composite recipeMSAL
Add to your build
Get a download tokenThis recipe is Moderne licensed, so the token must belong to a Moderne customer. It replaces YOUR_DOWNLOAD_TOKEN below.
~/.gradle/gradle.properties
codeGenomeUsername=you@example.com
codeGenomeToken=YOUR_DOWNLOAD_TOKEN
build.gradle.kts
plugins {
id("org.openrewrite.rewrite") version("latest.release")
}
rewrite {
activeRecipe("org.openrewrite.java.spring.boot4.MigrateAutoconfigurePackages")
}
repositories {
mavenCentral()
maven {
url = uri("https://artifacts.codegenomeproject.org/maven")
credentials {
username = providers.gradleProperty("codeGenomeUsername").get()
password = providers.gradleProperty("codeGenomeToken").get()
}
}
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-spring:6.40.0")
}
Then run
./gradlew rewriteRunUsage
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.boot4.MigrateAutoconfigurePackagesIf the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-spring:RELEASEDefinition
This recipe runs the following recipes in order.
- Rename package name
org.springframework.boot.autoconfigure.jms.activemqtoorg.springframework.boot.activemq.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.amqptoorg.springframework.boot.amqp.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.jms.artemistoorg.springframework.boot.artemis.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.batchtoorg.springframework.boot.batch.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.cachetoorg.springframework.boot.cache.autoconfigureorg.openrewrite.java.ChangePackage - Change type
org.springframework.boot.test.autoconfigure.core.AutoConfigureCachetoorg.springframework.boot.cache.test.autoconfigure.AutoConfigureCacheorg.openrewrite.java.ChangeType - Rename package name
org.springframework.boot.autoconfigure.cassandratoorg.springframework.boot.cassandra.autoconfigureorg.openrewrite.java.ChangePackage - Change type
CassandraDataAutoConfigurationtoDataCassandraAutoConfigurationorg.openrewrite.java.ChangeType - Change type
CassandraReactiveDataAutoConfigurationtoDataCassandraReactiveAutoConfigurationorg.openrewrite.java.ChangeType - Change type
CassandraReactiveRepositoriesAutoConfigurationtoDataCassandraReactiveRepositoriesAutoConfigurationorg.openrewrite.java.ChangeType - Change type
CassandraRepositoriesAutoConfigurationtoDataCassandraRepositoriesAutoConfigurationorg.openrewrite.java.ChangeType - Rename package name
org.springframework.boot.autoconfigure.data.cassandratoorg.springframework.boot.data.cassandra.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.test.autoconfigure.data.cassandratoorg.springframework.boot.data.cassandra.test.autoconfigureorg.openrewrite.java.ChangePackage - Change type
JpaRepositoriesAutoConfigurationtoDataJpaRepositoriesAutoConfigurationorg.openrewrite.java.ChangeType - Change type
JpaRepositoriesRegistrartoDataJpaRepositoriesRegistrarorg.openrewrite.java.ChangeType - Rename package name
org.springframework.boot.autoconfigure.data.jpatoorg.springframework.boot.data.jpa.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.domaintoorg.springframework.boot.persistence.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.daotoorg.springframework.boot.persistence.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.orm.jpatoorg.springframework.boot.hibernate.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.actuate.autoconfigure.metrics.orm.jpatoorg.springframework.boot.hibernate.autoconfigure.metricsorg.openrewrite.java.ChangePackage - Change type
org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureTestEntityManagertoorg.springframework.boot.jpa.test.autoconfigure.AutoConfigureTestEntityManagerorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManagertoorg.springframework.boot.jpa.test.autoconfigure.TestEntityManagerorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManagerAutoConfigurationtoorg.springframework.boot.jpa.test.autoconfigure.TestEntityManagerAutoConfigurationorg.openrewrite.java.ChangeType - Rename package name
org.springframework.boot.test.autoconfigure.orm.jpatoorg.springframework.boot.data.jpa.test.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.jdbctoorg.springframework.boot.jdbc.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.test.autoconfigure.jdbctoorg.springframework.boot.jdbc.test.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.liquibasetoorg.springframework.boot.liquibase.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.flywaytoorg.springframework.boot.flyway.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.graphqltoorg.springframework.boot.graphql.autoconfigureorg.openrewrite.java.ChangePackage - Change type
MongoDataAutoConfigurationtoDataMongoAutoConfigurationorg.openrewrite.java.ChangeType - Change type
MongoReactiveDataAutoConfigurationtoDataMongoReactiveAutoConfigurationorg.openrewrite.java.ChangeType - Change type
MongoRepositoriesAutoConfigurationtoDataMongoRepositoriesAutoConfigurationorg.openrewrite.java.ChangeType - Change type
MongoReactiveRepositoriesAutoConfigurationtoDataMongoReactiveRepositoriesAutoConfigurationorg.openrewrite.java.ChangeType - Rename package name
org.springframework.boot.autoconfigure.data.mongotoorg.springframework.boot.data.mongodb.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.test.autoconfigure.data.mongotoorg.springframework.boot.data.mongodb.test.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.mongotoorg.springframework.boot.mongodb.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.actuate.autoconfigure.data.mongotoorg.springframework.boot.mongodb.autoconfigure.healthorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.actuate.autoconfigure.metrics.mongotoorg.springframework.boot.mongodb.autoconfigure.metricsorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.actuate.data.mongotoorg.springframework.boot.mongodb.healthorg.openrewrite.java.ChangePackage - Change type
StreamsBuilderFactoryBeanCustomizertoStreamsBuilderFactoryBeanConfigurerorg.openrewrite.java.ChangeType - Rename package name
org.springframework.boot.autoconfigure.kafkatoorg.springframework.boot.kafka.autoconfigureorg.openrewrite.java.ChangePackage - Replace constant with another constant
org.openrewrite.java.ReplaceConstantWithAnotherConstant - Replace constant with another constant
org.openrewrite.java.ReplaceConstantWithAnotherConstant - Change type
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfigurationtoorg.springframework.boot.security.autoconfigure.SecurityAutoConfigurationorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfigurationtoorg.springframework.boot.security.autoconfigure.UserDetailsServiceAutoConfigurationorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.servlet.PathRequesttoorg.springframework.boot.security.autoconfigure.web.servlet.PathRequestorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfigurationtoorg.springframework.boot.security.autoconfigure.web.servlet.SecurityFilterAutoConfigurationorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.servlet.StaticResourceRequesttoorg.springframework.boot.security.autoconfigure.web.servlet.StaticResourceRequestorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.ConditionalOnDefaultWebSecuritytoorg.springframework.boot.security.autoconfigure.web.servlet.ConditionalOnDefaultWebSecurityorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.DefaultWebSecurityConditiontoorg.springframework.boot.security.autoconfigure.web.servlet.DefaultWebSecurityConditionorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.StaticResourceLocationtoorg.springframework.boot.security.autoconfigure.web.StaticResourceLocationorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.reactive.PathRequesttoorg.springframework.boot.security.autoconfigure.web.reactive.PathRequestorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.reactive.ReactiveUserDetailsServiceAutoConfigurationtoorg.springframework.boot.security.autoconfigure.ReactiveUserDetailsServiceAutoConfigurationorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.autoconfigure.security.reactive.StaticResourceRequesttoorg.springframework.boot.security.autoconfigure.web.reactive.StaticResourceRequestorg.openrewrite.java.ChangeType - Rename package name
org.springframework.boot.autoconfigure.security.oauth2.server.servlettoorg.springframework.boot.security.oauth2.server.authorization.autoconfigure.servletorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.security.oauth2.clienttoorg.springframework.boot.security.oauth2.client.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.security.oauth2.resourcetoorg.springframework.boot.security.oauth2.server.resource.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.security.saml2toorg.springframework.boot.security.saml2.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.securitytoorg.springframework.boot.security.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.validationtoorg.springframework.boot.validation.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.web.servlettoorg.springframework.boot.webmvc.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.test.autoconfigure.web.servlettoorg.springframework.boot.webmvc.test.autoconfigureorg.openrewrite.java.ChangePackage - Change type
org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTesttoorg.springframework.boot.webflux.test.autoconfigure.WebFluxTestorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebFluxtoorg.springframework.boot.webflux.test.autoconfigure.AutoConfigureWebFluxorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTypeExcludeFiltertoorg.springframework.boot.webflux.test.autoconfigure.WebFluxTypeExcludeFilterorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClienttoorg.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClientorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfigurationtoorg.springframework.boot.webtestclient.autoconfigure.WebTestClientAutoConfigurationorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.test.autoconfigure.web.reactive.SpringBootWebTestClientBuilderCustomizertoorg.springframework.boot.webtestclient.autoconfigure.SpringBootWebTestClientBuilderCustomizerorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.test.web.reactive.server.WebTestClientBuilderCustomizertoorg.springframework.boot.webtestclient.autoconfigure.WebTestClientBuilderCustomizerorg.openrewrite.java.ChangeType - Rename package name
org.springframework.boot.autoconfigure.webservicestoorg.springframework.boot.webservices.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.test.autoconfigure.webservicestoorg.springframework.boot.webservices.test.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.web.clienttoorg.springframework.boot.restclientorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.autoconfigure.web.clienttoorg.springframework.boot.restclient.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.test.autoconfigure.web.clienttoorg.springframework.boot.restclient.test.autoconfigureorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.test.web.clienttoorg.springframework.boot.resttestclientorg.openrewrite.java.ChangePackage - Rename package name
org.springframework.boot.actuate.autoconfigure.security.servlettoorg.springframework.boot.security.autoconfigure.actuate.web.servletorg.openrewrite.java.ChangePackage - Change type
org.springframework.boot.actuate.health.AdditionalHealthEndpointPathtoorg.springframework.boot.health.actuate.endpoint.AdditionalHealthEndpointPathorg.openrewrite.java.ChangeType - Change type
CompositeHealthtoCompositeHealthDescriptororg.openrewrite.java.ChangeType - Change type
HealthComponenttoHealthDescriptororg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.HealthEndpointtoorg.springframework.boot.health.actuate.endpoint.HealthEndpointorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.HealthEndpointGrouptoorg.springframework.boot.health.actuate.endpoint.HealthEndpointGrouporg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.HealthEndpointGroupstoorg.springframework.boot.health.actuate.endpoint.HealthEndpointGroupsorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.HealthEndpointGroupsPostProcessortoorg.springframework.boot.health.actuate.endpoint.HealthEndpointGroupsPostProcessororg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.HealthEndpointSupporttoorg.springframework.boot.health.actuate.endpoint.HealthEndpointSupportorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.HealthEndpointWebExtensiontoorg.springframework.boot.health.actuate.endpoint.HealthEndpointWebExtensionorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.HealthEndpointWebExtensionRuntimeHintstoorg.springframework.boot.health.actuate.endpoint.HealthEndpointWebExtensionRuntimeHintsorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.HttpCodeStatusMappertoorg.springframework.boot.health.actuate.endpoint.HttpCodeStatusMapperorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtensiontoorg.springframework.boot.health.actuate.endpoint.ReactiveHealthEndpointWebExtensionorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.SimpleHttpCodeStatusMappertoorg.springframework.boot.health.actuate.endpoint.SimpleHttpCodeStatusMapperorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.SimpleStatusAggregatortoorg.springframework.boot.health.actuate.endpoint.SimpleStatusAggregatororg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.StatusAggregatortoorg.springframework.boot.health.actuate.endpoint.StatusAggregatororg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.DefaultHealthContributorRegistrytoorg.springframework.boot.health.registry.DefaultHealthContributorRegistryorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.DefaultReactiveHealthContributorRegistrytoorg.springframework.boot.health.registry.DefaultReactiveHealthContributorRegistryorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.HealthContributorRegistrytoorg.springframework.boot.health.registry.HealthContributorRegistryorg.openrewrite.java.ChangeType - Change type
org.springframework.boot.actuate.health.ReactiveHealthContributorRegistrytoorg.springframework.boot.health.registry.ReactiveHealthContributorRegistryorg.openrewrite.java.ChangeType - Rename package name
org.springframework.boot.actuate.healthtoorg.springframework.boot.health.contributororg.openrewrite.java.ChangePackage - Change method name
org.springframework.boot.health.contributor.HealthIndicator getHealth(..)tohealthorg.openrewrite.java.ChangeMethodName - Change type
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfigurationtoorg.springframework.boot.jackson.autoconfigure.JacksonAutoConfigurationorg.openrewrite.java.ChangeType
Data tables
Structured output this recipe can produce.
- 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