You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/08/02 11:35:07 UTC
[PR] Skip malformed supplemental model entries instead of failing with NPE (#266) [maven-remote-resources-plugin]
elharo opened a new pull request, #279:
URL: https://github.com/apache/maven-remote-resources-plugin/pull/279
Closes #266
## Test-first
Added `RemoteResourcesMojoTest.testMalformedSupplementalModelDoesNotBreakBuild()`, which configures a `supplemental-models.xml` containing a well-formed `<project>` element that the strict `MavenXpp3Reader` rejects (an unrecognized element), triggering `getSupplement()` to return `null`.
Before the fix this test fails with:
```
java.lang.NullPointerException: Cannot invoke "org.apache.maven.model.Model.getGroupId()" because "m" is null
```
## Fix
In `loadSupplements()`, skip entries for which `getSupplement()` returns `null` (logging a warning), matching the lenient warn-and-continue intent of `getSupplement()`'s existing exception handling, instead of dereferencing the null model.
## Verification
- New test fails before the fix (NPE), passes after.
- Full suite: `mvn verify` passes (11 unit tests, RAT).
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fail with MojoExecutionException on malformed supplemental model (#266) [maven-remote-resources-plugin]
Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz merged PR #279:
URL: https://github.com/apache/maven-remote-resources-plugin/pull/279
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org