Skip to content

NullPointerException in AbstractEarMojo.isArtifactRegistered() when module artifact is null #519

Open

Description

@elharo

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));

Activity

  1. added
    bug
    on Jul 3, 2026
  2. AzazelSensei commented on Aug 24, 2026

    @AzazelSensei
    Contributor

    Opened #549 — skip modules whose artifact is still null so isArtifactRegistered does not NPE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions