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
The RemoveRedundantDependencyVersions recipes removes redundant version of dependencies. But when the version is a property, the property is not removed. Impact
Unused properties in your pom.xml or you override the property of a parent pom.
For example Spring Boot has Managed Dependency Coordinates in their parent pom spring-boot-dependencies.
What precondition(s) should be checked before applying this recipe?
Thanks for logging an issue @wesboe ! I'm doubting between whether this should be a standalone recipe or whether it should be part of RemoveRedundantDependencyVersions. Note that RemoveRedundantDependencyVersions could also call a separate recipe to clean up properties used in removed dependency version tags.
Either way the tricky part is knowing if a property really isn't used anymore. It could still be referenced elsewhere in the same pom.xml, or in a parent or child pom.xml file. Any thoughts as to how you had wanted to cover such cases? Perhaps at first only removing property versions that are also present in a parent to minimize disruption?
timtebeek
changed the title
Properties not removed after running recipe RemoveRedundantDependencyVersions
Properties not removed after running recipe RemoveRedundantDependencyVersionsAug 22, 2024
What problem are you trying to solve?
The RemoveRedundantDependencyVersions recipes removes redundant version of dependencies. But when the version is a property, the property is not removed.
Impact
Unused properties in your pom.xml or you override the property of a parent pom.
For example Spring Boot has Managed Dependency Coordinates in their parent pom spring-boot-dependencies.
What precondition(s) should be checked before applying this recipe?
We can limit the execution to Maven.
Describe the situation before applying the recipe
Describe the situation after applying the recipe
Have you considered any alternatives or workarounds?
For the properties managed by Spring Boot you can use the recipe to remove a property tag and add all properties managed by Spring Boot.
Any additional context
Are you interested in contributing this recipe to OpenRewrite?
Yes I would like to contribute
The text was updated successfully, but these errors were encountered: