From f022e66b2a5ee3a36abf80ec9e1dfe4b99b58368 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 20 Aug 2010 16:55:04 +0000 Subject: [PATCH] [MNG-4772] [regression] Plugin version resolution ignores enabled flags on repository git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@987572 13f79535-47bb-0310-9956-ffa450edef68 --- .../internal/DefaultPluginVersionResolver.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java index 7385becc99..5d5e239ef2 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java @@ -112,6 +112,12 @@ public class DefaultPluginVersionResolver // TODO: we should cycle through the repositories but take the repository which actually satisfied the prefix. for ( ArtifactRepository repository : request.getRemoteRepositories() ) { + if ( !isEnabled( repository ) ) + { + logger.debug( "Skipped plugin version lookup from disabled repository " + repository.getId() ); + continue; + } + String localPath = getLocalMetadataPath( request, repository ); File artifactMetadataFile = new File( localRepository.getBasedir(), localPath ); @@ -196,6 +202,11 @@ public class DefaultPluginVersionResolver return result; } + private boolean isEnabled( ArtifactRepository repository ) + { + return repository.getReleases().isEnabled() || repository.getSnapshots().isEnabled(); + } + private String getLocalMetadataPath( PluginVersionRequest request, ArtifactRepository repository ) { return request.getGroupId().replace( '.', '/' ) + '/' + request.getArtifactId() + "/maven-metadata-"