]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1606] Upgrade to wagon 2.2.
authorOlivier Lamy <olamy@apache.org>
Fri, 17 Feb 2012 11:36:20 +0000 (11:36 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 17 Feb 2012 11:36:20 +0000 (11:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245404 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
pom.xml

index cbdd6948c2c569eff0105c480e3b8cc55f6eba3b..d0db565f10fedf1849515b2384ff24adea483c4c 100644 (file)
@@ -1109,7 +1109,9 @@ public class DefaultRepositoryProxyConnectors
         // Convert seconds to milliseconds
         int timeoutInMilliseconds = remoteRepository.getRepository().getTimeout() * 1000;
 
-        // Set timeout
+        // Set timeout  read and connect
+        // FIXME olamy having 2 config values
+        wagon.setReadTimeout( timeoutInMilliseconds );
         wagon.setTimeout( timeoutInMilliseconds );
 
         try
index c9553082dfaa3fbfed532a9adc7f9afbf23525a1..b348ab2f42a7fb91270d386e9076a731fb9479cb 100644 (file)
@@ -41,8 +41,6 @@ import org.apache.maven.wagon.events.TransferEvent;
 import org.apache.maven.wagon.events.TransferListener;
 import org.apache.maven.wagon.proxy.ProxyInfo;
 import org.apache.maven.wagon.repository.Repository;
-import org.apache.maven.wagon.shared.http.HttpConfiguration;
-import org.apache.maven.wagon.shared.http.HttpMethodConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -51,7 +49,6 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
-import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Arrays;
@@ -132,7 +129,10 @@ public class DownloadRemoteIndexTask
                     && this.networkProxy.isUseNtlm() ) ? "-ntlm" : "" );
 
             final Wagon wagon = wagonFactory.getWagon( wagonProtocol );
-            setupWagonReadTimeout( wagon );
+            int timeoutInMilliseconds = remoteRepository.getTimeout() * 1000;
+            // FIXME olamy having 2 config values
+            wagon.setReadTimeout( timeoutInMilliseconds );
+            wagon.setTimeout( timeoutInMilliseconds );
 
             wagon.addTransferListener( new DownloadListener() );
             ProxyInfo proxyInfo = null;
@@ -220,22 +220,6 @@ public class DownloadRemoteIndexTask
         }
     }
 
-    private void setupWagonReadTimeout( Wagon wagon )
-    {
-        try
-        {
-            HttpConfiguration httpConfiguration = new HttpConfiguration().setAll(
-                new HttpMethodConfiguration().setReadTimeout( remoteRepository.getRemoteDownloadTimeout() * 1000 ) );
-            Method setHttpConfigurationMethod =
-                wagon.getClass().getMethod( "setHttpConfiguration", HttpConfiguration.class );
-            setHttpConfigurationMethod.invoke( wagon, httpConfiguration );
-        }
-        catch ( Exception e )
-        {
-            log.debug( "unable to set download remote time out for index {}", e.getMessage(), e );
-        }
-    }
-
 
     public static class DownloadListener
         implements TransferListener
index e1057bfb8cc2311154e9dda2223750321a56e24d..2bbde57c117f3d3062022a09711c29ac83d43313 100644 (file)
@@ -309,8 +309,9 @@ public class RepositoryModelResolver
 
         // Convert seconds to milliseconds
         int timeoutInMilliseconds = remoteRepository.getTimeout() * 1000;
-
+        // FIXME olamy having 2 config values
         // Set timeout
+        wagon.setReadTimeout( timeoutInMilliseconds );
         wagon.setTimeout( timeoutInMilliseconds );
 
         try
diff --git a/pom.xml b/pom.xml
index 4cb641398e8ce049e22ba55e2b6e35d2ac3b3fd4..f5091a41a6976d72f3ef787c988950852172e508 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -72,7 +72,7 @@
     <maven-dependency-tree.version>1.2</maven-dependency-tree.version>
     <maven-model-converter.version>2.1</maven-model-converter.version>
     <maven.indexer.version>4.1.2</maven.indexer.version>
-    <wagon.version>2.0</wagon.version>
+    <wagon.version>2.2</wagon.version>
     <redback.version>1.5-SNAPSHOT</redback.version>
     <redback.cache.version>1.0</redback.cache.version>
     <redback.quartz.version>1.0</redback.quartz.version>