[MRM-1606] Upgrade to wagon 2.2.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245404 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-02-17 11:36:20 +00:00
parent 53f479e409
commit 63964ffef4
4 changed files with 10 additions and 23 deletions

View File

@ -1109,7 +1109,9 @@ public class DefaultRepositoryProxyConnectors
// Convert seconds to milliseconds // Convert seconds to milliseconds
int timeoutInMilliseconds = remoteRepository.getRepository().getTimeout() * 1000; 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 ); wagon.setTimeout( timeoutInMilliseconds );
try try

View File

@ -41,8 +41,6 @@ import org.apache.maven.wagon.events.TransferEvent;
import org.apache.maven.wagon.events.TransferListener; import org.apache.maven.wagon.events.TransferListener;
import org.apache.maven.wagon.proxy.ProxyInfo; import org.apache.maven.wagon.proxy.ProxyInfo;
import org.apache.maven.wagon.repository.Repository; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -51,7 +49,6 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Method;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.Arrays; import java.util.Arrays;
@ -132,7 +129,10 @@ public class DownloadRemoteIndexTask
&& this.networkProxy.isUseNtlm() ) ? "-ntlm" : "" ); && this.networkProxy.isUseNtlm() ) ? "-ntlm" : "" );
final Wagon wagon = wagonFactory.getWagon( wagonProtocol ); 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() ); wagon.addTransferListener( new DownloadListener() );
ProxyInfo proxyInfo = null; 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 public static class DownloadListener
implements TransferListener implements TransferListener

View File

@ -309,8 +309,9 @@ public class RepositoryModelResolver
// Convert seconds to milliseconds // Convert seconds to milliseconds
int timeoutInMilliseconds = remoteRepository.getTimeout() * 1000; int timeoutInMilliseconds = remoteRepository.getTimeout() * 1000;
// FIXME olamy having 2 config values
// Set timeout // Set timeout
wagon.setReadTimeout( timeoutInMilliseconds );
wagon.setTimeout( timeoutInMilliseconds ); wagon.setTimeout( timeoutInMilliseconds );
try try

View File

@ -72,7 +72,7 @@
<maven-dependency-tree.version>1.2</maven-dependency-tree.version> <maven-dependency-tree.version>1.2</maven-dependency-tree.version>
<maven-model-converter.version>2.1</maven-model-converter.version> <maven-model-converter.version>2.1</maven-model-converter.version>
<maven.indexer.version>4.1.2</maven.indexer.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.version>1.5-SNAPSHOT</redback.version>
<redback.cache.version>1.0</redback.cache.version> <redback.cache.version>1.0</redback.cache.version>
<redback.quartz.version>1.0</redback.quartz.version> <redback.quartz.version>1.0</redback.quartz.version>