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 ) ) {