Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring-boot-22 and -23 recipes are overwriting version placeholder with version #474

Open
FieteO opened this issue Jan 10, 2024 · 0 comments · May be fixed by openrewrite/rewrite#4579
Open
Labels
bug Something isn't working

Comments

@FieteO
Copy link
Contributor

FieteO commented Jan 10, 2024

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.

@FieteO FieteO added the bug Something isn't working label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

1 participant