mirror of https://github.com/apache/maven.git
[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:
parent
54be625048
commit
f022e66b2a
|
@ -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-"
|
||||
|
|
Loading…
Reference in New Issue