[MNG-1908] fix regression with LATEST metadata

Merged from: c492153 on maven-2.0.x


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@492154 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2007-01-03 14:06:56 +00:00
parent a6ddaac0b5
commit ad045aaa88
2 changed files with 10 additions and 8 deletions

View File

@ -324,7 +324,8 @@ public class DefaultWagonManager
else
{
getLogger().debug( "Trying repository " + repository.getId() );
getRemoteFile( repository, artifact.getFile(), remotePath, downloadMonitor, policy.getChecksumPolicy() );
getRemoteFile( repository, artifact.getFile(), remotePath, downloadMonitor, policy.getChecksumPolicy(),
false );
getLogger().debug( " Artifact resolved" );
artifact.setResolved( true );
@ -337,11 +338,11 @@ public class DefaultWagonManager
{
String remotePath = repository.pathOfRemoteRepositoryMetadata( metadata );
getRemoteFile( repository, destination, remotePath, null, checksumPolicy );
getRemoteFile( repository, destination, remotePath, null, checksumPolicy, true );
}
private void getRemoteFile( ArtifactRepository repository, File destination, String remotePath,
TransferListener downloadMonitor, String checksumPolicy )
TransferListener downloadMonitor, String checksumPolicy, boolean force )
throws TransferFailedException, ResourceDoesNotExistException
{
// TODO: better excetpions - transfer failed is not enough?
@ -412,7 +413,7 @@ public class DefaultWagonManager
retry = false;
// This should take care of creating destination directory now on
if ( destination.exists() )
if ( destination.exists() && !force )
{
try
{

View File

@ -19,14 +19,14 @@ package org.apache.maven.artifact.resolver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata;
import org.apache.maven.artifact.repository.metadata.Metadata;
import org.apache.maven.artifact.repository.metadata.Versioning;
import org.apache.maven.artifact.repository.metadata.Snapshot;
import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata;
import org.apache.maven.artifact.repository.metadata.Versioning;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.artifact.transform.ArtifactTransformationManager;
import org.apache.maven.wagon.ResourceDoesNotExistException;
@ -171,6 +171,7 @@ public class DefaultArtifactResolver
try
{
// TODO: force should be passed to the wagon manager
if ( artifact.getRepository() != null )
{
// the transformations discovered the artifact - so use it exclusively
@ -295,7 +296,7 @@ public class DefaultArtifactResolver
missingArtifacts.add( node.getArtifact() );
}
}
if ( missingArtifacts.size() > 0 )
{
throw new MultipleArtifactsNotFoundException( originatingArtifact, missingArtifacts, remoteRepositories );