diff --git a/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo b/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo index 611adff86..babc602a3 100644 --- a/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo +++ b/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo @@ -334,6 +334,15 @@ The Password for this repository. + + timeout + 1.0.1+ + int + + Timeout in seconds for connections to this repository + + 60 + diff --git a/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java index 5b3d1a515..5f78d7804 100644 --- a/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -21,6 +21,7 @@ package org.apache.maven.archiva.proxy; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ConfigurationNames; @@ -64,6 +65,8 @@ import org.codehaus.plexus.util.SelectorUtils; import java.io.File; import java.io.IOException; +import java.net.URLClassLoader; +import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -829,6 +832,12 @@ public class DefaultRepositoryProxyConnectors getLogger().debug( "No authentication for remote repository needed" ); } + //Convert seconds to milliseconds + int timeoutInMilliseconds = remoteRepository.getRepository().getTimeout() * 1000; + + //Set timeout + wagon.setTimeout(timeoutInMilliseconds); + Repository wagonRepository = new Repository( remoteRepository.getId(), remoteRepository.getURL().toString() ); if ( networkProxy != null ) { diff --git a/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonDelegate.java b/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonDelegate.java index e6a4d6f62..13e673570 100644 --- a/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonDelegate.java +++ b/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonDelegate.java @@ -96,6 +96,16 @@ public class WagonDelegate { return delegate.supportsDirectoryCopy(); } + + public void setTimeout(int val) + { + // ignore + } + + public int getTimeout() + { + return 0; + } public Repository getRepository() { diff --git a/archiva-web/archiva-webapp/pom.xml b/archiva-web/archiva-webapp/pom.xml index 88554fab5..e798ef016 100644 --- a/archiva-web/archiva-webapp/pom.xml +++ b/archiva-web/archiva-webapp/pom.xml @@ -125,7 +125,7 @@ org.apache.maven.wagon - wagon-http-lightweight + wagon-http runtime diff --git a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf index eaaac6237..b59fa8f50 100644 --- a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf +++ b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf @@ -23,5 +23,6 @@ + diff --git a/pom.xml b/pom.xml index 22a5018b4..7fb991a99 100644 --- a/pom.xml +++ b/pom.xml @@ -436,6 +436,12 @@ org.apache.maven.shared maven-app-configuration-web 1.0 + + + org.apache.maven.wagon + wagon-http-lightweight + + org.apache.maven.shared @@ -671,7 +677,7 @@ org.apache.maven.wagon - wagon-http-lightweight + wagon-http ${wagon.version} @@ -873,7 +879,7 @@ 2.0.5 - 1.0-beta-2 + 1.0-rc1-SNAPSHOT 1.0-alpha-4