Skip to content

Skip dependencies without a resolved artifact file when setting properties (#372) - #377

Open
elharo wants to merge 1 commit into
masterfrom
fix-372-copyproperties-npe
Open

Skip dependencies without a resolved artifact file when setting properties (#372)#377
elharo wants to merge 1 commit into
masterfrom
fix-372-copyproperties-npe

Conversation

@elharo

@elharo elharo commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes

#372

Summary

AntRunMojo.copyProperties called artifact.getFile().getPath() without a null check, throwing an NPE when a project dependency has no resolved artifact file (e.g. a dependency that failed to resolve or a project-level dependency in a reactor build). Such dependencies are now skipped with a warning instead of failing the build, matching the expected behavior described in the issue (and mirroring the existing null handling in getPathFromArtifacts).

Changes

  • AntRunMojo.java: null-check the artifact file in copyProperties; if missing, log a warning and skip that property.
  • New unit test AntRunMojoCopyPropertiesTest reproducing the NPE (fails on master, passes with the fix).

Verification

  • New test fails on unpatched master with the reported NPE (NullPointerException: Cannot invoke "java.io.File.getPath()"), passes with the fix.
  • mvn verify (rat, checkstyle, spotless, unit tests, javadoc) passes.
  • mvn verify -Prun-its passes: all 29 integration tests succeed.

@elharo
elharo requested a review from Bukama August 5, 2026 18:39
@elharo elharo added the bug Something isn't working label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant