From d4df5302fb23ec23ca296c7f248135b2f263137c Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Mon, 12 Sep 2005 02:16:58 +0000 Subject: [PATCH] use local copy in bootstrap git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@280239 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/download/ArtifactDownloader.java | 3 ++- .../src/main/java/download/RepositoryMetadata.java | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/maven-mboot2/src/main/java/download/ArtifactDownloader.java b/maven-mboot2/src/main/java/download/ArtifactDownloader.java index 6151985816..eb98fc16ea 100644 --- a/maven-mboot2/src/main/java/download/ArtifactDownloader.java +++ b/maven-mboot2/src/main/java/download/ArtifactDownloader.java @@ -171,7 +171,8 @@ public class ArtifactDownloader { log( "Using metadata: " + file ); - RepositoryMetadata metadata = RepositoryMetadata.read( file ); + RepositoryMetadata metadata; + metadata = RepositoryMetadata.read( file ); if ( version.equals( metadata.getVersion() ) ) { diff --git a/maven-mboot2/src/main/java/download/RepositoryMetadata.java b/maven-mboot2/src/main/java/download/RepositoryMetadata.java index 71c354f7de..4ef634be8d 100644 --- a/maven-mboot2/src/main/java/download/RepositoryMetadata.java +++ b/maven-mboot2/src/main/java/download/RepositoryMetadata.java @@ -167,7 +167,7 @@ public class RepositoryMetadata public String constructVersion( String baseVersion ) { - if ( snapshotTimestamp != null ) + if ( snapshotTimestamp != null && !localCopy ) { baseVersion = StringUtils.replace( baseVersion, "SNAPSHOT", snapshotTimestamp + "-" + snapshotBuildNumber ); } @@ -200,7 +200,14 @@ public class RepositoryMetadata { 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 ) ) {