diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java index cea967daed..d74bc8ed4b 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java @@ -180,6 +180,12 @@ public class DefaultPluginPrefixResolver { for ( ArtifactRepository repository : request.getRemoteRepositories() ) { + if ( !isEnabled( repository ) ) + { + logger.debug( "Skipped plugin prefix lookup from disabled repository " + repository.getId() ); + continue; + } + String localPath = getLocalMetadataPath( pluginGroup, repository ); File groupMetadataFile = new File( localRepository.getBasedir(), localPath ); @@ -286,6 +292,11 @@ public class DefaultPluginPrefixResolver return null; } + private boolean isEnabled( ArtifactRepository repository ) + { + return repository.getReleases().isEnabled() || repository.getSnapshots().isEnabled(); + } + private PluginPrefixResult resolveFromRepository( PluginPrefixRequest request, String pluginGroup, File metadataFile, ArtifactRepository repository ) {