]> source.dussan.org Git - archiva.git/commitdiff
extract our own repository connector factory to an external file
authorOlivier Lamy <olamy@apache.org>
Thu, 2 Aug 2012 16:23:18 +0000 (16:23 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 2 Aug 2012 16:23:18 +0000 (16:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1368581 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/plugins/maven2-repository/pom.xml
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java

index 4a10197cacdd1c6a92489ebb457af1b3c2e11bb3..5b6337ff0a304870b280fb4631828bb883c76cd2 100644 (file)
               org.dom4j*;version="[1.6,2)",
               org.springframework*;version="[3,4)",
               org.slf4j;resolution:=optional,
-              org.apache.maven,
-              org.apache.maven.project,
+              org.apache.maven.repository.internal,
+              org.sonatype.aether.connector.file,
+              org.sonatype.aether.impl,
+              org.sonatype.aether.spi.connector,
+              org.sonatype.aether.transfer,
               org.sonatype.aether,
               org.sonatype.aether.artifact,
               org.sonatype.aether.collection,
               org.sonatype.aether.graph,
               org.sonatype.aether.impl.internal,
               org.sonatype.aether.repository,
-              org.sonatype.aether.resolution,
               org.sonatype.aether.util,
-              org.sonatype.aether.util.artifact,
-              org.sonatype.aether.version
+              org.sonatype.aether.util.artifact
             </Import-Package>
           </instructions>
         </configuration>
index 04ec059998267c5640dd03733c023680132289b8..af9877e9cfd9bb3f55330f0815c6ed8523f6cdb7 100644 (file)
@@ -47,7 +47,6 @@ import org.sonatype.aether.RepositorySystemSession;
 import org.sonatype.aether.collection.CollectRequest;
 import org.sonatype.aether.collection.CollectResult;
 import org.sonatype.aether.collection.DependencyCollectionException;
-import org.sonatype.aether.connector.file.FileRepositoryConnectorFactory;
 import org.sonatype.aether.graph.Dependency;
 import org.sonatype.aether.graph.DependencyVisitor;
 import org.sonatype.aether.impl.ArtifactDescriptorReader;
@@ -55,13 +54,7 @@ import org.sonatype.aether.impl.VersionRangeResolver;
 import org.sonatype.aether.impl.VersionResolver;
 import org.sonatype.aether.impl.internal.DefaultServiceLocator;
 import org.sonatype.aether.repository.LocalRepository;
-import org.sonatype.aether.spi.connector.ArtifactDownload;
-import org.sonatype.aether.spi.connector.ArtifactUpload;
-import org.sonatype.aether.spi.connector.MetadataDownload;
-import org.sonatype.aether.spi.connector.MetadataUpload;
-import org.sonatype.aether.spi.connector.RepositoryConnector;
 import org.sonatype.aether.spi.connector.RepositoryConnectorFactory;
-import org.sonatype.aether.transfer.NoRepositoryConnectorException;
 import org.sonatype.aether.util.artifact.DefaultArtifact;
 import org.springframework.stereotype.Service;
 
@@ -70,7 +63,6 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import java.io.File;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -206,59 +198,11 @@ public class Maven3DependencyTreeBuilder
 
     }
 
-    public static class MyFileRepositoryConnectorFactory
-        extends FileRepositoryConnectorFactory
-    {
-
-        public MyFileRepositoryConnectorFactory()
-        {
-
-        }
-
-        public RepositoryConnector newInstance( RepositorySystemSession session,
-                                                org.sonatype.aether.repository.RemoteRepository repository )
-            throws NoRepositoryConnectorException
-        {
-
-            try
-            {
-                return super.newInstance( session, repository );
-            }
-            catch ( NoRepositoryConnectorException e )
-            {
-
-            }
-
-            return new RepositoryConnector()
-            {
-
-                private Logger log = LoggerFactory.getLogger( getClass() );
-
-                public void get( Collection<? extends ArtifactDownload> artifactDownloads,
-                                 Collection<? extends MetadataDownload> metadataDownloads )
-                {
-                    log.debug( "get" );
-                }
-
-                public void put( Collection<? extends ArtifactUpload> artifactUploads,
-                                 Collection<? extends MetadataUpload> metadataUploads )
-                {
-                    log.debug( "put" );
-                }
-
-                public void close()
-                {
-                    log.debug( "close" );
-                }
-            };
-        }
-    }
-
     public static RepositorySystem newRepositorySystem()
     {
         DefaultServiceLocator locator = new DefaultServiceLocator();
         locator.addService( RepositoryConnectorFactory.class,
-                            MyFileRepositoryConnectorFactory.class );// FileRepositoryConnectorFactory.class );
+                            ArchivaRepositoryConnectorFactory.class );// FileRepositoryConnectorFactory.class );
         locator.addService( VersionResolver.class, DefaultVersionResolver.class );
         locator.addService( VersionRangeResolver.class, DefaultVersionRangeResolver.class );
         locator.addService( ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class );