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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
