-
Notifications
You must be signed in to change notification settings - Fork 427
RemoveRedundantDependencyVersions recipe removes direct dependencies if dependency is pulled in transitively #5409
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
RemoveRedundantDependencyVersions recipe removes direct dependencies if dependency is pulled in transitively #5409
Conversation
…if dependency is pulled in transitively
rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java
Outdated
Show resolved
Hide resolved
rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java
Show resolved
Hide resolved
rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java
Outdated
Show resolved
Hide resolved
rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java
Outdated
Show resolved
Hide resolved
rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: should we also consider moving from Groovy visitors to the more general Java visitors in order to bring Kotlin DSL support to this recipe? There doesn't appear to be any specific functionality used, so it should be a pretty straight forward class swap.
rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveRedundantDependencyVersions.java
Outdated
Show resolved
Hide resolved
The Maven version of this recipe has controls to allow the user to specify when to remove. If we have the same options on the gradle recipe we can group them together into a single remove-redundants in rewrite-java-dependencies |
rewrite-gradle/src/test/java/org/openrewrite/gradle/RemoveRedundantDependencyVersionsTest.java
Outdated
Show resolved
Hide resolved
…if dependency is pulled in transitively (#5409) * RemoveRedundantDependencyVersions recipe removes direct dependencies if dependency is pulled in transitively * Polish * Can handle several boms * Added sorting to find highest dependency managed version * cleanup * extracted method out of loop * improved name, removed unused option * Added support for kotlin, added support for all dependency management methods. * renamed method * reverted temporary assignment for debug purposes --------- Co-authored-by: Johan Kragt <[email protected]>
What's changed?
Redundant direct dependencies are removed as well.
Anything in particular you'd like reviewers to focus on?
Interestingly, the recipe did remove direct dependencies with a lower version number already. This was actually a side effect by removing redundant constraints. I just added an extra check to see if the version
Checklist