Uploaded image for project: 'Maven GPG Plugin'
  1. Maven GPG Plugin
  2. MGPG-113

Upgrading from 3.1.0 to 3.2.1 with no other changes causes "gpg:sign-and-deploy-file" failed: 401 Unauthorized

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.1
    • 3.2.2
    • None
    • ubuntu-22.04 (Ubuntu 22.04 LTS) image

    Description

      After upgrading to Maven GPG plugin from 3.1.0 to 3.2.0/3.2.1, the deploy command "gpg:sign-and-deploy-file " failed with the message "Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:3.2.1:sign-and-deploy-file : 401 Unauthorized"

       

      NOTE: 3.1.0 and below version of gpg:sign-and-deploy-file works well for below CLI

       

      Deploy CLI with plugin gpg:sign-and-deploy-file

      ```

      mvn -B -Dmaven.wagon.http.retryHandler.count=3 -DretryFailedDeploymentCount=3 \

      -s utils/settings.xml gpg:sign-and-deploy-file -Dgpg.passphrase=xxx \

      -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2 -DrepositoryId=ossrh \

      -DgrouId=com.nvidia -DartifactId=test -Dversion=0.1.0 -Dfile=test.jar

      ```

       

       

      SONATYPE_USR/PSW defined as env, utils/settings.xml as below

      ```

      <settings xsi:schemaLocation=http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd xmlns=http://maven.apache.org/SETTINGS/1.1.0          xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance>

          <servers>

              <server>

                  <id>ossrh</id>

                  <username>${env.SONATYPE_USR}</username>

                  <password>${env.SONATYPE_PSW}</password>

              </server>

         </servers>

      ...... </settings>

      ```

       

      Error Logs

       

      ```

      20:03:52 + mvn -B -Dmaven.wagon.http.retryHandler.count=3 -DretryFailedDeploymentCount=3 -s utils/settings.xml -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2 -DrepositoryId=ossrh org.apache.maven.plugins:maven-gpg-plugin:3.2.1:sign-and-deploy-file -Dgpg.executable=nvsec_sign -DgroupId=com.nvidia -DartifactId=test -Dversion=0.1.0 -Dfile=test.jar 20:03:52 [INFO] Scanning for projects... 

      *20:04:15  [INFO] Uploading to ossrh: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/nvidia/test/0.1.0/test-0.1.0.jar*

       

      20:04:15  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:3.2.1:sign-and-deploy-file (default-cli) on project standalone-pom: Error deploying attached artifacts [com.nvidia:test:jar:0.1.0, com.nvidia:test:pom:0.1.0, com.nvidia:test:jar.asc:0.1.0, com.nvidia:test:pom.asc:0.1.0]: Failed to deploy artifacts: Could not transfer artifact com.nvidia:test:jar:0.1.0 from/to ossrh (https://oss.sonatype.org/service/local/staging/deploy/maven2): Transfer failed for https://oss.sonatype.org/service/local/staging/deploy/maven2/com/nvidia/test/0.1.0/test-0.1.0.jar 401 Unauthorized -> [Help 1]

       

       

      ```

      Attachments

        Issue Links

          Activity

            People

              cstamas Tamas Cservenak
              nvtiml Tim Tim
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: