RemoveRedundantDependencyVersions recipe removes unused properties#5645
Conversation
… the recipe removes a version with said properties
|
Don't merge until @jkschneider has time to review. No high priority either to get this merged! |
| <properties> | ||
| <spring-web.version>5.3.9</spring-web.version> | ||
| </properties> |
There was a problem hiding this comment.
I have some concerns about removing properties like this; in a multi module project we could remove a property from a parent that's still used in a child project, since doAfterVisit can only look at a single source file.
There was a problem hiding this comment.
Yep, you are right about this. Added a test to reflect this problem: 6aa0e64.
There was a problem hiding this comment.
…ndencies-remove-unused-properties-as-well # Conflicts: # rewrite-maven/src/test/java/org/openrewrite/maven/RemoveRedundantDependencyVersionsTest.java
…antDependencyVersions.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…aceholderHelper.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…properties-as-well
…properties-as-well
|
This PR is stale because it has been open for 90 days with no activity. Remove |
jkschneider
left a comment
There was a problem hiding this comment.
LGTM. This properly cleans up orphaned properties when removing redundant dependency versions, addressing the customer concern in #1291.
Good handling of:
- Multiple properties in a single version string
- Shared properties across dependencies
- Excluding pom packaging to avoid breaking child projects
What's changed?
RemoveRedundantDependencyVersions recipe removes unused properties if the recipe removes a version with said properties.
What's your motivation?
After the recipe in its current state has run, it's possible there are now properties in the properties block that are no longer used.
Checklist