[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
This commit is contained in:
Benjamin Bentmann 2010-08-20 16:55:04 +00:00
parent 54be625048
commit f022e66b2a
1 changed files with 11 additions and 0 deletions

View File

@ -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-"