diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-09-12 13:10:22 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-09-22 00:09:54 +0200 |
commit | d9d87966655ca4a82e9be780caf3f70b2bcdc853 (patch) | |
tree | cabb8a777c32d895ffcd8da238fbefced875ce91 /archiva-modules/archiva-maven | |
parent | 9948797e50b4af71913bdbf0dec7810b2f676fd7 (diff) | |
download | archiva-d9d87966655ca4a82e9be780caf3f70b2bcdc853.tar.gz archiva-d9d87966655ca4a82e9be780caf3f70b2bcdc853.zip |
Fixing proxy connector handling
Diffstat (limited to 'archiva-modules/archiva-maven')
4 files changed, 12 insertions, 2 deletions
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 b35967f3e..dd7448766 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 @@ -219,6 +219,8 @@ public class HttpProxyTransferTest // Configure Connector (usually done within archiva.xml configuration) addConnector(); + managedDefaultRepository = repositoryRegistry.getManagedRepository(MANAGED_ID).getContent(); + Path expectedFile = Paths.get( managedDefaultRepository.getRepoRoot() ).resolve( path ); Files.deleteIfExists( expectedFile ); ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/ArchivaRepositoryConnectorFactory.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/ArchivaRepositoryConnectorFactory.java index dd401aef4..f099292f9 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/ArchivaRepositoryConnectorFactory.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/ArchivaRepositoryConnectorFactory.java @@ -19,6 +19,7 @@ package org.apache.archiva.dependency.tree.maven2; */ import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory; +import org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider; import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,6 +50,7 @@ public class ArchivaRepositoryConnectorFactory public ArchivaRepositoryConnectorFactory() { // no op but empty constructor needed by aether + delegate.setRepositoryLayoutProvider(new DefaultRepositoryLayoutProvider()); } @Override diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven2/MavenRepositoryProvider.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven2/MavenRepositoryProvider.java index cdc03db86..15dbf6ad6 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven2/MavenRepositoryProvider.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven2/MavenRepositoryProvider.java @@ -22,6 +22,8 @@ package org.apache.archiva.repository.maven2; import org.apache.archiva.common.filelock.FileLockManager; import org.apache.archiva.configuration.*; import org.apache.archiva.repository.*; +import org.apache.archiva.repository.events.Event; +import org.apache.archiva.repository.events.RepositoryValueEvent; import org.apache.archiva.repository.storage.FilesystemStorage; import org.apache.archiva.repository.features.ArtifactCleanupFeature; import org.apache.archiva.repository.features.IndexCreationFeature; @@ -347,7 +349,9 @@ public class MavenRepositoryProvider implements RepositoryProvider { cfg.setPackedIndexDir(convertUriToPath(indexCreationFeature.getPackedIndexPath())); RemoteIndexFeature remoteIndexFeature = remoteRepository.getFeature(RemoteIndexFeature.class).get(); - cfg.setRemoteIndexUrl(remoteIndexFeature.getIndexUri().toString()); + if (remoteIndexFeature.getIndexUri()!=null) { + cfg.setRemoteIndexUrl(remoteIndexFeature.getIndexUri().toString()); + } cfg.setRemoteDownloadTimeout((int) remoteIndexFeature.getDownloadTimeout().get(ChronoUnit.SECONDS)); cfg.setDownloadRemoteIndexOnStartup(remoteIndexFeature.isDownloadRemoteIndexOnStartup()); cfg.setDownloadRemoteIndex(remoteIndexFeature.isDownloadRemoteIndex()); @@ -495,7 +499,7 @@ public class MavenRepositoryProvider implements RepositoryProvider { } @Override - public <T> void raise(RepositoryEvent<T> event) { + public void raise(Event event) { // } diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/dependency/tree/maven2/DependencyTreeBuilderTestMaven3.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/dependency/tree/maven2/DependencyTreeBuilderTestMaven3.java index fb0b802d4..df2f10484 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/dependency/tree/maven2/DependencyTreeBuilderTestMaven3.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/dependency/tree/maven2/DependencyTreeBuilderTestMaven3.java @@ -81,6 +81,8 @@ public class DependencyTreeBuilderTestMaven3 repoConfig.setId( TEST_REPO_ID ); repoConfig.setLocation(Paths.get("target/test-repository").toAbsolutePath().toString() ); configuration.addManagedRepository( repoConfig ); + + config.getConfiguration().getProxyConnectors().clear(); config.save( configuration ); repositoryRegistry.reload(); |