-
Notifications
You must be signed in to change notification settings - Fork 366
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
Give explicit property definitions higher precedence than Maven's implicit ones. #4334
Give explicit property definitions higher precedence than Maven's implicit ones. #4334
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- rewrite-core/src/test/java/org/openrewrite/RecipeListTest.java
- lines 35-35
- lines 66-69
- rewrite-maven/src/test/java/org/openrewrite/maven/trait/MavenPluginTest.java
- lines 26-26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick work here! I'd expected a unit test using RewriteTest that shows we can now handle a parent and child that use such properties, perhaps very similar to what you already have in your zip file. I can explore that if you don't get to it for a more thorough review later.
@@ -15,6 +15,7 @@ | |||
*/ | |||
package org.openrewrite.internal; | |||
|
|||
import org.openrewrite.internal.lang.NonNull; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import org.openrewrite.internal.lang.NonNull; |
@@ -160,4 +170,13 @@ private static boolean substringMatch(CharSequence str, int index, CharSequence | |||
} | |||
return true; | |||
} | |||
|
|||
private static boolean isMavenBuiltInProperty(@NonNull final String originalPlaceholder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've already annotated the package; that means we likely don't have to repeat ourselves here.
rewrite/rewrite-core/src/main/java/org/openrewrite/internal/package-info.java
Lines 16 to 19 in 86ae0f1
@NonNullApi | |
package org.openrewrite.internal; | |
import org.openrewrite.internal.lang.NonNullApi; |
private static boolean isMavenBuiltInProperty(@NonNull final String originalPlaceholder) { | |
private static boolean isMavenBuiltInProperty(final String originalPlaceholder) { |
That does not sound a like unit test for the changed method. If I wanted to add a unit test, which test class would I add it to? |
I'd say rewrite/rewrite-maven/src/test/java/org/openrewrite/maven/MavenParserTest.java Lines 3042 to 3109 in ad91222
|
…erence check." This reverts commit 86ae0f1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- rewrite-core/src/test/java/org/openrewrite/RecipeListTest.java
- lines 35-35
- lines 66-69
- rewrite-maven/src/test/java/org/openrewrite/maven/trait/MavenPluginTest.java
- lines 26-26
Thank for the suggestion! Working on adding a test there helped me find the correct strategy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see the added test & fix @nguyenhoan !
And I even got the review done in time on the train. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- rewrite-core/src/test/java/org/openrewrite/RecipeListTest.java
- lines 35-35
- lines 66-69
- rewrite-maven/src/test/java/org/openrewrite/maven/trait/MavenPluginTest.java
- lines 26-26
Awesome! Thank you! |
What's changed?
Exclude Maven built-in property from circular placeholder reference check
What's your motivation?
Error
Circular placeholder reference 'XYZ' in property definitions
is thrown when a built-in property, such asproject.version
, is redefined in the root POM and used in a child in multi-module projects.I would not expect running recipes to fail given that
mvn clean verify
succeeds.Attached is a minimum project to reproduce the issue.
Circular-placeholder-reference.zip
You can run any recipe to trigger it. I ran the one for SpringBoot
Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
@timtebeek
Have you considered any alternatives or workarounds?
Any additional context
Checklist