fix problem on first run when no RELEASE data

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@220066 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-07-21 13:39:32 +00:00
parent 1ed6afa2b2
commit 884a29b92d
1 changed files with 15 additions and 11 deletions

View File

@ -108,18 +108,22 @@ public abstract class AbstractVersionArtifactMetadata
public void storeInLocalRepository( ArtifactRepository localRepository )
throws ArtifactMetadataRetrievalException
{
try
String version = constructVersion();
if ( version != null )
{
String path = getLocalRepositoryLocation( localRepository ).getPath();
File file = new File( path );
// TODO: this should be centralised before the resolution of the artifact
file.getParentFile().mkdirs();
FileUtils.fileWrite( path, constructVersion() );
lastModified = file.lastModified();
}
catch ( IOException e )
{
throw new ArtifactMetadataRetrievalException( "Unable to retrieve metadata", e );
try
{
String path = getLocalRepositoryLocation( localRepository ).getPath();
File file = new File( path );
// TODO: this should be centralised before the resolution of the artifact
file.getParentFile().mkdirs();
FileUtils.fileWrite( path, version );
lastModified = file.lastModified();
}
catch ( IOException e )
{
throw new ArtifactMetadataRetrievalException( "Unable to retrieve metadata", e );
}
}
}
}