Maven Release Plugin
  1. Maven Release Plugin
  2. MRELEASE-742

Regression in 2.2.2 related to maven-gpg-plugin

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      OS X 10.6, Maven 3.0.3, maven-gpg-plugin 1.4
    • Number of attachments :
      0

      Description

      After updating to Release Plugin 2.2.2 gpg plugin fails with error:

      "Cannot obtain passphrase in batch mode"

      Which is thrown (see http://maven.apache.org/plugins/maven-gpg-plugin/xref/org/apache/maven/plugin/gpg/AbstractGpgMojo.html) when the passphrase has not been set and the use agent parameter is
      false. The passphrase is set in my settings.xml and the useAgent has the default false value.

      Downgrading to 2.2.1 fixes the problem and the built artifacts are correctly signed.

      An example POM project can be found at:

      http://code.google.com/p/derquinse-commons/source/browse/trunk/derquinse-pom/pom.xml

        Activity

        Hide
        Robert Scholte added a comment -

        When running release:prepare with debugLogging (and dryRun, so you won't actually commit the changes), can you tell the difference of the configuration of the gpg-plugin?
        So mvn release:prepare -X -DdryRun=true

        And from these logs, do you see why these configurations could be different?

        Show
        Robert Scholte added a comment - When running release:prepare with debugLogging (and dryRun, so you won't actually commit the changes), can you tell the difference of the configuration of the gpg-plugin? So mvn release:prepare -X -DdryRun=true And from these logs, do you see why these configurations could be different?
        Hide
        Gili added a comment - - edited

        I can confirm this regression. The problem is caused by the fact that version 2.2.2 overrides settings.xml. Here is the output I get from "release:perform" on version 2.2.2:

        [INFO] Invoking perform goals in directory /home/builds/.jenkins/workspace/cmake/target/checkout
        [INFO] Executing goals 'deploy'...
        [INFO] Executing: /bin/sh -c cd /home/builds/.jenkins/workspace/cmake/target/checkout && /home/builds/.jenkins/tools/Maven/Maven_auto-install_/bin/mvn -s /tmp/release-settings5386211605411677960.xml deploy --no-plugin-updates -Psonatype-oss-release -P linux,always-active -f pom.xml
        

        Notice, "-s /tmp/release-settings5386211605411677960.xml". Version 2.0 looks identical except it does not override settings.xml and as a result signing works fine. Peeking inside /tmp/release-settings5386211605411677960.xml it looks like the plugin took ~/.m2/settings.xml and stripped out the "always-active" profile (which sets the "gpg.passphrase" property).

        This issue is very serious (no known workaround short of downgrading). Please investigate it right away.

        Show
        Gili added a comment - - edited I can confirm this regression. The problem is caused by the fact that version 2.2.2 overrides settings.xml. Here is the output I get from "release:perform" on version 2.2.2: [INFO] Invoking perform goals in directory /home/builds/.jenkins/workspace/cmake/target/checkout [INFO] Executing goals 'deploy'... [INFO] Executing: /bin/sh -c cd /home/builds/.jenkins/workspace/cmake/target/checkout && /home/builds/.jenkins/tools/Maven/Maven_auto-install_/bin/mvn -s /tmp/release-settings5386211605411677960.xml deploy --no-plugin-updates -Psonatype-oss-release -P linux,always-active -f pom.xml Notice, "-s /tmp/release-settings5386211605411677960.xml". Version 2.0 looks identical except it does not override settings.xml and as a result signing works fine. Peeking inside /tmp/release-settings5386211605411677960.xml it looks like the plugin took ~/.m2/settings.xml and stripped out the "always-active" profile (which sets the "gpg.passphrase" property). This issue is very serious (no known workaround short of downgrading). Please investigate it right away.
        Hide
        Robert Scholte added a comment -

        Gili, what's your environment? Especially which Maven version?

        Show
        Robert Scholte added a comment - Gili, what's your environment? Especially which Maven version?
        Hide
        Gili added a comment - - edited

        Hi Robert,

        Maven 3.0.3, Ubuntu 12.04, 64-bit. Please note I cannot use Maven 3.0.4 because of this bug: http://jira.codehaus.org/browse/MNG-5363

        Show
        Gili added a comment - - edited Hi Robert, Maven 3.0.3, Ubuntu 12.04, 64-bit. Please note I cannot use Maven 3.0.4 because of this bug: http://jira.codehaus.org/browse/MNG-5363
        Hide
        Robert Scholte added a comment -

        Maven 3.0.4 fixes an issue with Profile merging in settings.xml which was there since the first Maven3 release. What you could try: run the project with Maven-3.0.4, and set the maven-release-plugin#mavenHome property to Maven-3.0.3

        Show
        Robert Scholte added a comment - Maven 3.0.4 fixes an issue with Profile merging in settings.xml which was there since the first Maven3 release. What you could try: run the project with Maven-3.0.4, and set the maven-release-plugin#mavenHome property to Maven-3.0.3
        Hide
        Gili added a comment -

        Robert,

        I'll try what you suggested in a few days (unfortunately I'm tied up with critical work for the next 2 days). On a side-note, can you please give MNG-5363 a nudge? We need someone to update Component, Priority and possibly assign it to the right person. I don't have the necessary permissions.

        Show
        Gili added a comment - Robert, I'll try what you suggested in a few days (unfortunately I'm tied up with critical work for the next 2 days). On a side-note, can you please give MNG-5363 a nudge? We need someone to update Component, Priority and possibly assign it to the right person. I don't have the necessary permissions.
        Hide
        Gili added a comment -

        Confirmed. This works as expected in Maven 3.0.5, Maven Release Plugin 2.4 and maven-gpg-plugin 1.4.

        Show
        Gili added a comment - Confirmed. This works as expected in Maven 3.0.5, Maven Release Plugin 2.4 and maven-gpg-plugin 1.4.

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Andres Rodriguez
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: