Uploaded image for project: 'Jenkins Artifactory Plug-in'
  1. Jenkins Artifactory Plug-in
  2. HAP-236

Artifact resolution does not work for POMs defined as a parent of a POM

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.2.0
    • Component/s: Common, Maven3
    • Labels:
      None
    • Environment:

      Jenkins 1.428
      Artifactory Pro 2.3.4.1
      Maven 3.0.3

      Description

      I have a corporate POM, which is defined as a parent for all Maven projects. As such, the corporate pom is not available on the source path, cannot be resolved through relativePath, and must be resolved through a Maven repository.

      Running mvn clean install on the cmd line with an appropriate repository setup in settings.xml, Maven is successfully able to resolve the corporate POM from an Artifactory repository.

      When running in Jenkins, and having enabled 'Resolve artifacts from Artifactory' for the project, the build fails to override artifact resolution for the corporate POM but does override artifact resolution for anything in the dependencies section.

      Here is a snippet of the log when the build tries to resolve the corporate POM

      Parsing POMs
      Downloaded artifact http://host:8080/artifactory/sample-public//com/company/root/pom/1.0.1/pom-1.0.1.pom
      [Sample Project] $ /apps/sw/oracle/jrockit-x64/bin/java -Dm3plugin.lib=/apps/services/hudson-home/workspace/artifactory-plugin/2.0.4 -cp /apps/services/hudson-home/maven3-agent.jar:/apps/sw/apache/maven/maven3/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /apps/sw/apache/maven/maven3 /apps/services/hudson-home/slave.jar /apps/services/hudson-home/maven3-interceptor.jar 50937

      and here is a snippet from a little further down the log where artifact resolution does work correctly

      [INFO] Building Sample Project Parent 1.0.0-S6-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [DEBUG] Intercepted artifact downloading event: ARTIFACT_DOWNLOADING com.google.code.maven-svn-revision-number-plugin:maven-svn-revision-number-plugin:pom:1.6 @ mirrorId (http://host:8080/artifactory/sample-public/, releases)
      [DEBUG] Enforcing repository URL: http://host:8080/artifactory/repo for event: ARTIFACT_DOWNLOADING com.google.code.maven-svn-revision-number-plugin:maven-svn-revision-number-plugin:pom:1.6 @ mirrorId (http://host:8080/artifactory/sample-public/, releases)
      [DEBUG] Enforcing repository authentication: deployer for event: ARTIFACT_DOWNLOADING com.google.code.maven-svn-revision-number-plugin:maven-svn-revision-number-plugin:pom:1.6 @ mirrorId (http://host:8080/artifactory/repo, releases)

      In the snippet above, sample-public is defined as a mirrorOf * in the settings.xml and repo is defined as the override repository for artifact resolution. The first snippet resolves the parent POM through sample-public, when it should resolve it through repo as the resolution repository should be overridden.

        Attachments

          Activity

            People

            • Assignee:
              shayy Shay Yaakov (Inactive)
              Reporter:
              diablo Umesh Desai
            • Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: