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


##########
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 GA mismatch check is 
now always performed; severity is downgraded to WARNING (instead of FATAL) when 
`<relativePath>` is omitted, matching the behaviour of the Maven 4 
`mismatchRelativePathAndGA()` method.



##########
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.



-- 
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