What version of OpenRewrite are you using?
I am using
- rewrite-migrate-java: 3.10.0-SNAPSHOT
How are you running OpenRewrite?
I was able to recreate this issue on a smaller scale using the test in AddCommonAnnotationsDependenciesTest
What is the smallest, simplest way to reproduce the problem?
In the AddCommonAnnotationsDependenciesTest, add the following into the pom.xml before. This seems to work with any scope that is not compile.
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<scope>provided</scope>
<version>1.3.2</version>
</dependency>
</dependencies>
What did you expect to see?
Expected just the original dependency to get upgraded to Jakarta.
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<scope>provided</scope>
<version>1.3.5</version>
</dependency>
What did you see instead?
The original dependency with the non-compile scope is upgraded, and also a new duplicate dependency is added without the scope.
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<scope>provided</scope>
<version>1.3.5</version>
</dependency>
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I was able to recreate this issue on a smaller scale using the test in
AddCommonAnnotationsDependenciesTestWhat is the smallest, simplest way to reproduce the problem?
In the
AddCommonAnnotationsDependenciesTest, add the following into the pom.xmlbefore. This seems to work with any scope that is notcompile.What did you expect to see?
Expected just the original dependency to get upgraded to Jakarta.
What did you see instead?
The original dependency with the non-
compilescope is upgraded, and also a new duplicate dependency is added without the scope.Are you interested in contributing a fix to OpenRewrite?