Maven-gpg-plugin and --pinentry-mode loopback to sign artifacts of the build

I’m trying to get my maven build to sign the artifacts it produces. I have the ‘maven-gpg-plugin’ working fine locally, but on travis-ci, it appears the gpg-agent does not support using “–pinentry-mode loopback” option. Here’s the CI build error:

[INFO] --- maven-gpg-plugin:1.6:sign (sign-artifacts) @ nexus-format-archetype ---
gpg: setting pinentry mode 'loopback' failed: Not supported
gpg: signing failed: Inappropriate ioctl for device
gpg: signing failed: Inappropriate ioctl for device

The ‘maven-gpg-plugin’ is configured to send the key passphrase like so:


FWIW, I made sure the various gpg keys are imported from env vars and successfully loaded into the travis gpg db.

I stumbled about trying to reconfigure the gpg-agent to support --pinentry, but failed. Any idea how I can get this working on Travis? Thanks!

I have exactly the same issue, did you manage to solve this somehow?

Best regards,

Without seeing the build, can’t say anything for sure.

According to and, you need to either upgrade to Bionic or add allow-loopback-pinentry into gpg-agent.conf.


I am also facing the same issue. Did you find a solution?



I have finally found a solution using gpg2 and the latest ubuntu distribution (dist: bionic):

1 Like