rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

org.openrewrite.maven.AddProperty addToRootPom flag

Open jpraet opened this issue 1 year ago • 1 comments

What problem are you trying to solve?

I want to add a maven property to the root pom only. org.openrewrite.maven.AddProperty adds the property to all poms.

Describe the solution you'd like

addToRootPom flag, like for org.openrewrite.maven.AddManagedDependency.

Have you considered any alternatives or workarounds?

trustParent=true doesn't work for my use case.

jpraet avatar Jan 08 '24 11:01 jpraet

Thanks for the suggestion @jpraet ! I guess the best way forward here is to use preconditions, with a recipe that detects whether or not it's applied to the root pom. That way we don't have to add options to various Maven recipes, but can reuse that precondition across recipes instead.

timtebeek avatar Jan 15 '24 10:01 timtebeek

That feels like a reasonable improvement to make, I will look into it

sambsnyd avatar Apr 02 '24 16:04 sambsnyd