[MNG-1908] correct error introduced in last rev with locally installed snapshots

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@375497 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2006-02-07 05:51:14 +00:00
parent c308bef2d8
commit cc507307b8
3 changed files with 9 additions and 5 deletions

View File

@ -255,7 +255,8 @@ public class DefaultWagonManager
}
}
if ( !successful )
// if it already exists locally we were just trying to force it - ignore the update
if ( !successful && !artifact.getFile().exists() )
{
throw new ResourceDoesNotExistException( "Unable to download the artifact from any repository" );
}

View File

@ -78,10 +78,11 @@ public class DefaultRepositoryMetadataManager
File file = new File( localRepository.getBasedir(),
localRepository.pathOfLocalRepositoryMetadata( metadata, repository ) );
boolean checkForUpdates = policy.checkOutOfDate( new Date( file.lastModified() ) ) || !file.exists();
boolean checkForUpdates =
policy.checkOutOfDate( new Date( file.lastModified() ) ) || !file.exists();
boolean metadataIsEmpty = true;
if ( checkForUpdates )
{
getLogger().info( metadata.getKey() + ": checking for updates from " + repository.getId() );
@ -201,6 +202,8 @@ public class DefaultRepositoryMetadataManager
if ( !m.getVersioning().getSnapshot().isLocalCopy() )
{
// TODO: I think this is incorrect (it results in localCopy set in a remote profile). Probably
// harmless so not removing at this point until full tests in place.
m.getVersioning().getSnapshot().setLocalCopy( true );
metadata.setMetadata( m );
metadata.storeInLocalRepository( localRepository, repository );
@ -372,7 +375,7 @@ public class DefaultRepositoryMetadataManager
getLogger().info( "Repository '" + repository.getId() + "' will be blacklisted" );
getLogger().debug( "Exception", e );
repository.setBlacklisted( allowBlacklisting );
throw e;
}
}

View File

@ -152,7 +152,7 @@ public class DefaultArtifactResolver
wagonManager.getArtifact( artifact, repositories );
}
if ( !artifact.isResolved() )
if ( !artifact.isResolved() && !destination.exists() )
{
throw new ArtifactResolutionException(
"Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata.",