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

Repository Connector Plugin doesn't refresh the list of artifacts stored on maven repository

      I'm using this plugin to choose some artifacts versions which are stored on Maven repository.

      The problem is that the list provided by the Maven Artifact Resolver parameter doesn't get refreshed whereas new versions of my artfiacts are stored on Maven Repository.

      Is there a way to refresh this list automatically ? Like settings a timer or something else ?

          [JENKINS-29166] Repository Connector Plugin doesn't refresh the list of artifacts stored on maven repository

          After investigation, the issue comes from Aether's cache.
          more details there : https://github.com/apache/maven/blob/master/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java

              public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request )
                  throws VersionResolutionException
              {
                  ...
          
                  Key cacheKey = null;
                  RepositoryCache cache = session.getCache();
                  if ( cache != null && !ConfigUtils.getBoolean( session, false, "aether.versionResolver.noCache" ) )
                  {
                      cacheKey = new Key( session, request );
          
                      Object obj = cache.get( session, cacheKey );
                      if ( obj instanceof Record )
                      {
                          Record record = (Record) obj;
                          result.setVersion( record.version );
                          result.setRepository(
                              CacheUtils.getRepository( session, request.getRepositories(), record.repoClass, record.repoId ) );
                          return result;
                      }
                  }
          ...
          

          Fabrice Daugan added a comment - After investigation, the issue comes from Aether's cache. more details there : https://github.com/apache/maven/blob/master/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) throws VersionResolutionException { ... Key cacheKey = null ; RepositoryCache cache = session.getCache(); if ( cache != null && !ConfigUtils.getBoolean( session, false , "aether.versionResolver.noCache" ) ) { cacheKey = new Key( session, request ); Object obj = cache.get( session, cacheKey ); if ( obj instanceof Record ) { Record record = (Record) obj; result.setVersion( record.version ); result.setRepository( CacheUtils.getRepository( session, request.getRepositories(), record.repoClass, record.repoId ) ); return result; } } ...

          Fabrice Daugan added a comment - - edited

          Fabrice Daugan added a comment - - edited I've created a pull request there : https://github.com/jenkinsci/repository-connector-plugin/pull/12

          ms32035 added a comment -

          Setting aether.versionResolver.noCache did not resolve the issue. However, changing Ather default constructor seems to have helped:

              public Aether(Collection<Repository> remoteRepositories, File localRepository) {
                      this(remoteRepositories, localRepository, null, false, RepositoryPolicy.UPDATE_POLICY_ALWAYS,
                              RepositoryPolicy.CHECKSUM_POLICY_IGNORE, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_IGNORE);
                  }
          

          ms32035 added a comment - Setting aether.versionResolver.noCache did not resolve the issue. However, changing Ather default constructor seems to have helped: public Aether(Collection<Repository> remoteRepositories, File localRepository) { this (remoteRepositories, localRepository, null , false , RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_IGNORE, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_IGNORE); }

          +1 : Worked

          Fabrice Daugan added a comment - +1 : Worked

          Code changed in jenkins
          User: Fabrice Daugan
          Path:
          src/main/java/org/jvnet/hudson/plugins/repositoryconnector/aether/Aether.java
          http://jenkins-ci.org/commit/repository-connector-plugin/728d2c3a72954fc1f18f0969ac60bf49704cf41f
          Log:
          Ensure the artfact's versions list is up to date

          Fix issue : https://issues.jenkins-ci.org/browse/JENKINS-29166
          TRUE -> "aether.versionResolver.noCache"

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Fabrice Daugan Path: src/main/java/org/jvnet/hudson/plugins/repositoryconnector/aether/Aether.java http://jenkins-ci.org/commit/repository-connector-plugin/728d2c3a72954fc1f18f0969ac60bf49704cf41f Log: Ensure the artfact's versions list is up to date Fix issue : https://issues.jenkins-ci.org/browse/JENKINS-29166 TRUE -> "aether.versionResolver.noCache"

          Code changed in jenkins
          User: imod
          Path:
          src/main/java/org/jvnet/hudson/plugins/repositoryconnector/aether/Aether.java
          http://jenkins-ci.org/commit/repository-connector-plugin/995d30564b9dcf8f6a9354e0d15277a8f24907ce
          Log:
          Merge branch 'patch-1' of https://github.com/fabdouglas/repository-connector-plugin into fabdouglas-patch-1 [FIXED JENKINS-29166]

          Compare: https://github.com/jenkinsci/repository-connector-plugin/compare/6678c6838691...995d30564b9d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/org/jvnet/hudson/plugins/repositoryconnector/aether/Aether.java http://jenkins-ci.org/commit/repository-connector-plugin/995d30564b9dcf8f6a9354e0d15277a8f24907ce Log: Merge branch 'patch-1' of https://github.com/fabdouglas/repository-connector-plugin into fabdouglas-patch-1 [FIXED JENKINS-29166] Compare: https://github.com/jenkinsci/repository-connector-plugin/compare/6678c6838691...995d30564b9d

          Is this fix deployed yet ? I don't see this is working in latest version 1.1.3. If not deployed, when is this fix going to be available ?

          Jagadish Pasunuri added a comment - Is this fix deployed yet ? I don't see this is working in latest version 1.1.3. If not deployed, when is this fix going to be available ?

          Issue still exists in v 1.1.3

          Jagadish Pasunuri added a comment - Issue still exists in v 1.1.3

          Please try version 1.2.4.

          Dennis Lundberg added a comment - Please try version 1.2.4.

          Julien Béti added a comment -

          I have version 1.2.6, and I have the issue.

          Julien Béti added a comment - I have version 1.2.6, and I have the issue.

            mirumpf Michael Rumpf
            lebrame57 alexis oliot
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: