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;
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;
&& 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;
}
}
- 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
<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>