From 94ab6a40762b05e13851202773b009f37d67b4a4 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Wed, 31 Aug 2005 07:12:52 +0000 Subject: [PATCH] act a bit smarter when the remote repo is timing out/offline git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@264956 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/download/ArtifactDownloader.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/maven-mboot2/src/main/java/download/ArtifactDownloader.java b/maven-mboot2/src/main/java/download/ArtifactDownloader.java index 82fb7e7b09..40e6428d17 100644 --- a/maven-mboot2/src/main/java/download/ArtifactDownloader.java +++ b/maven-mboot2/src/main/java/download/ArtifactDownloader.java @@ -147,6 +147,14 @@ public class ArtifactDownloader { HttpUtils.getFile( metaUrl, file, ignoreErrors, true, proxyHost, proxyPort, proxyUserName, proxyPassword, false ); + } + catch ( IOException e ) + { + log( "WARNING: remote SNAPSHOT version not found, using local: " + e.getMessage() ); + } + + if ( file.exists() ) + { version = FileUtils.fileRead( file ); log( "Resolved version: " + version ); dep.setResolvedVersion( version ); @@ -163,9 +171,9 @@ public class ArtifactDownloader return true; } } - catch ( IOException e ) + else { - log( "WARNING: SNAPSHOT version not found, using default: " + e.getMessage() ); + log( "WARNING: local SNAPSHOT version not found, using default" ); } } if ( !dep.getType().equals( "pom" ) )