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.

passphraseServerId appears not to be set (or is different to the default)

See original GitHub issue

Description: When using the maven-gpg-plugin during publishing of an artifact the action fails with:

[INFO] gpg: Sorry, no terminal at all requested - can't get input
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------

I’ve seen issue #91 and the config snippet is included as listed there and in the project’s README. I had to manually set:

                    <passphraseServerId>gpg.passphrase</passphraseServerId>

Which as far as I understand should be the default.

Task version: v1

Platform:

  • [x ] Ubuntu
  • macOS
  • Windows

Runner type:

  • [ x] Hosted
  • Self-hosted

Repro steps:
Use the plugin like this:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <configuration>
                    <!-- Prevent gpg from using pinentry programs -->
                    <gpgArguments>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                    </gpgArguments>
                </configuration>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Notice <passphraseServerId>gpg.passphrase</passphraseServerId> is not included. In a subsequent step run:

      - name: Publish
        run: |
          git config --global user.email "github-action@hypi.io"
          git config --global user.name "Hypi Github Action"
          mvn -e -B -DscmCommentPrefix="[skip ci]" -DpushChanges=false release:prepare && \
          mvn -e -B -DscmCommentPrefix="[skip ci]" -DpushChanges=false release:perform -DlocalCheckout=true

Expected behavior: mvn release:{prepare,perform} should work without having to set passphraseServerId to the default value.

Actual behavior:

passphraseServerId must be set to gpg.passphrase in pom.xml for the release to succeed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andrebraitcommented, Apr 21, 2021

Apparently you also need to specify the key to be used by maven-gpg-plugin with the keyname configuration.

Personally, I ended up just choosing to use the sign-maven-plugin instead of the maven-gpg-plugin

0reactions
caroso-decommented, Feb 18, 2022

Just in case anyone else stumbles across this discussion looking for an answer to gpg: Sorry, no terminal at all requested - can't get input: in my case the problem simply was an outdated maven-gpg-plugin. The README works perfectly well for me now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid gpg signing prompt when using Maven release plugin
Just set it up in a profile in settings.xml and activate it by default: <settings> <profiles> <profile> <id>gpg</id> <properties> ...
Read more >
Usage - Apache Maven GPG Plugin
Usage. Sign artifacts with GnuPG. Signs all of a project's attached artifacts with GnuPG. You need to have previously configured the default key ......
Read more >
Publish a Java Project to the Maven Central Repository - Foojay
This guide will describe how to publish the JDesk framework to Maven Central. The project is written in Java using Maven as the...
Read more >
Coverage Report - org.codehaus.mojo.rpm.AbstractRPMMojo
"License"); you may not use this file except in compliance ... Any other value (such as <tt>x86_64</tt>) will set the architecture of the...
Read more >
Open Source Used In AppDynamics_Cloud_Monitoring 3040
licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or...
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