Unable to Disable Signing or Set the keyPassphrase
voor opened this issue · 4 comments
Sample POM file of issue is here:
https://github.com/voor/rpm-signing-example
Inside my m2 settings file I have something like this:
<profile>
<id>gpg</id>
<properties>
<gpg.executable>gpg2</gpg.executable>
<gpg.keyname>${env.GPG_USER}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSWORD}</gpg.passphrase>
</properties>
</profile>
This results in the following stack-trace:
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm (rpm) on project rpm-signing-example: Unable to parse configuration of mojo org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm for parameter keyPassphrase: Cannot find default setter in class org.codehaus.mojo.rpm.Passphrase -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm (rpm) on project rpm-signing-example: Unable to parse configuration of mojo org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm for parameter keyPassphrase: Cannot find default setter in class org.codehaus.mojo.rpm.Passphrase
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginConfigurationException: Unable to parse configuration of mojo org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm for parameter keyPassphrase: Cannot find default setter in class org.codehaus.mojo.rpm.Passphrase
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:662)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:594)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Cannot find default setter in class org.codehaus.mojo.rpm.Passphrase
at org.eclipse.sisu.plexus.CompositeBeanHelper.setDefault(CompositeBeanHelper.java:95)
at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:61)
at org.eclipse.sisu.plexus.CompositeBeanHelper.convertProperty(CompositeBeanHelper.java:273)
at org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.java:210)
at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:101)
at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:34)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:632)
... 23 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException
So I'm able to successful have the signing work when I follow the documentation at "Configure GPG passphrase under settings.xml" on http://www.mojohaus.org/rpm-maven-plugin/usage.html (by the way there should be a link to that from http://www.mojohaus.org/rpm-maven-plugin/adv-params.html#Signatures to cut down on confusion) however, I'm still unsure of how to completely disable signing and do that on a later step.
Actually, even with the usage properly setting a gpg server id, I'm still having failures.
If I pass in a different global settings.xml
file that has never populated the gpg
variables I am able to build successfully, but I want an explicit option to essentially say "I realize those variables are populated, but please do not sign the RPM"
I had the same issue, needed to skip the GPG signing since it was going to be taken care of later anyways.
I was able to employ a workaround. The relevant part of the configuration is shown below.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.2.0</version>
<executions>
<execution>
<id>build-rpm-package</id>
<goals>
<goal>attached-rpm</goal>
</goals>
</execution>
</executions>
<configuration>
<keyPassphrase/> <!-- null disables gpg signing -->
<passphraseServerId/> <!-- null disables gpg signing -->
<keyname/> <!-- null disables gpg signing -->
</configuration>
<plugin>