Q:

How to force maven-gpg-plugin to use primary gpg key instead of a sub key?

I have a GPG public key with a sub key. When I attempt to sign my Maven artifacts as part of the release process, the plugin is signing with the sub key instead of the main key.
Looking at the docs for the plugin here:
http://maven.apache.org/plugins/maven-gpg-plugin/sign-mojo.html
I do not see an obvious property to set to control which key is used. Is it possible to control this?

A:

After asking some questions on mailing lists, it appears I wasn't the only one with this issue.
In my case, I had created my key pairs using GPG Keychain Access UI on my Mac. Other users who had used the same tool to create their keys also reported the same issue with Maven.
For whatever reason, when you create a key pair using that UI it creates not only a top level key but also a sub key. This doesn't happen when you use the command line tools to create a new keypair.
So I went to the command line, revoked the subkey and everything started to work.
I am not sure if the underlying issue is with the way the GPG KeyChain Access UI creates keys, or if it is the way the maven plugin reads keys though.

