if ( StringUtils.contains( version, VersionUtil.SNAPSHOT ) )
{
File localSnapshotModel = findTimeStampedSnapshotPom( groupId, artifactId, version, model.getParent() );
if ( localSnapshotModel != null )
{
return new FileModelSource( localSnapshotModel );
}
}
for ( RemoteRepository remoteRepository : remoteRepositories )
{
try
{
boolean success = getModelFromProxy( remoteRepository, groupId, artifactId, version, filename );
if ( success && model.exists() )
{
log.info( "Model '{}' successfully retrieved from remote repository '{}'",
model.getAbsolutePath(), remoteRepository.getId() );
break;
}
}
catch ( ResourceDoesNotExistException e )
{
log.info(
"An exception was caught while attempting to retrieve model '{}' from remote repository '{}'.Reason:{}",
model.getAbsolutePath(), remoteRepository.getId(), e.getMessage() );
}
catch ( Exception e )
{
log.warn(
"An exception was caught while attempting to retrieve model '{}' from remote repository '{}'.Reason:{}",
model.getAbsolutePath(), remoteRepository.getId(), e.getMessage() );
continue;
}
}
}
return new FileModelSource( model );
}