You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2005/01/27 13:27:49 UTC

svn commit: r126604 - /maven/maven-1/core/trunk/build-bootstrap.xml /maven/maven-1/core/trunk/src/bootstrap/org/apache/maven/BootstrapTask.java

Author: brett
Date: Thu Jan 27 04:27:48 2005
New Revision: 126604

URL: http://svn.apache.org/viewcvs?view=rev&rev=126604
Log:
use maven.repo.remote for bootstrap
Modified:
   maven/maven-1/core/trunk/build-bootstrap.xml
   maven/maven-1/core/trunk/src/bootstrap/org/apache/maven/BootstrapTask.java

Modified: maven/maven-1/core/trunk/build-bootstrap.xml
Url: http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/build-bootstrap.xml?view=diff&rev=126604&p1=maven/maven-1/core/trunk/build-bootstrap.xml&r1=126603&p2=maven/maven-1/core/trunk/build-bootstrap.xml&r2=126604
==============================================================================
--- maven/maven-1/core/trunk/build-bootstrap.xml	(original)
+++ maven/maven-1/core/trunk/build-bootstrap.xml	Thu Jan 27 04:27:48 2005
@@ -98,7 +98,7 @@
     <mkdir dir="${maven.bootstrap.bin.dir}"/>
     <bootstrap
       projectDescriptor="project.xml"
-      baseUrl="${maven.get.jars.baseUrl}/"
+      baseUrl="${maven.repo.remote}"
       mavenRepoLocal="${maven.repo.local}"
       online="${maven.bootstrap.online}"
       proxyHost="${maven.proxy.host}"

Modified: maven/maven-1/core/trunk/src/bootstrap/org/apache/maven/BootstrapTask.java
Url: http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/src/bootstrap/org/apache/maven/BootstrapTask.java?view=diff&rev=126604&p1=maven/maven-1/core/trunk/src/bootstrap/org/apache/maven/BootstrapTask.java&r1=126603&p2=maven/maven-1/core/trunk/src/bootstrap/org/apache/maven/BootstrapTask.java&r2=126604
==============================================================================
--- maven/maven-1/core/trunk/src/bootstrap/org/apache/maven/BootstrapTask.java	(original)
+++ maven/maven-1/core/trunk/src/bootstrap/org/apache/maven/BootstrapTask.java	Thu Jan 27 04:27:48 2005
@@ -24,6 +24,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.StringTokenizer;
 
 import org.apache.maven.util.HttpUtils;
 import org.apache.maven.util.BootstrapDownloadMeter;
@@ -340,14 +341,26 @@
     public void downloadDependencies()
         throws BuildException
     {
-        for ( Iterator j = getFiles().iterator(); j.hasNext();)
+        List repositoryUrls = new ArrayList();
+        StringTokenizer tok = new StringTokenizer( baseUrl, "," );
+        while ( tok.hasMoreTokens() )
         {
-            try
+            String url = tok.nextToken().trim();
+            if ( !url.endsWith( "/" ) )
             {
-                String file = (String) j.next();
+                url = url + "/";
+            }
+            repositoryUrls.add( url );
+        }
 
-                File destinationFile = new File( mavenRepoLocal, file );
+        for ( Iterator j = getFiles().iterator(); j.hasNext();)
+        {
+            String file = (String) j.next();
 
+            File destinationFile = new File( mavenRepoLocal, file );
+
+            try
+            {
                 // The directory structure for this project may
                 // not exists so create it if missing.
                 File directory = destinationFile.getParentFile();
@@ -364,39 +377,45 @@
                     continue;
                 }
 
-                log( "Downloading dependency: " + baseUrl + file );
+                for ( Iterator i = repositoryUrls.iterator(); i.hasNext(); )
+                {
+                    String currentBaseUrl = (String) i.next();
+
+                    String location = currentBaseUrl + file;
 
-                int numRetries = MAX_RETRIES;
+                    log( "Attempting to download dependency: " + location );
 
-                while ( numRetries >= 0 )
-                {
                     try
                     {
-                        HttpUtils.getFile( baseUrl + file,
-                                           destinationFile,
-                                           ignoreErrors,
-                                           useTimestamp,
-                                           proxyHost,
-                                           proxyPort,
-                                           proxyUserName,
-                                           proxyPassword, loginHost, loginDomain, new BootstrapDownloadMeter() );
-                        break;
+                        HttpUtils.getFile( location,
+                                            destinationFile,
+                                            ignoreErrors,
+                                            useTimestamp,
+                                            proxyHost,
+                                            proxyPort,
+                                            proxyUserName,
+                                            proxyPassword,
+                                            loginHost, 
+                                            loginDomain, 
+                                            new BootstrapDownloadMeter() );
                     }
                     catch ( Exception e )
                     {
-                        numRetries--;
-
-                        continue;
+                        log( "Error: " + e );
                     }
                 }
-                if ( !destinationFile.exists() )
+                if ( destinationFile.exists() )
                 {
-                    throw new Exception( "Failed to download " + baseUrl + file );
+                    break;
                 }
             }
             catch ( Exception e )
             {
                 throw new BuildException( e );
+            }
+            if ( !destinationFile.exists() )
+            {
+                throw new BuildException( "Failed to download" );
             }
         }
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org