Skip to content

Commit

Permalink
Give explicit property definitions higher precedence than Maven's imp…
Browse files Browse the repository at this point in the history
…licit ones. (openrewrite#4334)

* Exclude Maven built-in property from circular placeholder reference check.

* Revert "Exclude Maven built-in property from circular placeholder reference check."

This reverts commit 86ae0f1.

* Give explicit property definitions higher precedence than Maven's implicit ones.

* Reformat test

---------

Co-authored-by: hoanamzn <hoanamzn@amazon.com>
Co-authored-by: Tim te Beek <tim@moderne.io>
  • Loading branch information
3 people authored Jul 17, 2024
1 parent ad91222 commit a34eacc
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ public String getPackaging() {
if (property == null) {
return null;
}
String propVal = properties.get(property);
if (propVal != null) {
return propVal;
}
switch (property) {
case "groupId":
case "project.groupId":
Expand All @@ -299,7 +303,7 @@ public String getPackaging() {
return requested.getParent() != null ? requested.getParent().getVersion() : null;
}

return System.getProperty(property, properties.get(property));
return System.getProperty(property);
}

public @Nullable String getManagedVersion(@Nullable String groupId, String artifactId, @Nullable String type, @Nullable String classifier) {
Expand Down
Loading

0 comments on commit a34eacc

Please sign in to comment.