Uploaded image for project: 'Maven GPG Plugin'
  1. Maven GPG Plugin
  2. MGPG-18

NPE in GpgSigner

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-alpha-4
    • 1.0
    • None

    Description

      If I run "mvn package gpg:sign", this works. If I run "mvn gpg:sign", I get the following stack trace:

      java.lang.NullPointerException
      	at org.apache.maven.plugin.gpg.GpgSigner.generateSignatureForArtifact(GpgSigner.java:119)
      	at org.apache.maven.plugin.gpg.GpgSignAttachedMojo.execute(GpgSignAttachedMojo.java:228)
      	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
      

      After running this through a debugger, I can see that this is because the 'file' object (project.getArtifact().getFile()) is null, which seems to be the case any time the artifact wasn't generated in this invocation of Maven. At the very least, this should result in a good error message, although it would be nice if "gpg:sign" would work on an artifact that was previously-generated.

      Attachments

        Activity

          People

            bentmann Benjamin Bentmann
            diathesis Geoffrey Wiseman
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: