diff options
author | Eduardo Souza <eduardomatosouza@gmail.com> | 2015-06-11 20:18:45 -0300 |
---|---|---|
committer | Eduardo Souza <eduardomatosouza@gmail.com> | 2015-06-11 20:18:45 -0300 |
commit | 01f9aad6176656bf6a0bf010c65cd265c87cf62b (patch) | |
tree | f2a2c4798c9eefda745b8ef4886d63d5fffe6db1 | |
parent | 67e9340daa1b40066b267f02b70d1a45f9196efb (diff) | |
download | archiva-01f9aad6176656bf6a0bf010c65cd265c87cf62b.tar.gz archiva-01f9aad6176656bf6a0bf010c65cd265c87cf62b.zip |
[MRM-1861] Proxy behaviour issue migrating from 1.3.x to 2.x
2 files changed, 15 insertions, 2 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java index 6a9a39624..f8fd42a24 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java @@ -156,6 +156,7 @@ public class DownloadRemoteIndexTask if ( this.networkProxy != null ) { proxyInfo = new ProxyInfo(); + proxyInfo.setType( this.networkProxy.getProtocol() ); proxyInfo.setHost( this.networkProxy.getHost() ); proxyInfo.setPort( this.networkProxy.getPort() ); proxyInfo.setUserName( this.networkProxy.getUsername() ); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java index 64b8043c7..c3528eb4b 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java @@ -34,6 +34,7 @@ import org.apache.maven.wagon.Wagon; import org.apache.maven.wagon.providers.http.AbstractHttpClientWagon; import org.apache.maven.wagon.providers.http.HttpConfiguration; import org.apache.maven.wagon.providers.http.HttpMethodConfiguration; +import org.apache.maven.wagon.proxy.ProxyInfo; import org.apache.maven.wagon.repository.Repository; import org.springframework.stereotype.Service; @@ -182,8 +183,19 @@ public class DefaultRemoteRepositoriesService HttpConfiguration httpConfiguration = new HttpConfiguration().setGet( httpMethodConfiguration ); AbstractHttpClientWagon.class.cast( wagon ).setHttpConfiguration( httpConfiguration ); } - - wagon.connect( new Repository( remoteRepository.getId(), remoteRepository.getUrl() ) ); + + ProxyInfo proxyInfo = null; + if ( networkProxy != null ) + { + proxyInfo = new ProxyInfo(); + proxyInfo.setType( networkProxy.getProtocol() ); + proxyInfo.setHost( networkProxy.getHost() ); + proxyInfo.setPort( networkProxy.getPort() ); + proxyInfo.setUserName( networkProxy.getUsername() ); + proxyInfo.setPassword( networkProxy.getPassword() ); + } + + wagon.connect( new Repository( remoteRepository.getId(), remoteRepository.getUrl() ), proxyInfo ); // we only check connectivity as remote repo can be empty wagon.getFileList( "/" ); |