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

UpdateProperty: change a properties value #4797

Open
svaningelgem opened this issue Dec 18, 2024 · 0 comments
Open

UpdateProperty: change a properties value #4797

svaningelgem opened this issue Dec 18, 2024 · 0 comments

Comments

@svaningelgem
Copy link
Contributor

svaningelgem commented Dec 18, 2024

What problem are you trying to solve?

I want to update a property <main.groupId>com.example.ws4</main.groupId> from ws4 to ws5. However, we have like 200 repositories (90% maven), and I don't know for certain what the property name is in each. But I know the value.

So I would like to search the properties based on the value, and if encountered: change it to the new value.

What precondition(s) should be checked before applying this recipe?

none that I can think of

Describe the situation before applying the recipe

<main.groupId>com.example.ws4</main.groupId>

Describe the situation after applying the recipe

<main.groupId>com.example.ws5</main.groupId>

Have you considered any alternatives or workarounds?

org.openrewrite.xml.ChangeTagValue can be used, but I feel it's not so clean. Especially because values in properties can still contain properties that needs to be interpreted.

Are you interested in contributing this recipe to OpenRewrite?

Maybe

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

No branches or pull requests

1 participant