question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use GPG private key within GitHub Actions and Setup Java SDK

See original GitHub issue

Associated community ticket: https://github.community/t/use-gpg-private-key-within-github-actions-and-setup-java-sdk/127133

The customer is trying to publish his Java package to the Maven Central Repository and GitHub Packages in a GitHub Actions workflow. He is authenticating with the GPG key to publish the package. He refers to the examples mentioned in “Publishing Java packages with Maven” and the README of the setup-java action to setup the workflow. But he gets the following errors:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-artifacts) on project ***: Unable to decrypt gpg passphrase: org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException: java.io.FileNotFoundException: /home/runner/.m2/settings-security.xml (No such file or directory) -> [Help 1]

OR

gpg: signing failed: Inappropriate ioctl for device

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bissimcommented, Aug 14, 2020

As per @AirQuick answer in #43, the problem is to configure Maven GPG plugin by inserting this snippet:

            <configuration>
              <!-- Prevent gpg from using pinentry programs -->
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>

Again, thank you @BrightRan for your concern, this issue can be closed.

On a side note: @konradpabjan @jaredpetersen please properly document this mandatory configuration.

1reaction
dmitry-shibanovcommented, Feb 15, 2021

Hello, everyone. I’m closing this issue, because documentation was updated in terms of this pull request. If you have any concerns feel free to reopen the issue. Thanks @bissim @royi-frontegg for help with resolving the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use GPG key in github actions? - gnupg - Stack Overflow
Open a terminal window. If you don't know your key ID, search it by e-mail: gpg --list-secret-keys user@example.
Read more >
Deploying to Maven Central using GitHub Actions
The private GPG key stored in the MAVEN_GPG_PRIVATE_KEY secret will also be imported in a GPG keychain, allowing maven-gpg-plugin to sign your ...
Read more >
Using GitHub Actions to Automatically Publish Gradle Build ...
This signing plugin is documented in the Gradle docs. The publish-java project pulls the signing key and password from gradle.properties on your laptop....
Read more >
Automate Releases to Maven Central via GitHub Actions
That public key also needs to be published to a well known GPG key ... Set up JDK 1.8 uses: actions/setup-java@v1 with: java-version:...
Read more >
GPG key in order to publish - Help/Discuss - Gradle Forums
In order to achieve that I have generated a gpg key, ... name: Set up JDK 8 uses: actions/setup-java@v2 with: java-version: '8' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found