localCopyLastModified = getLocalCopyLastModified( localRepository, metadata );
}
for ( ArtifactRepository repository : remoteRepositories )
{
ArtifactRepositoryPolicy policy = metadata.getPolicy( repository );
File file =
new File( localRepository.getBasedir(), localRepository.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 if ( updateCheckManager.isUpdateRequired( metadata, repository, file ) )
{
update = true;
}
else
{
update = false;
}
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() );