elharo opened a new issue, #514:
URL: https://github.com/apache/maven-ear-plugin/issues/514
## Description
In `AbstractEarModule.java:158`, a NullPointerException occurs if
`resolveArtifact()` is called before `setEarExecutionContext()`:
```java
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:
```java
if (earExecutionContext == null) {
throw new MojoExecutionException("EarExecutionContext not initialized
for module " + this);
}
```
--
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]