use local copy in bootstrap

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@280239 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-09-12 02:16:58 +00:00
parent 6d41274595
commit d4df5302fb
2 changed files with 11 additions and 3 deletions

View File

@ -171,7 +171,8 @@ public class ArtifactDownloader
{ {
log( "Using metadata: " + file ); log( "Using metadata: " + file );
RepositoryMetadata metadata = RepositoryMetadata.read( file ); RepositoryMetadata metadata;
metadata = RepositoryMetadata.read( file );
if ( version.equals( metadata.getVersion() ) ) if ( version.equals( metadata.getVersion() ) )
{ {

View File

@ -167,7 +167,7 @@ public class RepositoryMetadata
public String constructVersion( String baseVersion ) public String constructVersion( String baseVersion )
{ {
if ( snapshotTimestamp != null ) if ( snapshotTimestamp != null && !localCopy )
{ {
baseVersion = StringUtils.replace( baseVersion, "SNAPSHOT", snapshotTimestamp + "-" + snapshotBuildNumber ); baseVersion = StringUtils.replace( baseVersion, "SNAPSHOT", snapshotTimestamp + "-" + snapshotBuildNumber );
} }
@ -200,7 +200,14 @@ public class RepositoryMetadata
{ {
if ( "buildNumber".equals( rawName ) ) if ( "buildNumber".equals( rawName ) )
{ {
metadata.setSnapshotBuildNumber( Integer.valueOf( getBodyText() ).intValue() ); try
{
metadata.setSnapshotBuildNumber( Integer.valueOf( getBodyText() ).intValue() );
}
catch ( NumberFormatException e )
{
// Ignore
}
} }
else if ( "timestamp".equals( rawName ) ) else if ( "timestamp".equals( rawName ) )
{ {