Skip to content

Authorization issue with private maven repository #43

Description

@justinwb

Nice work on this action. Running into an authz issue today with our private sonatype nexus maven repo. All has been running well until we added a dependency in the pom on another library hosted in the same private repository. Suddenly we're seeing authorization issues and it's a bit difficult to debug what's happening within the action. Looking at other possible causes in the environment but thought it was worth filing an issue here in case there's something known or an obvious hitch in my configuration.

Failed to execute goal on project main-xyz: Could not resolve dependencies for project main-xyz:jar:0.1.1-SNAPSHOT: 
Failed to collect dependencies at dependency-xyz:0.9.1: 
Failed to read artifact descriptor for dependency-xyz:jar:0.9.1: 
Could not transfer artifact dependency-xyz:pom:0.9.1 from/to repo-id-xyz (repo-url-xyz): 
Authentication failed for dependency-xyz.pom 401 Unauthorized -> [Help 1]

I'm not seeing this behavior locally, or in our other actions using the same credentials (from github secrets) which use actions/setup-java@v1.

Action is configured as follows:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Build and Test
        uses: qcastel/github-actions-maven-cmd@master
        with:
          maven-args: "clean install -Ddockerfile.skip -DdockerCompose.skip -Djib.skip"
      - name: Prepare and Deploy Release
        uses: qcastel/github-actions-maven-release@master
        env:
          JAVA_HOME: /usr/lib/jvm/java-11-openjdk/
        with:
          # releases are done from the main branch
          release-branch-name: "main"
          version-minor: ${{github.event.inputs.minor_increment}}
          version-major: ${{github.event.inputs.major_increment}}
          git-release-bot-name: "xyz-bot"
          git-release-bot-email: "xyz@xyz.com"
          ###########################################################
          maven-args: ""
          ###########################################################
          ssh-private-key: ${{ secrets.XYZ_SSH }}
          ###########################################################
          gpg-enabled: true
          gpg-key-id: ${{ secrets.XYZ_KEY_ID }}
          gpg-key: ${{ secrets.XYZ_KEY }}
          ###########################################################
          # configure nexus repository
          maven-repo-server-id: repo-id-xyz   
          maven-repo-server-username: ${{ secrets.XYZ_MAVEN_USERNAME }}
          maven-repo-server-password: ${{ secrets.XYZ_MAVEN_PASSWORD }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions