Skip to content
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

Preserve multiple dependencyManagement with different types #4290

Conversation

askoog
Copy link
Contributor

@askoog askoog commented Jun 27, 2024

What's changed?

Find managedDependency() did not take type into account

What's your motivation?

It is a valid case to specify different dependencyManagement dependencies for the same artifact but with different types (used for example if you create a test-jar of a dependency and manage its version). Without this fix, the RemoveDuplicateDependencies recipe removed duplicate dependencyManagement dependencies with same artifact but different types

It is a valid case to specify different dependencyManagement dependencies for the same artifact but with different types (used for example if you create a test-jar of a dependency and manage its version).

Find managedDependency() did not take type into account
@timtebeek timtebeek self-requested a review June 27, 2024 12:21
@timtebeek timtebeek added the bug Something isn't working label Jun 27, 2024
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the immediate fix and added test! Seems like a clear omission & improvement.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions could not be made:

  • rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyConstraintToRule.java
    • lines 65-65
    • lines 83-82

@timtebeek timtebeek merged commit 652e454 into openrewrite:main Jun 27, 2024
2 checks passed
@askoog askoog deleted the remove-duplicate-dependencies-should-keep-different-types-in-management branch June 27, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants