Skip to content

Avoid null-pointer failure before EAR execution context setup - #563

Open
efegokdemir wants to merge 1 commit into
apache:masterfrom
efegokdemir:codex/issue-514-context-guard
Open

efegokdemir wants to merge 1 commit into
apache:masterfrom
efegokdemir:codex/issue-514-context-guard

Conversation

@efegokdemir

Copy link
Copy Markdown

Summary

Configured EAR modules can attempt artifact resolution before their execution context is initialized. That currently produces an opaque NullPointerException when the module accesses the artifact repository.

This adds an explicit MojoFailureException with the module identity and a regression test for the uninitialized-context path.

Fixes #514

Testing

  • mvn -DskipITs -Dspotless.check.skip=true -Dspotless.apply.skip=true test — passed (49 tests).
  • The focused regression failed on the unchanged implementation with the reported NullPointerException and passed with this change.
  • git diff --check — passed.
  • The repository's Spotless check was attempted but is blocked locally by a Palantir formatter/Java incompatibility (NoSuchFieldError in com.sun.tools.javac.tree).

Notes

This contribution was developed with AI assistance. I reviewed the complete diff and verified the failure before and after the fix. No competing open PR for #514 was found.

Report an actionable Maven failure when a configured EAR module attempts artifact resolution before its execution context is initialized.

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullPointerException in AbstractEarModule.resolveArtifact() if earExecutionContext not set

1 participant