gnodet commented on code in PR #13086:
URL: https://github.com/apache/maven/pull/13086#discussion_r4018803993


##########
compat/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java:
##########
@@ -970,10 +970,11 @@ private ModelData readParentLocally(
             version = candidateModel.getParent().getVersion();
         }
 
-        if (groupId == null
-                || !groupId.equals(parent.getGroupId())
-                || artifactId == null
-                || !artifactId.equals(parent.getArtifactId())) {
+        if (parent.getRelativePath() != null
+                && (groupId == null
+                        || !groupId.equals(parent.getGroupId())
+                        || artifactId == null
+                        || !artifactId.equals(parent.getArtifactId()))) {
             StringBuilder buffer = new StringBuilder(256);

Review Comment:
   Fixed in 61d2203dbaeef81ee86b6a8131d63e20833d07eb. The guard 
`parent.getRelativePath() != null` has been removed — the GA check now always 
runs. When `relativePath` is null (default `../pom.xml`), the severity is 
downgraded to `WARNING` instead of `FATAL`, matching the Maven 4 
`DefaultModelBuilder` behavior.



##########
compat/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java:
##########
@@ -970,10 +970,11 @@ private ModelData readParentLocally(
             version = candidateModel.getParent().getVersion();
         }
 
-        if (groupId == null
-                || !groupId.equals(parent.getGroupId())
-                || artifactId == null
-                || !artifactId.equals(parent.getArtifactId())) {
+        if (parent.getRelativePath() != null
+                && (groupId == null
+                        || !groupId.equals(parent.getGroupId())
+                        || artifactId == null
+                        || !artifactId.equals(parent.getArtifactId()))) {
             StringBuilder buffer = new StringBuilder(256);

Review Comment:
   Fixed in 61d2203dbaeef81ee86b6a8131d63e20833d07eb. Applied exactly the 
pattern from Maven 4's `mismatchRelativePathAndGA()`: the check is always 
performed, and `Severity` is `WARNING` when `relativePath == null`, `FATAL` 
otherwise.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to