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


##########
compat/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java:
##########
@@ -984,7 +984,10 @@ private ModelData readParentLocally(
             buffer.append(parent.getArtifactId()).append(", please verify your 
project structure");
 
             problems.setSource(childModel);
-            problems.add(new ModelProblemCollectorRequest(Severity.WARNING, 
Version.BASE)
+            // When <relativePath> is omitted Maven defaults to ../pom.xml; 
downgrade to WARNING
+            // (not FATAL) in that case — same behaviour as the Maven 4 
DefaultModelBuilder.
+            Severity severity = (parent.getRelativePath() == null) ? 
Severity.WARNING : Severity.FATAL;

Review Comment:
   Fixed in f4fa8c0b74. Both test cases added to `DefaultModelBuilderTest`: 
`testParentGaMismatchDefaultRelativePathProducesWarning` (null relativePath → 
WARNING) and `testParentGaMismatchExplicitRelativePathProducesFatal` (explicit 
relativePath → FATAL). Both pass.



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