mirror of https://github.com/apache/maven.git
fix this once and for all. This covers the case of having a local snapshot that was not found remotely, as well as the previous case it was reverted for - avoiding creating the metadata when it didn't exist remotely.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@226512 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d82808fe0c
commit
8cb9563692
|
@ -84,6 +84,8 @@ public abstract class AbstractVersionTransformation
|
|||
|
||||
if ( checkForUpdates )
|
||||
{
|
||||
checkedUpdates = true;
|
||||
|
||||
getLogger().info(
|
||||
artifact.getArtifactId() + ": checking for updates from " + repository.getId() );
|
||||
|
||||
|
@ -93,10 +95,6 @@ public abstract class AbstractVersionTransformation
|
|||
{
|
||||
remoteMetadata = retrieveFromRemoteRepository( artifact, repository, localMetadata,
|
||||
policy.getChecksumPolicy() );
|
||||
|
||||
// we must only flag this after checking for updates, otherwise subsequent attempts will look
|
||||
// for SNAPSHOT without checking the metadata
|
||||
checkedUpdates = true;
|
||||
}
|
||||
catch ( ResourceDoesNotExistException e )
|
||||
{
|
||||
|
@ -117,7 +115,9 @@ public abstract class AbstractVersionTransformation
|
|||
}
|
||||
}
|
||||
|
||||
if ( checkedUpdates )
|
||||
// touch the file if it was checked for updates, but don't create it if it doesn't exist to avoid
|
||||
// storing SNAPSHOT as the actual version which doesn't exist remotely.
|
||||
if ( checkedUpdates && localMetadata.exists() )
|
||||
{
|
||||
localMetadata.storeInLocalRepository( localRepository );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue