Dave Wichers created MGPG-87:
--------------------------------

             Summary: NullPointerException when gpg setup in .m2/settings.xml 
not set up properly
                 Key: MGPG-87
                 URL: https://issues.apache.org/jira/browse/MGPG-87
             Project: Maven GPG Plugin
          Issue Type: Bug
            Reporter: Dave Wichers


When your profile for using gpg in your settings.xml file is either missing, or 
set up wrong, the following exception is thrown. I'm talking about this part of 
the settings.xml:

    <profile>
      <id>ossrh</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <gpg.keyname>YOURKEYNAME</gpg.keyname>
        <gpg.passphrase>YOURSECRET</gpg.passphrase>
      </properties>
    </profile>

When it was missing, or I added the above with an empty gpg.passphrase value, I 
got the following exception. Can you please update this to explain what the 
problem is and not throw an Exception? For example, no gpg.keyname/passphrase 
found in settings.xml, or no value of FOO found or whatever. To help explain 
what the actual problem is.

{*}Caused by{*}: java.lang.NullPointerException

    *at* org.apache.maven.plugins.gpg.GpgSigner.generateSignatureForFile 
({*}GpgSigner.java:73{*})

    *at* 
org.apache.maven.plugins.gpg.AbstractGpgSigner.generateSignatureForArtifact 
({*}AbstractGpgSigner.java:203{*})

    *at* org.apache.maven.plugins.gpg.GpgSignAttachedMojo.execute 
({*}GpgSignAttachedMojo.java:143{*})

    *at* org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
({*}DefaultBuildPluginManager.java:137{*})

    *at* org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 
({*}MojoExecutor.java:370{*})

    *at* org.apache.maven.lifecycle.internal.MojoExecutor.doExecute 
({*}MojoExecutor.java:351{*})

    *at* org.apache.maven.lifecycle.internal.MojoExecutor.execute 
({*}MojoExecutor.java:215{*})

    *at* org.apache.maven.lifecycle.internal.MojoExecutor.execute 
({*}MojoExecutor.java:171{*})

    *at* org.apache.maven.lifecycle.internal.MojoExecutor.execute 
({*}MojoExecutor.java:163{*})

    *at* 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
({*}LifecycleModuleBuilder.java:117{*})

    *at* 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
({*}LifecycleModuleBuilder.java:81{*})

    *at* 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
 ({*}SingleThreadedBuilder.java:56{*})

    *at* org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
({*}LifecycleStarter.java:128{*})

    *at* org.apache.maven.DefaultMaven.doExecute ({*}DefaultMaven.java:294{*})

    *at* org.apache.maven.DefaultMaven.doExecute ({*}DefaultMaven.java:192{*})

    *at* org.apache.maven.DefaultMaven.execute ({*}DefaultMaven.java:105{*})

    *at* org.apache.maven.cli.MavenCli.execute ({*}MavenCli.java:960{*})

...



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to