You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dave Wichers (Jira)" <ji...@apache.org> on 2022/06/24 00:30:00 UTC

[jira] [Updated] (MGPG-87) NullPointerException when gpg not installed

     [ https://issues.apache.org/jira/browse/MGPG-87?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Wichers updated MGPG-87:
-----------------------------
    Description: 
If you don't have gpg installed at all, you get the exception below when trying to use the mvn-gpg-plugin:

Can you please update this to explain what the problem is and not throw an Exception? For example, "gpg must be installed to use this plugin."

For other errors, error messages like: "no gpg.keyname/passphrase found in settings.xml", or no gpg key specified in settings.xml, 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{*})

...

  was:
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{*})

...

        Summary: NullPointerException when gpg not installed  (was: NullPointerException when gpg setup in .m2/settings.xml not set up properly)

> NullPointerException when gpg not installed
> -------------------------------------------
>
>                 Key: MGPG-87
>                 URL: https://issues.apache.org/jira/browse/MGPG-87
>             Project: Maven GPG Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0.1
>            Reporter: Dave Wichers
>            Priority: Major
>
> If you don't have gpg installed at all, you get the exception below when trying to use the mvn-gpg-plugin:
> Can you please update this to explain what the problem is and not throw an Exception? For example, "gpg must be installed to use this plugin."
> For other errors, error messages like: "no gpg.keyname/passphrase found in settings.xml", or no gpg key specified in settings.xml, 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)