PR: MNG-446

snapshot file should always be written on install of a snapshot


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@180217 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-06-06 04:39:09 +00:00
parent 1218c92bd4
commit 3db9b6cd55

View File

@ -63,22 +63,10 @@ public void transformForInstall( Artifact artifact, ArtifactRepository localRepo
{ {
artifact.setBaseVersion( m.group( 1 ) + "-" + SNAPSHOT_VERSION ); artifact.setBaseVersion( m.group( 1 ) + "-" + SNAPSHOT_VERSION );
} }
try else if ( isSnapshot( artifact ) )
{ {
VersionArtifactMetadata metadata = readFromLocalRepository( artifact, localRepository ); SnapshotArtifactMetadata metadata = new SnapshotArtifactMetadata( artifact );
if ( !metadata.exists() ) metadata.storeInLocalRepository( localRepository );
{
// doesn't exist - create to avoid an old snapshot download later
metadata.storeInLocalRepository( localRepository );
}
}
catch ( ArtifactPathFormatException e )
{
throw new ArtifactMetadataRetrievalException( "Error getting existing metadata", e );
}
catch ( IOException e )
{
throw new ArtifactMetadataRetrievalException( "Error getting existing metadata", e );
} }
} }