You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RemoveRedundantDependencyVersions It does not appear to support identifying when a property is declared to drive the dependency version. I dont know if this is a specific spring boot thing or a common use case. Can this support be added? https://docs.spring.io/spring-boot/appendix/dependency-versions/properties.html (edit
What version of OpenRewrite are you using?
I am using
OpenRewrite Bom 3.3.0
OpenRewrite v8.47.1
rewrite-maven v8.47.1
How are you running OpenRewrite?
I am using the Maven project to write a recipie, and my project is a single module project.
publicclassMyRecipeChainextendsRecipe {
@OverridepublicStringgetDisplayName() {
return"My Recipe Chain";
}
@OverridepublicStringgetDescription() {
return"A chain of recipes to perform multiple transformations.";
}
@OverridepublicList<Recipe> getRecipeList() {
StringgroupPattern=null;
StringartifactPattern=null;
RemoveRedundantDependencyVersions.ComparatoronlyIfManagedVersionIs=RemoveRedundantDependencyVersions.Comparator.GTE;
List<String> except=null;
returnArrays.asList(
//new ChangeManagedDependencyGroupIdAndArtifactId("org.yaml","snakeyaml","org.yaml","snakeyaml","2.3.0")neworg.openrewrite.maven.RemoveRedundantDependencyVersions(groupPattern,artifactPattern,onlyIfManagedVersionIs,except)
//removes stuff it shouldnt and leaves stuff it shouldnt//,new org.openrewrite.maven.RemoveUnusedProperties(null)//new ChangeTypeRecipe("old.TypeB", "new.TypeB")// Add more recipes as needed
);
}
}
What is the smallest, simplest way to reproduce the problem?
I picked latest spring parent starter 3.4.3 and purposely picked older dependencies it manages
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.3</version> <!-- lookup parent from repository -->
</parent>
<groupId>com.service</groupId>
<artifactId>service</artifactId>
<version>1.0-SNAPSHOT</version>
<name>service</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>20</java.version>
<my-unused-prop>UNUSED</my-unused-prop>
<netty.version>4.1.115.Final</netty.version><!-- should get bumped to 4.1.118.Final -->
<snake.version>2.0</snake.version><!-- should get removed-->
<spring-hateoas.version>2.3.0</spring-hateoas.version><!-- should bump to 2.4.1-->
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snake.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
</dependencies>
</project>
RemoveRedundantDependencyVersions It does not appear to support identifying when a property is declared to drive the dependency version. I dont know if this is a specific spring boot thing or a common use case. Can this support be added?
https://docs.spring.io/spring-boot/appendix/dependency-versions/properties.html (edit
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Maven project to write a recipie, and my project is a single module project.
What is the smallest, simplest way to reproduce the problem?
I picked latest spring parent starter 3.4.3 and purposely picked older dependencies it manages
What did you expect to see?
What did you see instead?
What is the full stack trace of any errors you encountered?
My UnitTest
Are you interested in contributing a fix to OpenRewrite?
Yes if I could get past the learn curve. Documentation has not been helpful in writing my own recipes
The text was updated successfully, but these errors were encountered: