elharo opened a new pull request, #378:
URL: https://github.com/apache/maven-antrun-plugin/pull/378

   ## Fixes
   https://github.com/apache/maven-antrun-plugin/issues/371
   
   ## Summary
   `DependencyFilesetsTask` ignored the `mavenProjectId` attribute: the 
existence check used the configurable field, but the project lookup used a 
hardcoded `"maven.project"` reference. Setting `mavenProjectId` to anything 
other than the default was silently ignored, and invoking the task standalone 
(without the `maven.project` reference registered by `AntRunMojo`) threw an NPE.
   
   ## Changes
   - `DependencyFilesetsTask.java`: look up the `MavenProject` via the 
configured `mavenProjectId` reference instead of the hardcoded 
`"maven.project"` string.
   - New unit test `DependencyFilesetsTaskTest` with two cases:
     - `honorsConfiguredMavenProjectId` — when both the default and a custom 
project reference exist, the custom one is used.
     - `worksWithoutDefaultMavenProjectReference` — the task works standalone 
with a custom `mavenProjectId`, instead of throwing an NPE.
   
   ## Verification
   - Both tests fail on unpatched master (NPE on the hardcoded reference; 
custom attribute ignored) and pass with the fix.
   - `mvn verify` (rat, checkstyle, spotless, unit tests, javadoc) passes.
   - `mvn verify -Prun-its` passes: all 29 integration tests succeed.


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