Description
In AbstractEarModule.java:158, a NullPointerException occurs if resolveArtifact() is called before setEarExecutionContext():
final ArtifactRepository ar = earExecutionContext.getArtifactRepository();
Modules are created via a factory and then the execution context is set afterward. If resolveArtifact() is called before setEarExecutionContext() has been invoked, earExecutionContext is null and .getArtifactRepository() throws an NPE.
Expected behavior
Add a null guard:
if (earExecutionContext == null) {
throw new MojoExecutionException("EarExecutionContext not initialized for module " + this);
}
Description
In
AbstractEarModule.java:158, a NullPointerException occurs ifresolveArtifact()is called beforesetEarExecutionContext():Modules are created via a factory and then the execution context is set afterward. If
resolveArtifact()is called beforesetEarExecutionContext()has been invoked,earExecutionContextis null and.getArtifactRepository()throws an NPE.Expected behavior
Add a null guard: