mirror of https://github.com/apache/maven.git
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:
parent
1ed6afa2b2
commit
884a29b92d
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue