gnodet commented on code in PR #13086:
URL: https://github.com/apache/maven/pull/13086#discussion_r4018890325
##########
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. Added two tests:
1. `testParentGaMismatchDefaultRelativePathProducesWarning` — omitted
`<relativePath>`, default `../pom.xml` has wrong GA → exactly one WARNING, no
FATAL, build succeeds.
2. `testParentGaMismatchExplicitRelativePathProducesFatal` — explicit
`<relativePath>` pointing at wrong GA → FATAL, `ModelBuildingException` thrown.
Both tests pass (3/3).
--
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]