mirror of https://github.com/apache/archiva.git
Modifying NetworkProxy class. Adding tests.
This commit is contained in:
parent
c7fb08d2cb
commit
ebf95723a5
|
@ -49,11 +49,6 @@
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>archiva-model</artifactId>
|
<artifactId>archiva-model</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.archiva</groupId>
|
|
||||||
<artifactId>archiva-repository-layer</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -27,6 +27,12 @@ import org.apache.archiva.repository.RepositoryType;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A proxy registry is central access point for accessing a proxy. It gives access to the proxy handlers
|
||||||
|
* that are registered for the different repository types.
|
||||||
|
*
|
||||||
|
* @author Martin Stockhammer <martin_s@apache.org>
|
||||||
|
*/
|
||||||
public interface ProxyRegistry {
|
public interface ProxyRegistry {
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -20,6 +20,8 @@ package org.apache.archiva.proxy.model;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class NetworkProxy
|
public class NetworkProxy
|
||||||
implements Serializable
|
implements Serializable
|
||||||
|
@ -50,7 +52,7 @@ public class NetworkProxy
|
||||||
/**
|
/**
|
||||||
* The proxy password.
|
* The proxy password.
|
||||||
*/
|
*/
|
||||||
private String password;
|
private char[] password;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 1.4-M3
|
* @since 1.4-M3
|
||||||
|
@ -64,14 +66,14 @@ public class NetworkProxy
|
||||||
// no op
|
// no op
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkProxy( String id, String protocol, String host, int port, String username, String password )
|
public NetworkProxy(String id, String protocol, String host, int port, String username, char[] password )
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.protocol = protocol;
|
this.protocol = protocol;
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.password = password;
|
setPassword(password);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
|
@ -124,14 +126,17 @@ public class NetworkProxy
|
||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPassword()
|
public char[] getPassword()
|
||||||
{
|
{
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPassword( String password )
|
public void setPassword(char[] password )
|
||||||
{
|
{
|
||||||
this.password = password;
|
if (this.password!=null) {
|
||||||
|
Arrays.fill(this.password, '0');
|
||||||
|
}
|
||||||
|
this.password = Arrays.copyOf(password, password.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUseNtlm()
|
public boolean isUseNtlm()
|
||||||
|
@ -158,12 +163,7 @@ public class NetworkProxy
|
||||||
|
|
||||||
NetworkProxy that = (NetworkProxy) o;
|
NetworkProxy that = (NetworkProxy) o;
|
||||||
|
|
||||||
if ( id != null ? !id.equals( that.id ) : that.id != null )
|
return Objects.equals(id, that.id);
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,174 @@
|
||||||
|
package org.apache.archiva.proxy.model;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
public class NetworkProxyTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getId() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
assertNull(proxy.getId());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
assertEquals("test-proxy", proxy.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setId() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
proxy.setId("test-proxy1");
|
||||||
|
assertEquals("test-proxy1",proxy.getId());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
proxy.setId("test-proxy2");
|
||||||
|
assertEquals("test-proxy2", proxy.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getProtocol() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
assertEquals("http", proxy.getProtocol());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "https", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
assertEquals("https", proxy.getProtocol());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setProtocol() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
proxy.setProtocol("https");
|
||||||
|
assertEquals("https", proxy.getProtocol());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "https", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
proxy.setProtocol("http");
|
||||||
|
assertEquals("http", proxy.getProtocol());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getHost() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
assertNull(proxy.getHost());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
assertEquals("test.apache.org", proxy.getHost());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setHost() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
proxy.setHost("test1.apache.org");
|
||||||
|
assertEquals("test1.apache.org",proxy.getHost());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
proxy.setHost("test2.apache.org");
|
||||||
|
assertEquals("test2.apache.org", proxy.getHost());
|
||||||
|
proxy.setHost("test3.apache.org");
|
||||||
|
assertEquals("test3.apache.org", proxy.getHost());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getPort() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
assertEquals(8080,proxy.getPort());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
assertEquals(80, proxy.getPort());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setPort() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
proxy.setPort(8090);
|
||||||
|
assertEquals(8090,proxy.getPort());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
proxy.setPort(9090);
|
||||||
|
assertEquals(9090, proxy.getPort());
|
||||||
|
proxy.setPort(9091);
|
||||||
|
assertEquals(9091, proxy.getPort());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getUsername() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
assertNull(proxy.getUsername());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
assertEquals("testuser", proxy.getUsername());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setUsername() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
proxy.setUsername("testuser1");
|
||||||
|
assertEquals("testuser1",proxy.getUsername());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
proxy.setUsername("testuser2");
|
||||||
|
assertEquals("testuser2", proxy.getUsername());
|
||||||
|
proxy.setUsername("testuser3");
|
||||||
|
assertEquals("testuser3", proxy.getUsername());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getPassword() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
assertNull(proxy.getPassword());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
assertEquals("xxxx", new String(proxy.getPassword()));
|
||||||
|
char[] testPwd = {'a', 'b', 'c', 'd'};
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", testPwd);
|
||||||
|
assertEquals("abcd", new String(proxy.getPassword()));
|
||||||
|
testPwd[0]='0';
|
||||||
|
assertEquals("abcd", new String(proxy.getPassword()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setPassword() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
assertNull(proxy.getPassword());
|
||||||
|
proxy.setPassword("ucdx".toCharArray());
|
||||||
|
assertEquals("ucdx", new String(proxy.getPassword()));
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
assertEquals("xxxx", new String(proxy.getPassword()));
|
||||||
|
char[] testPwd = {'a', 'b', 'c', 'd'};
|
||||||
|
proxy.setPassword(testPwd);
|
||||||
|
assertEquals("abcd", new String(proxy.getPassword()));
|
||||||
|
testPwd[0]='0';
|
||||||
|
assertEquals("abcd", new String(proxy.getPassword()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void isUseNtlm() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
assertFalse(proxy.isUseNtlm());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
assertFalse(proxy.isUseNtlm());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setUseNtlm() {
|
||||||
|
NetworkProxy proxy = new NetworkProxy();
|
||||||
|
assertFalse(proxy.isUseNtlm());
|
||||||
|
proxy.setUseNtlm(true);
|
||||||
|
assertTrue(proxy.isUseNtlm());
|
||||||
|
proxy = new NetworkProxy("test-proxy", "http", "test.apache.org", 80, "testuser", "xxxx".toCharArray());
|
||||||
|
assertFalse(proxy.isUseNtlm());
|
||||||
|
proxy.setUseNtlm(true);
|
||||||
|
assertTrue(proxy.isUseNtlm());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -59,10 +59,6 @@
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>archiva-filelock</artifactId>
|
<artifactId>archiva-filelock</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.archiva</groupId>
|
|
||||||
<artifactId>archiva-repository-scanner</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>archiva-scheduler-repository-api</artifactId>
|
<artifactId>archiva-scheduler-repository-api</artifactId>
|
||||||
|
|
|
@ -36,10 +36,15 @@ import javax.inject.Inject;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default proxy registry implementation. Uses the archiva configuration for accessing and storing the
|
||||||
|
* proxy information.
|
||||||
|
*
|
||||||
|
*/
|
||||||
@Service("proxyRegistry#default")
|
@Service("proxyRegistry#default")
|
||||||
public class ArchivaProxyRegistry implements ProxyRegistry, ConfigurationListener {
|
public class ArchivaProxyRegistry implements ProxyRegistry, ConfigurationListener {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(ArchivaProxyRegistry.class);
|
private static final Logger log = LoggerFactory.getLogger(ArchivaProxyRegistry.class);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ArchivaConfiguration archivaConfiguration;
|
ArchivaConfiguration archivaConfiguration;
|
||||||
|
@ -83,7 +88,7 @@ public class ArchivaProxyRegistry implements ProxyRegistry, ConfigurationListene
|
||||||
proxy.setHost(networkProxyConfig.getHost());
|
proxy.setHost(networkProxyConfig.getHost());
|
||||||
proxy.setPort(networkProxyConfig.getPort());
|
proxy.setPort(networkProxyConfig.getPort());
|
||||||
proxy.setUsername(networkProxyConfig.getUsername());
|
proxy.setUsername(networkProxyConfig.getUsername());
|
||||||
proxy.setPassword(networkProxyConfig.getPassword());
|
proxy.setPassword(networkProxyConfig.getPassword().toCharArray());
|
||||||
proxy.setUseNtlm(networkProxyConfig.isUseNtlm());
|
proxy.setUseNtlm(networkProxyConfig.isUseNtlm());
|
||||||
|
|
||||||
this.networkProxyMap.put(key, proxy);
|
this.networkProxyMap.put(key, proxy);
|
||||||
|
|
|
@ -237,7 +237,7 @@ public abstract class DefaultRepositoryProxyHandler implements RepositoryProxyHa
|
||||||
np.setId(p.getId());
|
np.setId(p.getId());
|
||||||
np.setUseNtlm(p.isUseNtlm());
|
np.setUseNtlm(p.isUseNtlm());
|
||||||
np.setUsername(p.getUsername());
|
np.setUsername(p.getUsername());
|
||||||
np.setPassword(p.getPassword());
|
np.setPassword(p.getPassword() == null ? new char[0] : p.getPassword().toCharArray());
|
||||||
np.setProtocol(p.getProtocol());
|
np.setProtocol(p.getProtocol());
|
||||||
np.setHost(p.getHost());
|
np.setHost(p.getHost());
|
||||||
np.setPort(p.getPort());
|
np.setPort(p.getPort());
|
||||||
|
|
|
@ -316,7 +316,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager {
|
||||||
proxyInfo.setHost( networkProxy.getHost( ) );
|
proxyInfo.setHost( networkProxy.getHost( ) );
|
||||||
proxyInfo.setPort( networkProxy.getPort( ) );
|
proxyInfo.setPort( networkProxy.getPort( ) );
|
||||||
proxyInfo.setUserName( networkProxy.getUsername( ) );
|
proxyInfo.setUserName( networkProxy.getUsername( ) );
|
||||||
proxyInfo.setPassword( networkProxy.getPassword( ) );
|
proxyInfo.setPassword(new String(networkProxy.getPassword()));
|
||||||
}
|
}
|
||||||
AuthenticationInfo authenticationInfo = null;
|
AuthenticationInfo authenticationInfo = null;
|
||||||
if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials) )
|
if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials) )
|
||||||
|
|
|
@ -330,7 +330,7 @@ public class MavenIndexManager implements ArchivaIndexManager {
|
||||||
proxyInfo.setHost( networkProxy.getHost( ) );
|
proxyInfo.setHost( networkProxy.getHost( ) );
|
||||||
proxyInfo.setPort( networkProxy.getPort( ) );
|
proxyInfo.setPort( networkProxy.getPort( ) );
|
||||||
proxyInfo.setUserName( networkProxy.getUsername( ) );
|
proxyInfo.setUserName( networkProxy.getUsername( ) );
|
||||||
proxyInfo.setPassword( networkProxy.getPassword( ) );
|
proxyInfo.setPassword( new String(networkProxy.getPassword( )) );
|
||||||
}
|
}
|
||||||
AuthenticationInfo authenticationInfo = null;
|
AuthenticationInfo authenticationInfo = null;
|
||||||
if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials ) )
|
if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials ) )
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class MavenRepositoryProxyHandler extends DefaultRepositoryProxyHandler {
|
||||||
proxy.setHost(networkProxyDef.getHost());
|
proxy.setHost(networkProxyDef.getHost());
|
||||||
proxy.setPort(networkProxyDef.getPort());
|
proxy.setPort(networkProxyDef.getPort());
|
||||||
proxy.setUserName(networkProxyDef.getUsername());
|
proxy.setUserName(networkProxyDef.getUsername());
|
||||||
proxy.setPassword(networkProxyDef.getPassword());
|
proxy.setPassword(new String(networkProxyDef.getPassword()));
|
||||||
|
|
||||||
this.networkProxyMap.put(key, proxy);
|
this.networkProxyMap.put(key, proxy);
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,9 @@ public class HttpProxyTransferTest
|
||||||
public void tearDown()
|
public void tearDown()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
server.stop();
|
if (server!=null) {
|
||||||
|
server.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -19,12 +19,7 @@ package org.apache.archiva.proxy;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.archiva.configuration.ArchivaConfiguration;
|
import org.apache.archiva.configuration.*;
|
||||||
import org.apache.archiva.configuration.Configuration;
|
|
||||||
import org.apache.archiva.configuration.ConfigurationListener;
|
|
||||||
import org.apache.archiva.configuration.FileType;
|
|
||||||
import org.apache.archiva.configuration.FileTypes;
|
|
||||||
import org.apache.archiva.configuration.RepositoryScanningConfiguration;
|
|
||||||
import org.apache.archiva.redback.components.registry.Registry;
|
import org.apache.archiva.redback.components.registry.Registry;
|
||||||
import org.apache.archiva.redback.components.registry.RegistryException;
|
import org.apache.archiva.redback.components.registry.RegistryException;
|
||||||
import org.apache.archiva.redback.components.registry.RegistryListener;
|
import org.apache.archiva.redback.components.registry.RegistryListener;
|
||||||
|
@ -36,11 +31,7 @@ import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MockConfiguration
|
* MockConfiguration
|
||||||
|
@ -84,6 +75,14 @@ public class MockConfiguration
|
||||||
return Collections.singletonList( fileType );
|
return Collections.singletonList( fileType );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
ArchivaRuntimeConfiguration rt = new ArchivaRuntimeConfiguration();
|
||||||
|
List<String> checksums = new ArrayList<>();
|
||||||
|
checksums.add("MD5");
|
||||||
|
checksums.add("SHA1");
|
||||||
|
checksums.add("SHA256");
|
||||||
|
rt.setChecksumTypes(checksums);
|
||||||
|
configuration.setArchivaRuntimeConfiguration(rt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -427,7 +427,7 @@ public class RepositoryModelResolver
|
||||||
networkProxy.setHost( proxyConnector.getHost() );
|
networkProxy.setHost( proxyConnector.getHost() );
|
||||||
networkProxy.setPort( proxyConnector.getPort() );
|
networkProxy.setPort( proxyConnector.getPort() );
|
||||||
networkProxy.setUserName( proxyConnector.getUsername() );
|
networkProxy.setUserName( proxyConnector.getUsername() );
|
||||||
networkProxy.setPassword( proxyConnector.getPassword() );
|
networkProxy.setPassword( new String(proxyConnector.getPassword()) );
|
||||||
|
|
||||||
String msg = "Using network proxy " + networkProxy.getHost() + ":" + networkProxy.getPort()
|
String msg = "Using network proxy " + networkProxy.getHost() + ":" + networkProxy.getPort()
|
||||||
+ " to connect to remote repository " + remoteRepository.getLocation();
|
+ " to connect to remote repository " + remoteRepository.getLocation();
|
||||||
|
|
|
@ -317,7 +317,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager {
|
||||||
proxyInfo.setHost( networkProxy.getHost( ) );
|
proxyInfo.setHost( networkProxy.getHost( ) );
|
||||||
proxyInfo.setPort( networkProxy.getPort( ) );
|
proxyInfo.setPort( networkProxy.getPort( ) );
|
||||||
proxyInfo.setUserName( networkProxy.getUsername( ) );
|
proxyInfo.setUserName( networkProxy.getUsername( ) );
|
||||||
proxyInfo.setPassword( networkProxy.getPassword( ) );
|
proxyInfo.setPassword(new String(networkProxy.getPassword()));
|
||||||
}
|
}
|
||||||
AuthenticationInfo authenticationInfo = null;
|
AuthenticationInfo authenticationInfo = null;
|
||||||
if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials) )
|
if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials) )
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class DownloadRemoteIndexTask
|
||||||
proxyInfo.setHost( this.networkProxy.getHost() );
|
proxyInfo.setHost( this.networkProxy.getHost() );
|
||||||
proxyInfo.setPort( this.networkProxy.getPort() );
|
proxyInfo.setPort( this.networkProxy.getPort() );
|
||||||
proxyInfo.setUserName( this.networkProxy.getUsername() );
|
proxyInfo.setUserName( this.networkProxy.getUsername() );
|
||||||
proxyInfo.setPassword( this.networkProxy.getPassword() );
|
proxyInfo.setPassword( new String(this.networkProxy.getPassword()) );
|
||||||
}
|
}
|
||||||
AuthenticationInfo authenticationInfo = null;
|
AuthenticationInfo authenticationInfo = null;
|
||||||
if ( this.remoteRepository.getLoginCredentials()!=null && this.remoteRepository.getLoginCredentials() instanceof PasswordCredentials )
|
if ( this.remoteRepository.getLoginCredentials()!=null && this.remoteRepository.getLoginCredentials() instanceof PasswordCredentials )
|
||||||
|
|
|
@ -303,7 +303,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager {
|
||||||
proxyInfo.setHost( networkProxy.getHost( ) );
|
proxyInfo.setHost( networkProxy.getHost( ) );
|
||||||
proxyInfo.setPort( networkProxy.getPort( ) );
|
proxyInfo.setPort( networkProxy.getPort( ) );
|
||||||
proxyInfo.setUserName( networkProxy.getUsername( ) );
|
proxyInfo.setUserName( networkProxy.getUsername( ) );
|
||||||
proxyInfo.setPassword( networkProxy.getPassword( ) );
|
proxyInfo.setPassword(new String(networkProxy.getPassword()));
|
||||||
}
|
}
|
||||||
AuthenticationInfo authenticationInfo = null;
|
AuthenticationInfo authenticationInfo = null;
|
||||||
if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials) )
|
if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials) )
|
||||||
|
|
|
@ -167,7 +167,7 @@ public class DefaultRemoteRepositoriesService
|
||||||
proxyInfo.setHost(networkProxy.getHost());
|
proxyInfo.setHost(networkProxy.getHost());
|
||||||
proxyInfo.setPort(networkProxy.getPort());
|
proxyInfo.setPort(networkProxy.getPort());
|
||||||
proxyInfo.setUserName(networkProxy.getUsername());
|
proxyInfo.setUserName(networkProxy.getUsername());
|
||||||
proxyInfo.setPassword(networkProxy.getPassword());
|
proxyInfo.setPassword(new String(networkProxy.getPassword()));
|
||||||
}
|
}
|
||||||
String url = StringUtils.stripEnd(remoteRepository.getUrl(), "/");
|
String url = StringUtils.stripEnd(remoteRepository.getUrl(), "/");
|
||||||
wagon.connect(new Repository(remoteRepository.getId(), url), proxyInfo);
|
wagon.connect(new Repository(remoteRepository.getId(), url), proxyInfo);
|
||||||
|
|
5
pom.xml
5
pom.xml
|
@ -68,18 +68,21 @@
|
||||||
<redback.spring-utils.version>2.1</redback.spring-utils.version>
|
<redback.spring-utils.version>2.1</redback.spring-utils.version>
|
||||||
<redback.taskqueue.version>2.1</redback.taskqueue.version>
|
<redback.taskqueue.version>2.1</redback.taskqueue.version>
|
||||||
|
|
||||||
|
<!-- dependencies of maven modules -->
|
||||||
<jsoup.version>1.12.1</jsoup.version>
|
<jsoup.version>1.12.1</jsoup.version>
|
||||||
<rome.version>0.9</rome.version>
|
<rome.version>0.9</rome.version>
|
||||||
<cronutils.version>9.0.1</cronutils.version>
|
<cronutils.version>9.0.1</cronutils.version>
|
||||||
|
|
||||||
<spring.version>4.3.10.RELEASE</spring.version>
|
<spring.version>4.3.10.RELEASE</spring.version>
|
||||||
|
|
||||||
<javax.jcr.version>2.0</javax.jcr.version>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
|
<surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
|
||||||
<lucene.version>4.10.4</lucene.version>
|
<lucene.version>4.10.4</lucene.version>
|
||||||
|
|
||||||
|
<!-- JCR modules -->
|
||||||
|
<javax.jcr.version>2.0</javax.jcr.version>
|
||||||
<jcr-oak.version>1.14.0</jcr-oak.version>
|
<jcr-oak.version>1.14.0</jcr-oak.version>
|
||||||
|
<!-- Jackrabbit classes are still used for webdav -->
|
||||||
<jackrabbit.version>2.15.4</jackrabbit.version>
|
<jackrabbit.version>2.15.4</jackrabbit.version>
|
||||||
<metrics-core.version>3.1.0</metrics-core.version>
|
<metrics-core.version>3.1.0</metrics-core.version>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue