ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1201255 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/JarResolver.java
Date Sat, 12 Nov 2011 12:40:48 GMT
Author: hibou
Date: Sat Nov 12 12:40:47 2011
New Revision: 1201255

URL: http://svn.apache.org/viewvc?rev=1201255&view=rev
Log:
On download failure, fail and explain why

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/JarResolver.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/JarResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/JarResolver.java?rev=1201255&r1=1201254&r2=1201255&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/JarResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/JarResolver.java Sat Nov 12
12:40:47 2011
@@ -26,6 +26,7 @@ import java.util.jar.JarFile;
 import org.apache.ivy.core.cache.CacheResourceOptions;
 import org.apache.ivy.core.event.EventManager;
 import org.apache.ivy.core.report.ArtifactDownloadReport;
+import org.apache.ivy.core.report.DownloadStatus;
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.plugins.repository.jar.JarRepository;
 import org.apache.ivy.plugins.repository.url.URLRepository;
@@ -90,6 +91,10 @@ public class JarResolver extends Reposit
                     getRepository().removeTransferListener(eventManager);
                 }
             }
+            if (report.getDownloadStatus() == DownloadStatus.FAILED) {
+                throw new RuntimeException("The jar file " + url.toExternalForm()
+                        + " could not be downloaded (" + report.getDownloadDetails() + ")");
+            }
             setJarFile(report.getLocalFile());
         }
     }



Mime
View raw message