Skip to content

RemoveRedundantDependencyVersions should not remove dependencies in dependencyManagement if it's passed in except parameter #5879

@dcsekar

Description

@dcsekar

What problem are you trying to solve?

Currently RemoveRedundantDependencyVersions recipe removes dependencies in dependencyManagement, though those GAVs are passed in the except parameter. We have a requirement wherein we want to avoid the removal of dependencies either directly or under dependencyManagement for some list of GAVs to allow lower versions. Though we pass the list of GAVs in except parameter in RemoveRedundantDependencyVersions, to avoid removal of those GAVs (though it has lower version), it removes all GAVs having lower versions.

Describe the solution you'd like

The list of GAVs passed In the except parameter should be applied to the dependencyManagement for the exclusion and it should not be removed even if it has the lower versions.

Have you considered any alternatives or workarounds?

Tried passing GAVs through the first two parameters of groupPattern and artifactPattern, but it didn't work.

Additional context

Here is the slack discussion around GAVs getting removed in dependencyManagement.

Are you interested in contributing this feature to OpenRewrite?

Based on the discussion further in this enhancement we might consider that.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions