diff options
Diffstat (limited to 'archiva-modules/archiva-maven')
7 files changed, 18 insertions, 17 deletions
diff --git a/archiva-modules/archiva-maven/archiva-maven-indexer/src/main/java/org/apache/archiva/indexer/maven/MavenIndexManager.java b/archiva-modules/archiva-maven/archiva-maven-indexer/src/main/java/org/apache/archiva/indexer/maven/MavenIndexManager.java index aa5f27eff..73a890008 100644 --- a/archiva-modules/archiva-maven/archiva-maven-indexer/src/main/java/org/apache/archiva/indexer/maven/MavenIndexManager.java +++ b/archiva-modules/archiva-maven/archiva-maven-indexer/src/main/java/org/apache/archiva/indexer/maven/MavenIndexManager.java @@ -330,7 +330,7 @@ public class MavenIndexManager implements ArchivaIndexManager { proxyInfo.setHost( networkProxy.getHost( ) ); proxyInfo.setPort( networkProxy.getPort( ) ); proxyInfo.setUserName( networkProxy.getUsername( ) ); - proxyInfo.setPassword( networkProxy.getPassword( ) ); + proxyInfo.setPassword( new String(networkProxy.getPassword( )) ); } AuthenticationInfo authenticationInfo = null; if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials ) ) diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java index 5066551f1..25dfcb6a0 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java @@ -87,7 +87,7 @@ public class MavenRepositoryProxyHandler extends DefaultRepositoryProxyHandler { proxy.setHost(networkProxyDef.getHost()); proxy.setPort(networkProxyDef.getPort()); proxy.setUserName(networkProxyDef.getUsername()); - proxy.setPassword(networkProxyDef.getPassword()); + proxy.setPassword(new String(networkProxyDef.getPassword())); this.networkProxyMap.put(key, proxy); } diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java index 5b16e8806..98a6f2dcd 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java @@ -190,7 +190,9 @@ public class HttpProxyTransferTest public void tearDown() throws Exception { - server.stop(); + if (server!=null) { + server.stop(); + } } @Test diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/MockConfiguration.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/MockConfiguration.java index b8bc9d305..c686e8df9 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/MockConfiguration.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/MockConfiguration.java @@ -19,12 +19,7 @@ package org.apache.archiva.proxy; * under the License. */ -import org.apache.archiva.configuration.ArchivaConfiguration; -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.configuration.*; import org.apache.archiva.redback.components.registry.Registry; import org.apache.archiva.redback.components.registry.RegistryException; import org.apache.archiva.redback.components.registry.RegistryListener; @@ -36,11 +31,7 @@ import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Set; +import java.util.*; /** * MockConfiguration @@ -84,6 +75,14 @@ public class MockConfiguration 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 diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java index 036e67757..9b1a410b3 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java @@ -427,7 +427,7 @@ public class RepositoryModelResolver networkProxy.setHost( proxyConnector.getHost() ); networkProxy.setPort( proxyConnector.getPort() ); networkProxy.setUserName( proxyConnector.getUsername() ); - networkProxy.setPassword( proxyConnector.getPassword() ); + networkProxy.setPassword( new String(proxyConnector.getPassword()) ); String msg = "Using network proxy " + networkProxy.getHost() + ":" + networkProxy.getPort() + " to connect to remote repository " + remoteRepository.getLocation(); diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/index/mock/ArchivaIndexManagerMock.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/index/mock/ArchivaIndexManagerMock.java index 98d99b256..119f0c0b9 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/index/mock/ArchivaIndexManagerMock.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/index/mock/ArchivaIndexManagerMock.java @@ -317,7 +317,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { proxyInfo.setHost( networkProxy.getHost( ) ); proxyInfo.setPort( networkProxy.getPort( ) ); proxyInfo.setUserName( networkProxy.getUsername( ) ); - proxyInfo.setPassword( networkProxy.getPassword( ) ); + proxyInfo.setPassword(new String(networkProxy.getPassword())); } AuthenticationInfo authenticationInfo = null; if ( remoteRepository.getLoginCredentials( ) != null && ( remoteRepository.getLoginCredentials( ) instanceof PasswordCredentials) ) diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTask.java b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTask.java index c739cd27c..4db9756fc 100644 --- a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTask.java +++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTask.java @@ -165,7 +165,7 @@ public class DownloadRemoteIndexTask proxyInfo.setHost( this.networkProxy.getHost() ); proxyInfo.setPort( this.networkProxy.getPort() ); proxyInfo.setUserName( this.networkProxy.getUsername() ); - proxyInfo.setPassword( this.networkProxy.getPassword() ); + proxyInfo.setPassword( new String(this.networkProxy.getPassword()) ); } AuthenticationInfo authenticationInfo = null; if ( this.remoteRepository.getLoginCredentials()!=null && this.remoteRepository.getLoginCredentials() instanceof PasswordCredentials ) |