openrewrite / openrewrite/rewrite-spring
spring-boot-22 and -23 recipes are overwriting version placeholder with version
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 403
- Forks
- 149
- Avg merge
- 2h 33m
- Merged PRs (30d)
- 10
Description
What version of OpenRewrite are you using?
I am using
- Maven/Gradle plugin v5.18.0
- rewrite-spring v5.1.7
How are you running OpenRewrite?
I am using the Maven command line invokation
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_3
What is the smallest, simplest way to reproduce the problem?
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<properties>
<spring.boot.version>2.2.13.RELEASE</spring.boot.version>
<spring.jms.version>5.2.25.RELEASE</spring.jms.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.jms.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
What did you expect to see?
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<properties>
<spring.boot.version>2.3.12.RELEASE</spring.boot.version>
<spring.jms.version>5.2.25.RELEASE</spring.jms.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.jms.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
What did you see instead?
The placeholder ${spring.jms.version} is replaced with the hard coded version. Note that this is not happening for other placeholders like ${spring.boot.version} in the file.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<properties>
<spring.boot.version>2.2.13.RELEASE</spring.boot.version>
<spring.jms.version>5.2.25.RELEASE</spring.jms.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>5.2.25.RELEASE</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
What is the full stack trace of any errors you encountered?
No errors.
Are you interested in contributing a fix to OpenRewrite?
I currently lack the time to do so unfortunately.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Maven command and the org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_3 recipe, using the supplied pom.xml as the reproduction. Compare the expected and actual handling of ${spring.jms.version}; done means the placeholder remains while spring.boot.version upgrades to 2.3.12.RELEASE.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100