Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70458

Not authorized error when parent pom is only in artifactory.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • artifactory-plugin
    • None
    • jenkins version: 2.375.2 and 2.346.3
      artifactory plugin version: 3.18.0

      We are building using the syntax described here in the Maven Builds with Artifactory section. Below is our jenkinsfile. The artifactory server is defined in the jenkins system configuration with correct username/api key

      //jenkinsfile
       pipeline{
          agent{
              node{
                  label "my-node"
              }
          }
              tools {
                  jdk 'jdk8'
              }
      stages{
          stage('testing'){
              steps {
                  script {
                      checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], gitTool: 'git', userRemoteConfigs: [[credentialsId: 'x', url: 'https://github.x.net/org/repo']]]
                      server = Artifactory.server('x-artifactory')
                      buildInfo = Artifactory.newBuildInfo()
                      rtMaven = Artifactory.newMavenBuild()
                      rtMaven.resolver server: server, releaseRepo: 'x-common-maven', snapshotRepo: 'x-common-maven'
                      rtMaven.tool = 'Maven-3.3.9'
                      mvnHome = tool rtMaven.tool
                      buildInfo = rtMaven.run pom: 'pom.xml', goals: 'clean install', buildInfo: buildInfo
                  }
              }
          }
      }                    
          
      }

       

      We are receiving an authorization error 

      12:15:52  Downloading: https://x.com/artifactory/x-common-maven/com/parent/99.9.99-SNAPSHOT/parent-99.9.99-SNAPSHOT.pom
      12:15:52  
      [main] ERROR org.apache.maven.DefaultMaven - [ERROR] Some problems were encountered while processing the POMs:
      12:15:52  [FATAL] Non-resolvable parent POM for com:api:[unknown-version]: Could not transfer artifact com:parent:pom:99.9.99-SNAPSHOT from/to artifactory-snapshot (https://x.com/artifactory/x-common-maven): Not authorized , ReasonPhrase:Unauthorized. and 'parent.relativePath' points at no local POM @ line 11, column 13
      12:15:52   @ 
      12:15:52  [main] ERROR org.apache.maven.cli.MavenCli - The build could not read 1 project -> [Help 1]
      12:15:52  [main] ERROR org.apache.maven.cli.MavenCli -   
      12:15:52  [main] ERROR org.apache.maven.cli.MavenCli -   The project com:api:[unknown-version] (/var/lib/jenkins/workspace/test/pom.xml) has 1 error
      12:15:52  [main] ERROR org.apache.maven.cli.MavenCli -     Non-resolvable parent POM for com:api:[unknown-version]: Could not transfer artifact com:parent:pom:99.9.99-SNAPSHOT from/to artifactory-snapshot (https://x.com/artifactory/x-common-maven): Not authorized , ReasonPhrase:Unauthorized. and 'parent.relativePath' points at no local POM @ line 11, column 13 -> [Help 2]

      If we revert to artifactory plugin 3.17.4 we no longer see the error

            eyalbe Eyal Ben Moshe
            jallman Jeff
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: