Description
In AbstractEarMojo.java:317, isArtifactRegistered() can throw a NullPointerException:
return currentList.stream().anyMatch(em -> em.getArtifact().equals(a));
EarModule.getArtifact() is documented as returning null until the artifact is resolved. If a module in currentList has not been resolved, .getArtifact() returns null and null.equals(a) throws an NPE.
Expected behavior
Add a null guard:
return currentList.stream().anyMatch(em -> em.getArtifact() != null && em.getArtifact().equals(a));
Description
In
AbstractEarMojo.java:317,isArtifactRegistered()can throw a NullPointerException:EarModule.getArtifact()is documented as returningnulluntil the artifact is resolved. If a module incurrentListhas not been resolved,.getArtifact()returns null andnull.equals(a)throws an NPE.Expected behavior
Add a null guard: