Comment on page
Migrate Spring Boot properties to 2.0
org.openrewrite.java.spring.boot2.SpringBootProperties_2_0
Migrate properties found in
application.properties
and application.yml
.- spring
- boot
- groupId: org.openrewrite.recipe
- artifactId: rewrite-spring
- version: 5.1.2
This recipe is composed of more than one recipe. If you want to customize the set of recipes this is composed of, you can find and copy the GitHub source for the recipe from the link above.
This recipe has no required configuration options. It can be activated by adding a dependency on
org.openrewrite.recipe:rewrite-spring:5.1.2
in your build file or by running a shell command (in which case no build changes are needed):Gradle
Gradle init script
Maven POM
Maven Command Line
Moderne CLI
- 1.Add the following to your
build.gradle
file:
build.gradle
plugins {
id("org.openrewrite.rewrite") version("6.5.6")
}
rewrite {
activeRecipe("org.openrewrite.java.spring.boot2.SpringBootProperties_2_0")
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-spring:5.1.2")
}
- 2.Run
gradle rewriteRun
to run the recipe.
- 1.Create a file named
init.gradle
in the root of your project.
init.gradle
initscript {
repositories {
maven { url "https://plugins.gradle.org/m2" }
}
dependencies { classpath("org.openrewrite:plugin:6.5.6") }
}
rootProject {
plugins.apply(org.openrewrite.gradle.RewritePlugin)
dependencies {
rewrite("org.openrewrite.recipe:rewrite-spring:5.1.2")
}
rewrite {
activeRecipe("org.openrewrite.java.spring.boot2.SpringBootProperties_2_0")
}
afterEvaluate {
if (repositories.isEmpty()) {
repositories {
mavenCentral()
}
}
}
}
- 2.Run
gradle --init-script init.gradle rewriteRun
to run the recipe.
- 1.Add the following to your
pom.xml
file:
pom.xml
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.13.0</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.spring.boot2.SpringBootProperties_2_0</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
<version>5.1.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
- 2.Run
mvn rewrite:run
to run the recipe.
shell
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE \
-Drewrite.activeRecipes=org.openrewrite.java.spring.boot2.SpringBootProperties_2_0
You will need to have configured the Moderne CLI on your machine before you can run the following command.
shell
mod run . --recipe SpringBootProperties_2_0
Recipe List
Yaml Recipe List
- oldPropertyKey:
spring.main.show-banner
- newPropertyKey:
spring.main.banner-mode
- oldPropertyKey:
spring.main.web-environment
- newPropertyKey:
spring.main.web-application-type
- oldPropertyKey:
banner.charset
- newPropertyKey:
spring.banner.charset
- oldPropertyKey:
banner.image.height
- newPropertyKey:
spring.banner.image.height
- oldPropertyKey:
banner.image.invert
- newPropertyKey:
spring.banner.image.invert
- oldPropertyKey:
banner.image.location
- newPropertyKey:
spring.banner.image.location
- oldPropertyKey:
banner.image.margin
- newPropertyKey:
spring.banner.image.margin
- oldPropertyKey:
banner.image.width
- newPropertyKey:
spring.banner.image.width
- oldPropertyKey:
banner.location
- newPropertyKey:
spring.banner.location
- oldPropertyKey:
security.filter-dispatcher-types
- newPropertyKey:
spring.security.filter.dispatcher-types
- oldPropertyKey:
security.filter-order
- newPropertyKey:
spring.security.filter.order
- oldPropertyKey:
spring.data.cassandra.repositories.enabled
- newPropertyKey:
spring.data.cassandra.repositories.type
- oldPropertyKey:
spring.data.couchbase.repositories.enabled
- newPropertyKey:
spring.data.couchbase.repositories.type
- oldPropertyKey:
spring.data.mongodb.repositories.enabled
- newPropertyKey:
spring.data.mongodb.repositories.type
- oldPropertyKey:
spring.jta.bitronix.properties.background-recovery-interval
- newPropertyKey:
spring.jta.bitronix.properties.background-recovery-interval-seconds
- oldPropertyKey:
spring.mvc.media-types
- newPropertyKey:
spring.mvc.contentnegotiation.media-types
- oldPropertyKey:
flyway.baseline-description
- newPropertyKey:
spring.flyway.baseline-description
- oldPropertyKey:
flyway.baseline-on-migrate
- newPropertyKey:
spring.flyway.baseline-on-migrate
- oldPropertyKey:
flyway.baseline-version
- newPropertyKey:
spring.flyway.baseline-version
- oldPropertyKey:
flyway.check-location
- newPropertyKey:
spring.flyway.check-location
- oldPropertyKey:
flyway.clean-on-validation-error
- newPropertyKey:
spring.flyway.clean-on-validation-error
- oldPropertyKey:
flyway.enabled
- newPropertyKey:
spring.flyway.enabled
- oldPropertyKey:
flyway.encoding
- newPropertyKey:
spring.flyway.encoding
- oldPropertyKey:
flyway.init-sqls
- newPropertyKey:
spring.flyway.init-sqls
- oldPropertyKey:
flyway.locations
- newPropertyKey:
spring.flyway.locations
- oldPropertyKey:
flyway.out-of-order
- newPropertyKey:
spring.flyway.out-of-order
- oldPropertyKey:
flyway.password
- newPropertyKey:
spring.flyway.password
- oldPropertyKey:
flyway.placeholder-prefix
- newPropertyKey:
spring.flyway.placeholder-prefix
- oldPropertyKey:
flyway.placeholder-replacement
- newPropertyKey:
spring.flyway.placeholder-replacement
- oldPropertyKey:
flyway.placeholder-suffix
- newPropertyKey:
spring.flyway.placeholder-suffix
- oldPropertyKey:
flyway.placeholders
- newPropertyKey:
spring.flyway.placeholders
- oldPropertyKey:
flyway.schemas
- newPropertyKey:
spring.flyway.schemas
- oldPropertyKey:
flyway.sql-migration-prefix
- newPropertyKey:
spring.flyway.sql-migration-prefix
- oldPropertyKey:
flyway.sql-migration-separator
- newPropertyKey:
spring.flyway.sql-migration-separator
- oldPropertyKey:
flyway.sql-migration-suffix
- newPropertyKey:
spring.flyway.sql-migration-suffixes
- oldPropertyKey:
flyway.table
- newPropertyKey:
spring.flyway.table
- oldPropertyKey:
flyway.target
- newPropertyKey:
spring.flyway.target
- oldPropertyKey:
flyway.url
- newPropertyKey:
spring.flyway.url
- oldPropertyKey:
flyway.user
- newPropertyKey:
spring.flyway.user
- oldPropertyKey:
flyway.validate-on-migrate
- newPropertyKey:
spring.flyway.validate-on-migrate
- oldPropertyKey:
liquibase.change-log
- newPropertyKey:
spring.liquibase.change-log
- oldPropertyKey:
liquibase.check-change-log-location
- newPropertyKey:
spring.liquibase.check-change-log-location
- oldPropertyKey:
liquibase.contexts
- newPropertyKey:
spring.liquibase.contexts
- oldPropertyKey:
liquibase.default-schema
- newPropertyKey:
spring.liquibase.default-schema
- oldPropertyKey:
liquibase.drop-first
- newPropertyKey:
spring.liquibase.drop-first
- oldPropertyKey:
liquibase.enabled
- newPropertyKey:
spring.liquibase.enabled
- oldPropertyKey:
liquibase.labels
- newPropertyKey:
spring.liquibase.labels
- oldPropertyKey:
liquibase.parameters
- newPropertyKey:
spring.liquibase.parameters
- oldPropertyKey:
liquibase.password
- newPropertyKey:
spring.liquibase.password
- oldPropertyKey:
liquibase.rollback-file
- newPropertyKey:
spring.liquibase.rollback-file
- oldPropertyKey:
liquibase.url
- newPropertyKey:
spring.liquibase.url
- oldPropertyKey:
liquibase.user
- newPropertyKey:
spring.liquibase.user
- oldPropertyKey:
security.user.name
- newPropertyKey:
spring.security.user.name
- oldPropertyKey:
security.user.password
- newPropertyKey:
spring.security.user.password
- oldPropertyKey:
security.user.role
- newPropertyKey:
spring.security.user.roles
- oldPropertyKey:
server.context-parameters
- newPropertyKey:
server.servlet.context-parameters
- oldPropertyKey:
server.context-path
- newPropertyKey:
server.servlet.context-path
- oldPropertyKey:
server.display-name
- newPropertyKey:
server.servlet.application-display-name
- oldPropertyKey:
server.jsp-servlet.class-name
- newPropertyKey:
server.servlet.jsp.class-name
- oldPropertyKey:
server.jsp-servlet.init-parameters
- newPropertyKey:
server.servlet.jsp.init-parameters
- oldPropertyKey:
server.jsp-servlet.registered
- newPropertyKey:
server.servlet.jsp.registered
- oldPropertyKey:
server.servlet-path
- newPropertyKey:
server.servlet.path
- oldPropertyKey:
server.session.cookie.comment
- newPropertyKey:
server.servlet.session.cookie.comment
- oldPropertyKey:
server.session.cookie.domain
- newPropertyKey:
server.servlet.session.cookie.domain
- oldPropertyKey:
server.session.cookie.http-only
- newPropertyKey:
server.servlet.session.cookie.http-only
- oldPropertyKey:
server.session.cookie.max-age
- newPropertyKey:
server.servlet.session.cookie.max-age
- oldPropertyKey:
server.session.cookie.name
- newPropertyKey:
server.servlet.session.cookie.name
- oldPropertyKey:
server.session.cookie.path
- newPropertyKey:
server.servlet.session.cookie.path
- oldPropertyKey:
server.session.cookie.secure
- newPropertyKey:
server.servlet.session.cookie.secure
- oldPropertyKey:
server.session.persistent
- newPropertyKey:
server.servlet.session.persistent
- oldPropertyKey:
server.session.store-dir
- newPropertyKey:
server.servlet.session.store-dir
- oldPropertyKey:
server.session.timeout
- newPropertyKey:
server.servlet.session.timeout
- oldPropertyKey:
server.session.tracking-modes
- newPropertyKey:
server.servlet.session.tracking-modes
- oldPropertyKey:
spring.batch.initializer.enabled
- newPropertyKey:
spring.batch.initialize-schema
- oldPropertyKey:
spring.data.cassandra.connect-timeout-millis
- newPropertyKey:
spring.data.cassandra.connect-timeout
- oldPropertyKey:
spring.data.cassandra.read-timeout-millis
- newPropertyKey:
spring.data.cassandra.read-timeout
- oldPropertyKey:
spring.datasource.initialize
- newPropertyKey:
spring.datasource.initialization-mode
- oldPropertyKey:
spring.flyway.sql-migration-suffix
- newPropertyKey:
spring.flyway.sql-migration-suffixes
- oldPropertyKey:
spring.git.properties
- newPropertyKey:
spring.info.git.location
- oldPropertyKey:
spring.http.multipart.enabled
- newPropertyKey:
spring.servlet.multipart.enabled
- oldPropertyKey:
spring.http.multipart.file-size-threshold
- newPropertyKey:
spring.servlet.multipart.file-size-threshold
- oldPropertyKey:
spring.http.multipart.location
- newPropertyKey:
spring.servlet.multipart.location
- oldPropertyKey:
spring.http.multipart.max-file-size
- newPropertyKey:
spring.servlet.multipart.max-file-size
- oldPropertyKey:
spring.http.multipart.max-request-size
- newPropertyKey:
spring.servlet.multipart.max-request-size
- oldPropertyKey:
spring.http.multipart.resolve-lazily
- newPropertyKey:
spring.servlet.multipart.resolve-lazily
- oldPropertyKey:
spring.messages.cache-seconds
- newPropertyKey:
spring.messages.cache-duration
- oldPropertyKey:
spring.redis.pool.max-active
- newPropertyKey:
spring.redis.jedis.pool.max-idle
- oldPropertyKey:
spring.redis.pool.max-idle
- newPropertyKey:
spring.redis.jedis.pool.max-idle
- oldPropertyKey:
spring.redis.pool.max-wait
- newPropertyKey:
spring.redis.jedis.pool.max-wait
- oldPropertyKey:
spring.redis.pool.min-idle
- newPropertyKey:
spring.redis.jedis.pool.min-idle
- oldPropertyKey:
spring.resources.cache-period
- newPropertyKey:
spring.resources.cache.period
- oldPropertyKey:
spring.session.jdbc.initializer.enabled
- newPropertyKey:
spring.session.jdbc.initialize-schema
- oldPropertyKey:
spring.session.mongo.collection-name
- newPropertyKey:
spring.session.mongodb.collection-name
- oldPropertyKey:
spring.thymeleaf.content-type
- newPropertyKey:
spring.thymeleaf.servlet.content-type
- oldPropertyKey:
spring.couchbase.env.endpoints.query
- newPropertyKey:
spring.couchbase.env.endpoints.queryservice.max-endpoints
- oldPropertyKey:
spring.couchbase.env.endpoints.view
- newPropertyKey:
spring.couchbase.env.endpoints.viewservice.max-endpoints
- oldPropertyKey:
endpoints.auditevents.enabled
- newPropertyKey:
management.endpoint.auditevents.enabled
- oldPropertyKey:
endpoints.auditevents.path
- newPropertyKey:
management.endpoints.web.path-mapping.auditevents
- oldPropertyKey:
endpoints.autoconfig.enabled
- newPropertyKey:
management.endpoint.conditions.enabled
- oldPropertyKey:
endpoints.autoconfig.path
- newPropertyKey:
management.endpoints.web.path-mapping.conditions
- oldPropertyKey:
endpoints.beans.enabled
- newPropertyKey:
management.endpoint.beans.enabled
- oldPropertyKey:
endpoints.beans.path
- newPropertyKey:
management.endpoints.web.path-mapping.beans
- oldPropertyKey:
endpoints.configprops.enabled
- newPropertyKey:
management.endpoint.configprops.enabled
- oldPropertyKey:
endpoints.configprops.keys-to-sanitize
- newPropertyKey:
management.endpoint.configprops.keys-to-sanitize
- oldPropertyKey:
endpoints.configprops.path
- newPropertyKey:
management.endpoints.web.path-mapping.configprops
- oldPropertyKey:
endpoints.cors.allow-credentials
- newPropertyKey:
management.endpoints.web.cors.allow-credentials
- oldPropertyKey:
endpoints.cors.allowed-headers
- newPropertyKey:
management.endpoints.web.cors.allowed-headers
- oldPropertyKey:
endpoints.cors.allowed-methods
- newPropertyKey:
management.endpoints.web.cors.allowed-methods
- oldPropertyKey:
endpoints.cors.allowed-origins
- newPropertyKey:
management.endpoints.web.cors.allowed-origins
- oldPropertyKey:
endpoints.cors.exposed-headers
- newPropertyKey:
management.endpoints.web.cors.exposed-headers
- oldPropertyKey:
endpoints.cors.max-age
- newPropertyKey:
management.endpoints.web.cors.max-age
- oldPropertyKey:
endpoints.dump.enabled
- newPropertyKey:
management.endpoint.threaddump.enabled
- oldPropertyKey:
endpoints.dump.path
- newPropertyKey:
management.endpoints.web.path-mapping.dump