Comment on page
Upgrade spring-framework Maven dependencies
org.openrewrite.java.spring.framework.UpgradeSpringFrameworkDependencies
Upgrade spring-framework 5.x Maven dependencies using a Node Semver advanced range selector.
- 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.
Type | Name | Description |
---|---|---|
String | newVersion | An exact version number, or node-style semver selector used to select the version number. |
This recipe has required configuration parameters. Recipes with required configuration parameters cannot be activated directly. To activate this recipe you must create a new recipe which fills in the required parameters. In your
rewrite.yml
create a new recipe with a unique name. For example: com.yourorg.UpgradeSpringFrameworkDependenciesExample
. Here's how you can define and customize such a recipe within your rewrite.yml:rewrite.yml
---
type: specs.openrewrite.org/v1beta/recipe
name: com.yourorg.UpgradeSpringFrameworkDependenciesExample
displayName: Upgrade spring-framework Maven dependencies example
recipeList:
- org.openrewrite.java.spring.framework.UpgradeSpringFrameworkDependencies:
newVersion: 5.3.X
Now that
com.yourorg.UpgradeSpringFrameworkDependenciesExample
has been defined activate it and take a dependency on org.openrewrite.recipe:rewrite-spring:5.1.2 in your build file:Gradle
Maven
Moderne CLI
- 1.Add the following to your
build.gradle
file:
build.gradle
plugins {
id("org.openrewrite.rewrite") version("6.5.6")
}
rewrite {
activeRecipe("com.yourorg.UpgradeSpringFrameworkDependenciesExample")
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-spring:5.1.2")
}
- 2.Run
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>com.yourorg.UpgradeSpringFrameworkDependenciesExample</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.
You will need to have configured the Moderne CLI on your machine before you can run the following command.
shell
mod run . --recipe UpgradeSpringFrameworkDependencies
Recipe List
Yaml Recipe List
- groupId:
org.springframework
- artifactId:
spring-bom
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-aop
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-aspects
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-beans
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-context
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-context-indexer
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-context-support
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-core
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-expression
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-instrument
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-jcl
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-jdbc
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-jms
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-messaging
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-orm
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-oxm
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-test
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-tx
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-web
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-webflux
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-webmvc
- overrideManagedVersion:
false
- groupId:
org.springframework
- artifactId:
spring-websocket
- overrideManagedVersion:
false
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.spring.framework.UpgradeSpringFrameworkDependencies
displayName: Upgrade spring-framework Maven dependencies
description: Upgrade spring-framework 5.x Maven dependencies using a Node Semver advanced range selector.
recipeList:
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-bom
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-aop
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-aspects
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-beans
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-context
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-context-indexer
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-context-support
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-core
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-expression
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-instrument
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-jcl
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-jdbc
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-jms
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-messaging
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-orm
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-oxm
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-test
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-tx
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-web
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-webflux
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-webmvc
overrideManagedVersion: false
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.springframework
artifactId: spring-websocket
overrideManagedVersion: false
The community edition of the Moderne platform 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.