fix problem with snapshots being repeatedly checked, recently introduced.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@168545 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-05-06 07:06:28 +00:00
parent d17b250fec
commit b31e42b511
1 changed files with 8 additions and 1 deletions

View File

@ -121,14 +121,21 @@ public class SnapshotTransformation
SnapshotArtifactMetadata remoteMetadata = SnapshotArtifactMetadata.retrieveFromRemoteRepository(
artifact, remoteRepository, wagonManager );
if ( remoteMetadata.compareTo( localMetadata ) > 0 )
int difference = remoteMetadata.compareTo( localMetadata );
if ( difference > 0 )
{
// remote is newer
artifact.setRepository( remoteRepository );
localMetadata = remoteMetadata;
checkedUpdates = true;
}
else if ( difference == 0 )
{
// Identical, simply touch the file to prevent re-checking
checkedUpdates = true;
}
}
}