localCopyLastModified = getLocalCopyLastModified( localRepo, metadata );
}
for ( ArtifactRepository repository : remoteRepositories )
{
ArtifactRepositoryPolicy policy = metadata.getPolicy( repository );
File file =
new File( localRepo.getBasedir(), localRepo.pathOfLocalRepositoryMetadata( metadata, repository ) );
boolean update;
if ( !policy.isEnabled() )
{
update = false;
if ( getLogger().isDebugEnabled() )
{
getLogger().debug(
"Skipping update check for " + metadata.getKey() + " (" + file
+ ") from disabled repository " + repository.getId() + " ("
+ repository.getUrl() + ")" );
}
}
else if ( request.isForceUpdate() )
{
update = true;
}
else if ( localCopyLastModified != null && !policy.checkOutOfDate( localCopyLastModified ) )
{
update = false;
if ( getLogger().isDebugEnabled() )
{
getLogger().debug(
"Skipping update check for " + metadata.getKey() + " (" + file
+ ") from repository " + repository.getId() + " (" + repository.getUrl()
+ ") in favor of local copy" );
}
}
else
{
update = updateCheckManager.isUpdateRequired( metadata, repository, file );
}
if ( update )
{
getLogger().info( metadata.getKey() + ": checking for updates from " + repository.getId() );
try
{
wagonManager.getArtifactMetadata( metadata, repository, file, policy.getChecksumPolicy() );
}
catch ( ResourceDoesNotExistException e )
{
getLogger().debug( metadata + " could not be found on repository: " + repository.getId() );