gnodet commented on code in PR #13086:
URL: https://github.com/apache/maven/pull/13086#discussion_r4018764533
##########
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:
Agreed. Rather than skipping the check, the fix should keep the GA mismatch
check but downgrade from FATAL to WARNING when `relativePath` is `null` (i.e.
the default `../pom.xml`). This matches exactly what
`impl/maven-impl/DefaultModelBuilder` does — see `mismatchRelativePathAndGA()`
at line 1441: `boolean warn = ... || childModel.getParent().getRelativePath()
== null;`. Details in the review body above.
--
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]