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

Enhance RemoveProperty recipes to only remove properties not referenced on pom #517

Closed
jonesbusy opened this issue Dec 28, 2024 · 0 comments · Fixed by #567
Closed

Enhance RemoveProperty recipes to only remove properties not referenced on pom #517

jonesbusy opened this issue Dec 28, 2024 · 0 comments · Fixed by #567
Assignees

Comments

@jonesbusy
Copy link
Collaborator

What feature do you want to see added?

https://github.com/openrewrite/rewrite/blob/main/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveProperty.java doesn't check if the property is referenced anywhere on the pom

Those could lead to broken pom

Improve this recipe or create our own (we can reuse the visitors for example)

For example https://github.com/openrewrite/rewrite/blob/main/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindProperties.java#L67 could be used to mark property used in the pom (see) https://github.com/openrewrite/rewrite/blob/main/rewrite-maven/src/test/java/org/openrewrite/maven/search/FindPropertiesTest.java#L28

Then we can remove all properties not used in the pom

This would not cover multi-module plugin

Upstream changes

No response

Are you interested in contributing this feature?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant