Reference
Recipes
Java
Spring
Spring Boot 2.x
Design Partners
Migrate Spring Boot properties to 2.6
** org.openrewrite.java.spring.boot2.SpringBootProperties_2_6** Migrate properties found in application.properties and application.yml.

Source

  • groupId: org.openrewrite.recipe
  • artifactId: rewrite-spring
  • version: 4.25.1

Usage

This recipe has no required configuration options and can be activated directly after taking a dependency on org.openrewrite.recipe:rewrite-spring:4.25.1 in your build file:
Gradle
Maven
build.gradle
plugins {
id("org.openrewrite.rewrite") version("5.26.1")
}
rewrite {
activeRecipe("org.openrewrite.java.spring.boot2.SpringBootProperties_2_6")
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-spring:4.25.1")
}
pom.xml
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>4.31.1</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.25.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Recipes can also be activated directly from the command line by adding the argument -Drewrite.activeRecipesorg.openrewrite.java.spring.boot2.SpringBootProperties_2_6

Definition

Recipe List
Yaml Recipe List
    • oldPropertyKey: management.server.servlet.context-path
    • newPropertyKey: management.server.base-path
    • oldPropertyKey: management.server.servlet.context-path
    • newPropertyKey: management.server.base-path
    • oldPropertyKey: spring.mvc.locale
    • newPropertyKey: spring.web.locale
    • oldPropertyKey: spring.mvc.locale
    • newPropertyKey: spring.web.locale
    • oldPropertyKey: spring.mvc.locale-resolver
    • newPropertyKey: spring.web.locale-resolver
    • oldPropertyKey: spring.mvc.locale-resolver
    • newPropertyKey: spring.web.locale-resolver
    • oldPropertyKey: spring.resources.add-mappings
    • newPropertyKey: spring.web.resources.add-mappings
    • 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-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.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.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.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-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-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.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.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.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-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.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.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.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.cache
    • newPropertyKey: spring.web.resources.chain.cache
    • oldPropertyKey: spring.resources.chain.compressed
    • newPropertyKey: spring.web.resources.chain.compressed
    • 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.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.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.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.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.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.chain.strategy.fixed.version
    • newPropertyKey: spring.web.resources.chain.strategy.fixed.version
    • oldPropertyKey: spring.resources.static-locations
    • newPropertyKey: spring.web.resources.static-locations
    • oldPropertyKey: spring.resources.static-locations
    • newPropertyKey: spring.web.resources.static-locations
---
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.properties.ChangePropertyKey:
oldPropertyKey: management.server.servlet.context-path
newPropertyKey: management.server.base-path
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: management.server.servlet.context-path
newPropertyKey: management.server.base-path
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.mvc.locale
newPropertyKey: spring.web.locale
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.mvc.locale
newPropertyKey: spring.web.locale
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.mvc.locale-resolver
newPropertyKey: spring.web.locale-resolver
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.mvc.locale-resolver
newPropertyKey: spring.web.locale-resolver
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.add-mappings
newPropertyKey: spring.web.resources.add-mappings
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.add-mappings
newPropertyKey: spring.web.resources.add-mappings
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.cache-private
newPropertyKey: spring.web.resources.cache.cachecontrol.cache-private
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.cache-private
newPropertyKey: spring.web.resources.cache.cachecontrol.cache-private
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.cache-public
newPropertyKey: spring.web.resources.cache.cachecontrol.cache-public
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.cache-public
newPropertyKey: spring.web.resources.cache.cachecontrol.cache-public
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.max-age
newPropertyKey: spring.web.resources.cache.cachecontrol.max-age
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.max-age
newPropertyKey: spring.web.resources.cache.cachecontrol.max-age
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.must-revalidate
newPropertyKey: spring.web.resources.cache.cachecontrol.must-revalidate
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.must-revalidate
newPropertyKey: spring.web.resources.cache.cachecontrol.must-revalidate
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.no-cache
newPropertyKey: spring.web.resources.cache.cachecontrol.no-cache
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.no-cache
newPropertyKey: spring.web.resources.cache.cachecontrol.no-cache
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.no-store
newPropertyKey: spring.web.resources.cache.cachecontrol.no-store
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.no-store
newPropertyKey: spring.web.resources.cache.cachecontrol.no-store
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.no-transform
newPropertyKey: spring.web.resources.cache.cachecontrol.no-transform
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.no-transform
newPropertyKey: spring.web.resources.cache.cachecontrol.no-transform
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.proxy-revalidate
newPropertyKey: spring.web.resources.cache.cachecontrol.proxy-revalidate
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.proxy-revalidate
newPropertyKey: spring.web.resources.cache.cachecontrol.proxy-revalidate
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.s-max-age
newPropertyKey: spring.web.resources.cache.cachecontrol.s-max-age
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.s-max-age
newPropertyKey: spring.web.resources.cache.cachecontrol.s-max-age
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.stale-if-error
newPropertyKey: spring.web.resources.cache.cachecontrol.stale-if-error
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.stale-if-error
newPropertyKey: spring.web.resources.cache.cachecontrol.stale-if-error
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.stale-while-revalidate
newPropertyKey: spring.web.resources.cache.cachecontrol.stale-while-revalidate
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.cachecontrol.stale-while-revalidate
newPropertyKey: spring.web.resources.cache.cachecontrol.stale-while-revalidate
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.period
newPropertyKey: spring.web.resources.cache.period
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.period
newPropertyKey: spring.web.resources.cache.period
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.use-last-modified
newPropertyKey: spring.web.resources.cache.use-last-modified
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.cache.use-last-modified
newPropertyKey: spring.web.resources.cache.use-last-modified
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.cache
newPropertyKey: spring.web.resources.chain.cache
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.cache
newPropertyKey: spring.web.resources.chain.cache
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.compressed
newPropertyKey: spring.web.resources.chain.compressed
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.compressed
newPropertyKey: spring.web.resources.chain.compressed
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.enabled
newPropertyKey: spring.web.resources.chain.enabled
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.enabled
newPropertyKey: spring.web.resources.chain.enabled
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.content.enabled
newPropertyKey: spring.web.resources.chain.strategy.content.enabled
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.content.enabled
newPropertyKey: spring.web.resources.chain.strategy.content.enabled
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.content.paths
newPropertyKey: spring.web.resources.chain.strategy.content.paths
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.content.paths
newPropertyKey: spring.web.resources.chain.strategy.content.paths
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.fixed.enabled
newPropertyKey: spring.web.resources.chain.strategy.fixed.enabled
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.fixed.enabled
newPropertyKey: spring.web.resources.chain.strategy.fixed.enabled
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.fixed.paths
newPropertyKey: spring.web.resources.chain.strategy.fixed.paths
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.fixed.paths
newPropertyKey: spring.web.resources.chain.strategy.fixed.paths
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.fixed.version
newPropertyKey: spring.web.resources.chain.strategy.fixed.version
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.chain.strategy.fixed.version
newPropertyKey: spring.web.resources.chain.strategy.fixed.version
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: spring.resources.static-locations
newPropertyKey: spring.web.resources.static-locations
- org.openrewrite.yaml.ChangePropertyKey:
oldPropertyKey: spring.resources.static-locations
newPropertyKey: spring.web.resources.static-locations
Export as PDF
Copy link