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

Artifact Resolver does not retrieve the latest version from central Maven Repository

    Details

    • Similar Issues:

      Description

      Despite the fact that the plugin is configured with the snapshot update policy = always (as shown in the attached screenshot), it always uses the snapshot version that is already available on the local Maven repository of the Jenkins slave.

      I consider this bug as a Major one as it is not possible to leverage this plugin to auto-deploy overnight the latest SNAPSHOT version

        Attachments

          Activity

          Hide
          renatodelgaudio Renato Del Gaudio added a comment -

          As a workaround, I am not longer using this plugin and using instead the Maven dependency plugin along with the localRepositoryDirectory configuration to make sure that the latest SNAPSHOT is always downloaded from the master repository

          http://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html

          Show
          renatodelgaudio Renato Del Gaudio added a comment - As a workaround, I am not longer using this plugin and using instead the Maven dependency plugin along with the localRepositoryDirectory configuration to make sure that the latest SNAPSHOT is always downloaded from the master repository http://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html
          Hide
          barclay_reg Robert Kleinschmager added a comment - - edited

          still there in version 1.1.1
          maybe it's also related to the own local repo (store at /tmp/repositoryconnector-repo/ by default)

          Show
          barclay_reg Robert Kleinschmager added a comment - - edited still there in version 1.1.1 maybe it's also related to the own local repo (store at /tmp/repositoryconnector-repo/ by default)
          Hide
          idapperdanman David Ishee added a comment - - edited

          I lost hours of work trying to figure out why my upgrade jobs weren't installing the latest code. Now I'm manually deleting the localRepositoryDirectory to workaround this bug.

          Show
          idapperdanman David Ishee added a comment - - edited I lost hours of work trying to figure out why my upgrade jobs weren't installing the latest code. Now I'm manually deleting the localRepositoryDirectory to workaround this bug.
          Hide
          phpock Philip Pock added a comment -

          We experience the same issue in our environment using version 1.1.1
          The artifacts are managed by Artifactory. The repository is configured with Maven Snapshot Version Behavior: Nonunique
          Therefore SNAPSHOT artifacts are always stored using the same file name.

          Artifactory documentation: http://www.jfrog.com/confluence/display/RTF/Local+Repositories#LocalRepositories-MavenSnapshotVersionBehavior

          I've debugged the plugin and found out that it checks if the artifact is available in the local cache and if so, no further checks regarding the last update time are made. Therefore the locally cached file of a SNAPSHOT artifact is never updated.

          As a workaround, we have now configured the repository to use unique file names for SNAPSHOT artifacts. The filename now changes every time a new version of the artifact is deployed. Of course the new file is never available in the local cache and therefore the plugin downloads the artifact from the repository.

          Show
          phpock Philip Pock added a comment - We experience the same issue in our environment using version 1.1.1 The artifacts are managed by Artifactory. The repository is configured with Maven Snapshot Version Behavior: Nonunique Therefore SNAPSHOT artifacts are always stored using the same file name. Artifactory documentation: http://www.jfrog.com/confluence/display/RTF/Local+Repositories#LocalRepositories-MavenSnapshotVersionBehavior I've debugged the plugin and found out that it checks if the artifact is available in the local cache and if so, no further checks regarding the last update time are made. Therefore the locally cached file of a SNAPSHOT artifact is never updated. As a workaround, we have now configured the repository to use unique file names for SNAPSHOT artifacts. The filename now changes every time a new version of the artifact is deployed. Of course the new file is never available in the local cache and therefore the plugin downloads the artifact from the repository.
          Hide
          barclay_reg Robert Kleinschmager added a comment -

          the problem only occured, if you repository is marked as 'Managed repository'.
          (cause lies within the usage of mirror-repository of the aether api)

          Show
          barclay_reg Robert Kleinschmager added a comment - the problem only occured, if you repository is marked as 'Managed repository'. (cause lies within the usage of mirror-repository of the aether api)
          Hide
          cschulz C. S. added a comment -

          Can confirm this behaviour.

          Show
          cschulz C. S. added a comment - Can confirm this behaviour.
          Show
          barclay_reg Robert Kleinschmager added a comment - pull request submitted https://github.com/jenkinsci/repository-connector-plugin/pull/11
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: robertkleinschmager
          Path:
          src/main/java/org/jvnet/hudson/plugins/repositoryconnector/aether/Aether.java
          http://jenkins-ci.org/commit/repository-connector-plugin/6678c6838691cc154a8fe55eb909e420087fcdd6
          Log:
          [FIXED JENKINS-20263]
          Artifact Resolver does not retrieve the latest version from central Maven Repository

          • as #resolveMirrors() currently just copies the repository, we should ensure, that the policies are set BEFORE the copy was made
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: robertkleinschmager Path: src/main/java/org/jvnet/hudson/plugins/repositoryconnector/aether/Aether.java http://jenkins-ci.org/commit/repository-connector-plugin/6678c6838691cc154a8fe55eb909e420087fcdd6 Log: [FIXED JENKINS-20263] Artifact Resolver does not retrieve the latest version from central Maven Repository as #resolveMirrors() currently just copies the repository, we should ensure, that the policies are set BEFORE the copy was made
          Hide
          tiendungitd Dennis Tran added a comment -

          I still got this issue in Jenkins 2.60.3, pls advise me how to fix it without Maven Snapshot Version Behavior: unique in Artifactory. Please advise me how to fix it

          Show
          tiendungitd Dennis Tran added a comment - I still got this issue in Jenkins 2.60.3, pls advise me how to fix it without Maven Snapshot Version Behavior: unique in Artifactory. Please advise me how to fix it

            People

            • Assignee:
              barclay_reg Robert Kleinschmager
              Reporter:
              renatodelgaudio Renato Del Gaudio
            • Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: