Gpg default secret key error using maven

I am trying to publish my maven project in the Central repository and I need to sign my artifacts. I downloaded and installed gpg and created my keychain. When I run "maven clean deploy" in Eclipse, I get the following error:

gpg: no default secret key: No secret key gpg: signing failed: No secret key 

I searched on the internet and I'm not sure what to do. The only gpg link in my pom.xml file is

  <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>1.5</version> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin> 

Thanks!

+8
eclipse maven gnupg
source share
2 answers

These questions have been asked for a long time, and I can’t remember exactly what I did to fix it. I remember that I had a spelling error in my settings.xml file. This is what I changed in my file:

 <profile> <id>sign</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.passphrase>password</gpg.passphrase> </properties> </profile> 

Now it works.

+1
source share

You cannot sign artifacts because you do not have a GPG key. The solution is to create one .

0
source share

All Articles