From dd7fd7ad53bf8ca3ec02b20aa7ecd8778c86e9f9 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Sun, 2 Feb 2020 17:23:20 +0100 Subject: [PATCH] Removing wagon dependency --- .../archiva-repository-admin-default/pom.xml | 23 --------- .../admin/DefaultArchivaAdministration.java | 47 +------------------ 2 files changed, 1 insertion(+), 69 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml index a4b583e01..a13d875a4 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml @@ -150,33 +150,10 @@ org.apache.commons commons-collections4 - - - org.apache.maven.wagon - wagon-provider-api - - - org.apache.maven.wagon - wagon-http-shared - org.modelmapper modelmapper - - org.apache.maven.wagon - wagon-http - - - org.apache.maven.wagon - wagon-http-lightweight - provided - - - org.apache.httpcomponents - httpclient - - diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java index 87216b473..dec2caa86 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java @@ -29,13 +29,9 @@ import org.apache.archiva.configuration.WebappConfiguration; import org.apache.archiva.metadata.model.facets.AuditEvent; import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.apache.maven.wagon.providers.http.HttpWagon; import org.springframework.stereotype.Service; import org.springframework.util.ResourceUtils; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; @@ -51,26 +47,6 @@ public class DefaultArchivaAdministration implements ArchivaAdministration { - private PoolingHttpClientConnectionManager poolingClientConnectionManager; - - @PostConstruct - public void initialize() - throws RepositoryAdminException - { - // setup wagon on start with initial values - NetworkConfiguration networkConfiguration = getNetworkConfiguration(); - setupWagon( networkConfiguration ); - } - - @PreDestroy - public void shutdown() - { - if ( this.poolingClientConnectionManager != null ) - { - this.poolingClientConnectionManager.shutdown(); - } - } - @Override public List getLegacyArtifactPaths() @@ -430,31 +406,10 @@ public class DefaultArchivaAdministration configuration.setNetworkConfiguration( getModelMapper().map( networkConfiguration, org.apache.archiva.configuration.NetworkConfiguration.class ) ); } - setupWagon( networkConfiguration ); + // setupWagon( networkConfiguration ); saveConfiguration( configuration ); } - protected void setupWagon( NetworkConfiguration networkConfiguration ) - { - if ( networkConfiguration == null ) - { - // back to default values - HttpWagon.setPersistentPool( true ); - poolingClientConnectionManager = new PoolingHttpClientConnectionManager(); - poolingClientConnectionManager.setDefaultMaxPerRoute( 30 ); - poolingClientConnectionManager.setMaxTotal( 30 ); - HttpWagon.setPoolingHttpClientConnectionManager( poolingClientConnectionManager ); - - } - else - { - HttpWagon.setPersistentPool( networkConfiguration.isUsePooling() ); - poolingClientConnectionManager = new PoolingHttpClientConnectionManager(); - poolingClientConnectionManager.setDefaultMaxPerRoute( networkConfiguration.getMaxTotalPerHost() ); - poolingClientConnectionManager.setMaxTotal( networkConfiguration.getMaxTotal() ); - HttpWagon.setPoolingHttpClientConnectionManager( poolingClientConnectionManager ); - } - } //------------------------- // -- 2.39.5