Links

Migrate Spring Boot properties to 2.7

org.openrewrite.java.spring.boot2.SpringBootProperties_2_7 Migrate applications to the latest Spring Boot 2.7 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.7

Tags

  • spring
  • boot

Source

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

Usage

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_7")
}
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_7</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_7

Definition

Recipe List
Yaml Recipe List
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_7
displayName: Migrate Spring Boot properties to 2.7
description: Migrate applications to the latest Spring Boot 2.7 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.7
tags:
- spring
- boot
recipeList:
- org.openrewrite.java.spring.boot2.SamlRelyingPartyPropertyApplicationPropertiesMove
- org.openrewrite.yaml.ChangeKey:
oldKeyPath: $.spring.security.saml2.relyingparty.registration.*[?(@.identityprovider)]
newKey: assertingparty
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.artemis.host
newPropertyKey: spring.artemis.broker-url
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.artemis.port
newPropertyKey: spring.artemis.broker-url
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.batch.initialize-schema
newPropertyKey: spring.batch.jdbc.initialize-schema
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.batch.schema
newPropertyKey: spring.batch.jdbc.schema
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.batch.table-prefix
newPropertyKey: spring.batch.jdbc.table-prefix
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.continue-on-error
newPropertyKey: spring.sql.init.continue-on-error
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.data
newPropertyKey: spring.sql.init.data-locations
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.data-password
newPropertyKey: spring.sql.init.password
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.data-username
newPropertyKey: spring.sql.init.username
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.initialization-mode
newPropertyKey: spring.sql.init.mode
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.platform
newPropertyKey: spring.sql.init.platform
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.schema
newPropertyKey: spring.sql.init.schema-locations
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.schema-password
newPropertyKey: spring.sql.init.password
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.schema-username
newPropertyKey: spring.sql.init.username
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.separator
newPropertyKey: spring.sql.init.separator
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.datasource.sql-script-encoding
newPropertyKey: spring.sql.init.encoding
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.flyway.check-location
newPropertyKey: spring.flyway.fail-on-missing-locations

See how this recipe works across multiple open-source repositories

Moderne Link Image
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.