Migrate Spring Boot properties to 2.6
org.openrewrite.java.spring.boot2.SpringBootProperties_2_6 Migrate properties found in
application.properties
and application.yml
.- groupId: org.openrewrite.recipe
- artifactId: rewrite-spring
- version: 4.34.0
This recipe has no required configuration options. It can be activated by adding a dependency on
org.openrewrite.recipe:rewrite-spring:4.34.0
in your build file or by running a shell command (in which case no build changes are needed):Gradle
Maven POM
Maven Command Line
build.gradle
plugins {
id("org.openrewrite.rewrite") version("5.38.0")
}
​
rewrite {
activeRecipe("org.openrewrite.java.spring.boot2.SpringBootProperties_2_6")
}
​
repositories {
mavenCentral()
}
​
dependencies {
rewrite("org.openrewrite.recipe:rewrite-spring:4.34.0")
}
pom.xml
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>4.42.0</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.spring.boot2.SpringBootProperties_2_6</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
<version>4.34.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
shell
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:LATEST \
-Drewrite.activeRecipes=org.openrewrite.java.spring.boot2.SpringBootProperties_2_6
Recipe List
Yaml Recipe List
- oldPropertyKey:
spring.data.mongodb.grid-fs-database
- newPropertyKey:
spring.data.mongodb.gridfs.database
- oldPropertyKey:
spring.mvc.locale
- newPropertyKey:
spring.web.locale
- oldPropertyKey:
spring.mvc.locale-resolver
- newPropertyKey:
spring.web.locale-resolver
- oldPropertyKey:
spring.resources.add-mappings
- newPropertyKey:
spring.web.resources.add-mappings
- oldPropertyKey:
spring.resources.cache.cachecontrol.cache-private
- newPropertyKey:
spring.web.resources.cache.cachecontrol.cache-private
- oldPropertyKey:
spring.resources.cache.cachecontrol.cache-public
- newPropertyKey:
spring.web.resources.cache.cachecontrol.cache-public
- oldPropertyKey:
spring.resources.cache.cachecontrol.max-age
- newPropertyKey:
spring.web.resources.cache.cachecontrol.max-age
- oldPropertyKey:
spring.resources.cache.cachecontrol.must-revalidate
- newPropertyKey:
spring.web.resources.cache.cachecontrol.must-revalidate
- oldPropertyKey:
spring.resources.cache.cachecontrol.no-cache
- newPropertyKey:
spring.web.resources.cache.cachecontrol.no-cache
- oldPropertyKey:
spring.resources.cache.cachecontrol.no-store
- newPropertyKey:
spring.web.resources.cache.cachecontrol.no-store
- oldPropertyKey:
spring.resources.cache.cachecontrol.no-transform
- newPropertyKey:
spring.web.resources.cache.cachecontrol.no-transform
- oldPropertyKey:
spring.resources.cache.cachecontrol.proxy-revalidate
- newPropertyKey:
spring.web.resources.cache.cachecontrol.proxy-revalidate
- oldPropertyKey:
spring.resources.cache.cachecontrol.s-max-age
- newPropertyKey:
spring.web.resources.cache.cachecontrol.s-max-age
- oldPropertyKey:
spring.resources.cache.cachecontrol.stale-if-error
- newPropertyKey:
spring.web.resources.cache.cachecontrol.stale-if-error
- oldPropertyKey:
spring.resources.cache.cachecontrol.stale-while-revalidate
- newPropertyKey:
spring.web.resources.cache.cachecontrol.stale-while-revalidate
- oldPropertyKey:
spring.resources.cache.period
- newPropertyKey:
spring.web.resources.cache.period
- oldPropertyKey:
spring.resources.cache.use-last-modified
- newPropertyKey:
spring.web.resources.cache.use-last-modified
- oldPropertyKey:
spring.resources.chain.cache
- newPropertyKey:
spring.web.resources.chain.cache
- oldPropertyKey:
spring.resources.chain.compressed
- newPropertyKey:
spring.web.resources.chain.compressed
- oldPropertyKey:
spring.resources.chain.enabled
- newPropertyKey:
spring.web.resources.chain.enabled
- oldPropertyKey:
spring.resources.chain.strategy.content.enabled
- newPropertyKey:
spring.web.resources.chain.strategy.content.enabled
- oldPropertyKey:
spring.resources.chain.strategy.content.paths
- newPropertyKey:
spring.web.resources.chain.strategy.content.paths
- oldPropertyKey:
spring.resources.chain.strategy.fixed.enabled
- newPropertyKey:
spring.web.resources.chain.strategy.fixed.enabled
- oldPropertyKey:
spring.resources.chain.strategy.fixed.paths
- newPropertyKey:
spring.web.resources.chain.strategy.fixed.paths
- oldPropertyKey:
spring.resources.chain.strategy.fixed.version
- newPropertyKey:
spring.web.resources.chain.strategy.fixed.version
- oldPropertyKey:
spring.resources.static-locations
- newPropertyKey:
spring.web.resources.static-locations
- oldPropertyKey:
management.server.servlet.context-path
- newPropertyKey:
management.server.base-path
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_6
displayName: Migrate Spring Boot properties to 2.6
description: Migrate properties found in `application.properties` and `application.yml`.
recipeList:
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.mongodb.grid-fs-database
newPropertyKey: spring.data.mongodb.gridfs.database
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.mvc.locale
newPropertyKey: spring.web.locale
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.mvc.locale-resolver
newPropertyKey: spring.web.locale-resolver
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.add-mappings
newPropertyKey: spring.web.resources.add-mappings
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.cache-private
newPropertyKey: spring.web.resources.cache.cachecontrol.cache-private
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.cache-public
newPropertyKey: spring.web.resources.cache.cachecontrol.cache-public
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.max-age
newPropertyKey: spring.web.resources.cache.cachecontrol.max-age
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.must-revalidate
newPropertyKey: spring.web.resources.cache.cachecontrol.must-revalidate
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.no-cache
newPropertyKey: spring.web.resources.cache.cachecontrol.no-cache
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.no-store
newPropertyKey: spring.web.resources.cache.cachecontrol.no-store
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.no-transform
newPropertyKey: spring.web.resources.cache.cachecontrol.no-transform
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.proxy-revalidate
newPropertyKey: spring.web.resources.cache.cachecontrol.proxy-revalidate
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.s-max-age
newPropertyKey: spring.web.resources.cache.cachecontrol.s-max-age
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.stale-if-error
newPropertyKey: spring.web.resources.cache.cachecontrol.stale-if-error
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.stale-while-revalidate
newPropertyKey: spring.web.resources.cache.cachecontrol.stale-while-revalidate
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.period
newPropertyKey: spring.web.resources.cache.period
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.cache.use-last-modified
newPropertyKey: spring.web.resources.cache.use-last-modified
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.chain.cache
newPropertyKey: spring.web.resources.chain.cache
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.chain.compressed
newPropertyKey: spring.web.resources.chain.compressed
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.chain.enabled
newPropertyKey: spring.web.resources.chain.enabled
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.chain.strategy.content.enabled
newPropertyKey: spring.web.resources.chain.strategy.content.enabled
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.chain.strategy.content.paths
newPropertyKey: spring.web.resources.chain.strategy.content.paths
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.chain.strategy.fixed.enabled
newPropertyKey: spring.web.resources.chain.strategy.fixed.enabled
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.chain.strategy.fixed.paths
newPropertyKey: spring.web.resources.chain.strategy.fixed.paths
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.chain.strategy.fixed.version
newPropertyKey: spring.web.resources.chain.strategy.fixed.version
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.resources.static-locations
newPropertyKey: spring.web.resources.static-locations
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: management.server.servlet.context-path
newPropertyKey: management.server.base-path
​
The Moderne public SaaS instance enables you to easily run recipes across thousands of open-source repositories.
Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.