mirror of https://github.com/apache/maven.git
handle invalid format file
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163730 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
13f95996f1
commit
a185b72aeb
|
@ -169,14 +169,14 @@ public class SnapshotArtifactMetadata
|
|||
String version = FileUtils.fileRead( file );
|
||||
lastModified = file.lastModified();
|
||||
|
||||
if ( version.indexOf( "SNAPSHOT" ) >= 0 )
|
||||
int index = version.lastIndexOf( "-" );
|
||||
if ( version.indexOf( "SNAPSHOT" ) >= 0 || index < 0 )
|
||||
{
|
||||
timestamp = null;
|
||||
buildNumber = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int index = version.lastIndexOf( "-" );
|
||||
timestamp = version.substring( 0, index );
|
||||
buildNumber = Integer.valueOf( version.substring( index + 1 ) ).intValue();
|
||||
index = timestamp.lastIndexOf( "-" );
|
||||
|
|
Loading…
Reference in New Issue