From 399e51761afa74dca15a17466916c43b4e372f45 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Wed, 20 Jul 2005 08:10:42 +0000 Subject: [PATCH] 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 --- .../AbstractVersionTransformation.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java index 3aa951bfe1..682c64221f 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java @@ -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 )