2

Has anybody got this working?

Teamcity seems unable to get my gpg key from my settings.xml.

I have tried:

  • Uploading a custom settings.xml for the project.
  • Placing it on disk and specifying a custom file location.
  • Putting it in the default locations specified here: http://confluence.jetbrains.com/pages/viewpage.action?pageId=50505270
  • Passing the gpg key on the command line.
  • Using different versions of the mvn release plugin just in case this was a problem (I'm currently using 2.4.2)

No matter what I do I end up with:

Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.1:sign (sign-artifacts) on project driver-binary-downloader-maven-plugin: Cannot obtain passphrase in batch mode

I't exceptionally frustrating because the setings.xml is being read initially (it's using it for the VCS credentials), Teamcity is just not passing it into the gpg signing phase.

This was working fine in Teamcity 7 and i've compared all my settings and they seem the same, I'm currently at a loss.

Ardesco
  • 7,281
  • 26
  • 49
  • First use an more up-to-date version of maven-gpg-plugin (1.4) ..furthermore you should try to use `mvn -Darguments="gpg.passphrase=xxx" ..`. – khmarbaise Dec 24 '13 at 11:02
  • I've tried passing the GPG key on the command line using -Darguments and I'm currently using the GPG plugin 1.4. However you have pointed out something that I've missed, looking at the log it's using the GPG plugin 1.1 and the mvn release plugin 2.1. I guess my next step is to work out why it is using plugin versions I have not specified... – Ardesco Dec 24 '13 at 11:20
  • Define the plugin version in a pluginManagement section of your parent pom. You should also define the maven-release-plugin (in a newer version).. – khmarbaise Dec 24 '13 at 11:26
  • Here is my POM: https://github.com/Ardesco/selenium-standalone-server-plugin/blob/master/pom.xml I've not had problems with it before So i'm pretty sure it's not a POM issue, it's the config on Teamcity 8 that seems problematic. – Ardesco Dec 24 '13 at 11:36
  • 1
    It might be related to the maven bug [MNG-5224](http://jira.codehaus.org/browse/MNG-5224). Which version of maven do you use? – Jifeng Zhang Jan 02 '14 at 16:51
  • Using 3.0.5 at the moment – Ardesco Jan 03 '14 at 07:55

1 Answers1

1

Finally found the solution

I had the public part of the GPG key on the server, but not the private part (Doh).

Really helpful error messages, thanks Maven... :)

Ardesco
  • 7,281
  • 26
  • 49