don't continually try to resolve from a remote repository when it doesn't exist there

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@219854 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-07-20 08:10:42 +00:00
parent e1c8ffb251
commit 399e51761a
1 changed files with 9 additions and 8 deletions

View File

@ -104,7 +104,9 @@ public abstract class AbstractVersionTransformation
artifact.getArtifactId() + ": checking for updates from " + remoteRepository.getId() );
VersionArtifactMetadata remoteMetadata;
checkedUpdates = true;
try
{
remoteMetadata = retrieveFromRemoteRepository( artifact, remoteRepository, localMetadata );
@ -112,10 +114,10 @@ public abstract class AbstractVersionTransformation
catch ( ResourceDoesNotExistException e )
{
getLogger().debug( "Error resolving artifact version from metadata.", e );
continue;
}
int difference = remoteMetadata.compareTo( localMetadata );
if ( difference > 0 )
{
@ -124,7 +126,6 @@ public abstract class AbstractVersionTransformation
localMetadata = remoteMetadata;
}
checkedUpdates = true;
}
}
@ -137,7 +138,7 @@ public abstract class AbstractVersionTransformation
}
String version = localMetadata.constructVersion();
// TODO: if the POM and JAR are inconsistent, this might mean that different version of each are used
if ( !artifact.getFile().exists() || localMetadata.newerThanFile( artifact.getFile() ) )
{
@ -177,12 +178,12 @@ public abstract class AbstractVersionTransformation
throws ArtifactMetadataRetrievalException, ResourceDoesNotExistException
{
AbstractVersionArtifactMetadata metadata = createMetadata( artifact );
metadata.retrieveFromRemoteRepository( remoteRepository, wagonManager );
return metadata;
}
protected abstract AbstractVersionArtifactMetadata createMetadata( Artifact artifact );
private VersionArtifactMetadata readFromLocalRepository( Artifact artifact, ArtifactRepository localRepository )