mirror of https://github.com/apache/maven.git
[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:
parent
c308bef2d8
commit
cc507307b8
|
@ -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" );
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.",
|
||||
|
|
Loading…
Reference in New Issue