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 ) public void storeInLocalRepository( ArtifactRepository localRepository )
throws ArtifactMetadataRetrievalException throws ArtifactMetadataRetrievalException
{ {
try String version = constructVersion();
if ( version != null )
{ {
String path = getLocalRepositoryLocation( localRepository ).getPath(); try
File file = new File( path ); {
// TODO: this should be centralised before the resolution of the artifact String path = getLocalRepositoryLocation( localRepository ).getPath();
file.getParentFile().mkdirs(); File file = new File( path );
FileUtils.fileWrite( path, constructVersion() ); // TODO: this should be centralised before the resolution of the artifact
lastModified = file.lastModified(); file.getParentFile().mkdirs();
} FileUtils.fileWrite( path, version );
catch ( IOException e ) lastModified = file.lastModified();
{ }
throw new ArtifactMetadataRetrievalException( "Unable to retrieve metadata", e ); catch ( IOException e )
{
throw new ArtifactMetadataRetrievalException( "Unable to retrieve metadata", e );
}
} }
} }
} }