gnodet-bot commented on code in PR #13086:
URL: https://github.com/apache/maven/pull/13086#discussion_r4020417188
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java:
##########
@@ -1426,18 +1426,49 @@ private Model readParentLocally(
}
private void mismatchRelativePathAndGA(Model childModel, Parent
parent, String groupId, String artifactId) {
+ boolean defaultPath = childModel.getParent().getRelativePath() ==
null;
Review Comment:
🔴 **IT breakage: `MavenITmng8294ParentChecksTest.testitbadMismatch()` will
fail.**
The old message for an explicit `<relativePath>` mismatch was:
```
'parent.relativePath' points at G:A instead of G:A, please verify your
project structure
```
The new message is:
```
'parent.relativePath' points at '<path>' which resolves to G:A instead of
the declared parent G:A.
```
The existing IT at
`its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8294ParentChecksTest.java:45`
calls:
```java
verifier.verifyTextInLog(
"at org.apache.maven.its.mng8294:parent instead of
org.apache.maven.its.mng8294:bad-parent");
```
The old message contained that substring. The new message does not —
`"resolves to ... instead of the declared parent"` is not matched by `"at ...
instead of"`. The IT will throw a `VerificationException`.
Update the `verifyTextInLog` assertion in `MavenITmng8294ParentChecksTest`
to match the new message, for example:
```java
verifier.verifyTextInLog(
"which resolves to org.apache.maven.its.mng8294:parent instead of the
declared parent org.apache.maven.its.mng8294:bad-parent");
```
Minor nit on the same line: `childModel.getParent().getRelativePath()` is a
redundant dereference — the method parameter `parent` is already
`childModel.getParent()`. `parent.getRelativePath() == null` is cleaner and
avoids a second field access.
```suggestion
boolean defaultPath = parent.getRelativePath() == null;
```
--
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]