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

fix: add java version property only to parent pom #612

Closed
wants to merge 1 commit into from

Conversation

dpozinen
Copy link
Contributor

What's changed?

Fix bug where java version property would be add to all submodules of a project instead of only to the root pom

Any additional context

I was having issues with org.openrewrite.java.migrate.UpgradeToJava21

Specifically, it adds the <java.version> property to each submodule, even if the parent module (in the same repo) already contains this property.
I believe this is because of this logic in UpdateMavenProjectPropertyJavaVersion which checks if relativePath has a value.

But the problem is that in most cases relativePath is omitted completely, because if not specified, it defaults to ../pom.xml .
Now I realise the use case of <relativePath/> so it was preserved.

@timtebeek timtebeek self-requested a review November 21, 2024 21:02
@sambsnyd
Copy link
Member

Merged this here: 02c1a54

Thanks for reporting!

@sambsnyd sambsnyd closed this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants