]> source.dussan.org Git - archiva.git/commitdiff
Removing wagon dependency
authorMartin Stockhammer <martin_s@apache.org>
Sun, 2 Feb 2020 16:23:20 +0000 (17:23 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Sun, 2 Feb 2020 16:23:20 +0000 (17:23 +0100)
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java

index a4b583e010f5f2630b065dd8b2e2227b744c1c2b..a13d875a4cc7e7155a9e82cec3c61767f3217193 100644 (file)
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-collections4</artifactId>
     </dependency>
-
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-provider-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-http-shared</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.modelmapper</groupId>
       <artifactId>modelmapper</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-http</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-http-lightweight</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpclient</artifactId>
-    </dependency>
-
 
 
     <!-- Used by spring configuration -->
index 87216b47303267b50af3ffd99577d0323552f7fc..dec2caa86c55328ba7255cd60455bfe02013098e 100644 (file)
@@ -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<LegacyArtifactPath> 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 );
-        }
-    }
 
     //-------------------------
     //