]> source.dussan.org Git - archiva.git/commitdiff
add a consumer (not enabled by default) that can generate a dependency tree as XML
authorBrett Porter <brett@apache.org>
Mon, 7 Apr 2008 06:23:47 +0000 (06:23 +0000)
committerBrett Porter <brett@apache.org>
Mon, 7 Apr 2008 06:23:47 +0000 (06:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@645394 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-data/maven-core-2.0-tree.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/org/apache/maven/maven-core/2.0/maven-core-2.0.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/pom.xml
pom.xml

index ad190b22d385f477d8ec899aacfab0277519a2a1..165249f01ca78ad69d7c678054fca316928ed62f 100644 (file)
@@ -26,7 +26,6 @@
 
   <artifactId>archiva-core-consumers</artifactId>
   <name>Archiva Consumers :: Core Consumers</name>
-  <packaging>jar</packaging>
 
   <dependencies>
     <dependency>
index 0fd5ac5429c9b3fc569f8868b635cd522c8d668b..0300e022ab37d2e2662870862d55f3a34ac85355 100644 (file)
@@ -52,7 +52,7 @@ import java.util.Map;
  * @plexus.component 
  *      role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer"
  *      role-hint="repository-purge"
- *      instantiation-strategy="per-lookup
+ *      instantiation-strategy="per-lookup"
  */
 public class RepositoryPurgeConsumer
     extends AbstractMonitoredConsumer
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml
new file mode 100644 (file)
index 0000000..3caf0ae
--- /dev/null
@@ -0,0 +1,28 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.archiva</groupId>
+    <artifactId>archiva-consumers</artifactId>
+    <version>1.1-SNAPSHOT</version>
+  </parent>
+  <artifactId>archiva-dependency-tree-consumer</artifactId>
+  <name>Archiva Consumers :: Dependency Tree Consumer</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-consumer-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-dependency-tree</artifactId>
+      <version>1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-http-lightweight</artifactId>
+      <version>1.0-beta-2</version>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java
new file mode 100644 (file)
index 0000000..2d75376
--- /dev/null
@@ -0,0 +1,278 @@
+package org.apache.archiva.consumers.dependencytree;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
+import org.apache.maven.archiva.consumers.ConsumerException;
+import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.artifact.resolver.ArtifactCollector;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.shared.dependency.tree.DependencyNode;
+import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
+import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
+import org.apache.maven.shared.dependency.tree.filter.AncestorOrSelfDependencyNodeFilter;
+import org.apache.maven.shared.dependency.tree.filter.DependencyNodeFilter;
+import org.apache.maven.shared.dependency.tree.filter.StateDependencyNodeFilter;
+import org.apache.maven.shared.dependency.tree.traversal.BuildingDependencyNodeVisitor;
+import org.apache.maven.shared.dependency.tree.traversal.CollectingDependencyNodeVisitor;
+import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor;
+import org.apache.maven.shared.dependency.tree.traversal.FilteringDependencyNodeVisitor;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.XMLWriter;
+
+/**
+ * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer"
+ *                   role-hint="dependency-tree-generator" instantiation-strategy="per-lookup"
+ */
+public class DependencyTreeGeneratorConsumer
+    extends AbstractMonitoredConsumer
+    implements KnownRepositoryContentConsumer
+{
+    /** @plexus.configuration */
+    private File generatedRepositoryLocation;
+
+    /** @plexus.configuration */
+    private File localRepository;
+
+    /** @plexus.requirement */
+    private DependencyTreeBuilder dependencyTreeBuilder;
+
+    /** @plexus.requirement */
+    private ArtifactFactory artifactFactory;
+
+    /** @plexus.requirement role-hint="maven" */
+    private ArtifactMetadataSource artifactMetadataSource;
+
+    /** @plexus.requirement */
+    private ArtifactCollector artifactCollector;
+
+    /** @plexus.requirement */
+    private MavenProjectBuilder projectBuilder;
+
+    /** @plexus.requirement */
+    private ArtifactRepositoryFactory artifactRepositoryFactory;
+
+    private String repositoryLocation;
+
+    public String getDescription()
+    {
+        return "Generate dependency tree metadata for tracking changes across algorithms";
+    }
+
+    public String getId()
+    {
+        return "dependency-tree-generator";
+    }
+
+    public boolean isPermanent()
+    {
+        return false;
+    }
+
+    public void setGeneratedRepositoryLocation( File generatedRepositoryLocation )
+    {
+        this.generatedRepositoryLocation = generatedRepositoryLocation;
+    }
+
+    public void beginScan( ManagedRepositoryConfiguration repository )
+        throws ConsumerException
+    {
+        repositoryLocation = repository.getLocation();
+
+        if ( generatedRepositoryLocation == null )
+        {
+            generatedRepositoryLocation = new File( repositoryLocation );
+        }
+
+        if ( localRepository == null )
+        {
+            // This is a bit crappy, it would be better to operate entirely within
+            // the base repository, but would need to adjust maven-artifact
+            localRepository = new File( System.getProperty( "user.home" ), ".m2/repository" );
+        }
+    }
+
+    public void completeScan()
+    {
+    }
+
+    public List getExcludes()
+    {
+        return null;
+    }
+
+    public List getIncludes()
+    {
+        return Collections.singletonList( "**/*.pom" );
+    }
+
+    public void processFile( String path )
+        throws ConsumerException
+    {
+        DefaultRepositoryLayout layout = new DefaultRepositoryLayout();
+
+        ArtifactRepository localRepository;
+        MavenProject project;
+        try
+        {
+            localRepository =
+                artifactRepositoryFactory.createArtifactRepository( "local",
+                                                                    this.localRepository.toURL().toExternalForm(),
+                                                                    layout, null, null );
+
+            project = projectBuilder.build( new File( repositoryLocation, path ), localRepository, null, false );
+        }
+        catch ( ProjectBuildingException e )
+        {
+            throw new ConsumerException( e.getMessage(), e );
+        }
+        catch ( MalformedURLException e )
+        {
+            throw new ConsumerException( e.getMessage(), e );
+        }
+
+        DependencyNode rootNode;
+        try
+        {
+            // TODO: do this for different values of new ScopeArtifactFilter( scope )
+            ArtifactFilter artifactFilter = null;
+
+            rootNode =
+                dependencyTreeBuilder.buildDependencyTree( project, localRepository, artifactFactory,
+                                                           artifactMetadataSource, artifactFilter, artifactCollector );
+        }
+        catch ( DependencyTreeBuilderException e )
+        {
+            throw new ConsumerException( e.getMessage(), e );
+        }
+
+        Document document = DocumentHelper.createDocument();
+        DependencyNodeVisitor visitor = new XmlSerializingDependencyNodeVisitor( document );
+
+        // TODO: remove the need for this when the serializer can calculate last nodes from visitor calls only
+        visitor = new BuildingDependencyNodeVisitor( visitor );
+
+        CollectingDependencyNodeVisitor collectingVisitor = new CollectingDependencyNodeVisitor();
+        DependencyNodeVisitor firstPassVisitor =
+            new FilteringDependencyNodeVisitor( collectingVisitor, StateDependencyNodeFilter.INCLUDED );
+        rootNode.accept( firstPassVisitor );
+
+        DependencyNodeFilter secondPassFilter = new AncestorOrSelfDependencyNodeFilter( collectingVisitor.getNodes() );
+        visitor = new FilteringDependencyNodeVisitor( visitor, secondPassFilter );
+
+        rootNode.accept( visitor );
+
+        FileWriter writer = null;
+        try
+        {
+            Artifact artifact =
+                artifactFactory.createProjectArtifact( project.getGroupId(), project.getArtifactId(),
+                                                       project.getVersion() );
+
+            File generatedFile = new File( generatedRepositoryLocation, layout.pathOf( artifact ) + ".xml" );
+            generatedFile.getParentFile().mkdirs();
+            writer = new FileWriter( generatedFile );
+            OutputFormat format = OutputFormat.createPrettyPrint();
+            XMLWriter w = new XMLWriter( writer, format );
+            w.write( document );
+        }
+        catch ( IOException e )
+        {
+            throw new ConsumerException( e.getMessage(), e );
+        }
+        finally
+        {
+            IOUtils.closeQuietly( writer );
+        }
+    }
+
+    private static class XmlSerializingDependencyNodeVisitor
+        implements DependencyNodeVisitor
+    {
+        private Element xmlNode;
+
+        public XmlSerializingDependencyNodeVisitor( Document document )
+        {
+            xmlNode = document.addElement( "tree" );
+        }
+
+        // DependencyNodeVisitor methods ------------------------------------------
+
+        /*
+         * @see org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor#visit(org.apache.maven.shared.dependency.tree.DependencyNode)
+         */
+        public boolean visit( DependencyNode node )
+        {
+            Element dependency = xmlNode.addElement( "dependency" );
+
+            Artifact artifact = node.getArtifact();
+            dependency.addElement( "groupId" ).setText( artifact.getGroupId() );
+            dependency.addElement( "artifactId" ).setText( artifact.getArtifactId() );
+            dependency.addElement( "type" ).setText( artifact.getType() );
+            dependency.addElement( "version" ).setText( artifact.getVersion() );
+            if ( artifact.getScope() != null )
+            {
+                dependency.addElement( "scope" ).setText( artifact.getScope() );
+            }
+
+            xmlNode = dependency.addElement( "dependencies" );
+
+            return true;
+        }
+
+        /*
+         * @see org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor#endVisit(org.apache.maven.shared.dependency.tree.DependencyNode)
+         */
+        public boolean endVisit( DependencyNode node )
+        {
+            Element e = xmlNode.getParent();
+
+            if ( !xmlNode.hasContent() )
+            {
+                e.remove( xmlNode );
+            }
+
+            xmlNode = e.getParent();
+
+            return true;
+        }
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java
new file mode 100644 (file)
index 0000000..9b8bc8a
--- /dev/null
@@ -0,0 +1,79 @@
+package org.apache.archiva.consumers.dependencytree;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.consumers.ConsumerException;
+import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+
+public class DependencyTreeGeneratorConsumerTest
+    extends PlexusInSpringTestCase
+{
+    private DependencyTreeGeneratorConsumer consumer;
+
+    private ManagedRepositoryConfiguration repository;
+
+    private File repositoryLocation;
+
+    private File generatedRepositoryLocation;
+
+    public void setUp()
+        throws Exception
+    {
+        super.setUp();
+        
+        consumer =
+            (DependencyTreeGeneratorConsumer) lookup( KnownRepositoryContentConsumer.class, "dependency-tree-generator" );
+
+        repositoryLocation = getTestFile( "target/test-" + getName() + "/test-repo" );
+        FileUtils.deleteDirectory( repositoryLocation );
+        FileUtils.copyDirectory( getTestFile( "target/test-classes/test-repo" ), repositoryLocation );
+
+        generatedRepositoryLocation = getTestFile( "target/test-" + getName() + "/generated-test-repo" );
+        FileUtils.deleteDirectory( generatedRepositoryLocation );
+
+        consumer.setGeneratedRepositoryLocation( generatedRepositoryLocation );
+
+        repository = new ManagedRepositoryConfiguration();
+        repository.setId( "dependency-tree" );
+        repository.setLocation( repositoryLocation.getAbsolutePath() );
+    }
+
+    public void testGenerateBasicTree()
+        throws IOException, ConsumerException
+    {
+        consumer.beginScan( repository );
+
+        String path = "org/apache/maven/maven-core/2.0/maven-core-2.0.pom";
+        consumer.processFile( path );
+
+        File generatedFile = new File( generatedRepositoryLocation, path + ".xml" );
+        assertEquals( IOUtils.toString( getClass().getResourceAsStream( "/test-data/maven-core-2.0-tree.xml" ) ),
+                      FileUtils.readFileToString( generatedFile ) );
+
+        consumer.completeScan();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-data/maven-core-2.0-tree.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-data/maven-core-2.0-tree.xml
new file mode 100644 (file)
index 0000000..3c55b90
--- /dev/null
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<tree>
+  <dependency>
+    <groupId>org.apache.maven</groupId>
+    <artifactId>maven-core</artifactId>
+    <type>jar</type>
+    <version>2.0</version>
+    <dependencies>
+      <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <type>jar</type>
+        <version>3.8.1</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-settings</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-file</artifactId>
+        <type>jar</type>
+        <version>1.0-alpha-5</version>
+        <scope>runtime</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-plugin-parameter-documenter</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-http-lightweight</artifactId>
+        <type>jar</type>
+        <version>1.0-alpha-5</version>
+        <scope>runtime</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.reporting</groupId>
+        <artifactId>maven-reporting-api</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+        <dependencies>
+          <dependency>
+            <groupId>doxia</groupId>
+            <artifactId>doxia-sink-api</artifactId>
+            <type>jar</type>
+            <version>1.0-alpha-4</version>
+            <scope>compile</scope>
+          </dependency>
+        </dependencies>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-profile</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-model</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-artifact</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-provider-api</artifactId>
+        <type>jar</type>
+        <version>1.0-alpha-5</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-container-default</artifactId>
+        <type>jar</type>
+        <version>1.0-alpha-8</version>
+        <scope>compile</scope>
+        <dependencies>
+          <dependency>
+            <groupId>classworlds</groupId>
+            <artifactId>classworlds</artifactId>
+            <type>jar</type>
+            <version>1.1-alpha-2</version>
+            <scope>compile</scope>
+          </dependency>
+        </dependencies>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-repository-metadata</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-error-diagnostics</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-project</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-plugin-registry</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>commons-cli</groupId>
+        <artifactId>commons-cli</artifactId>
+        <type>jar</type>
+        <version>1.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-plugin-api</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-plugin-descriptor</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-interactivity-api</artifactId>
+        <type>jar</type>
+        <version>1.0-alpha-4</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-artifact-manager</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-monitor</artifactId>
+        <type>jar</type>
+        <version>2.0</version>
+        <scope>compile</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-ssh</artifactId>
+        <type>jar</type>
+        <version>1.0-alpha-5</version>
+        <scope>runtime</scope>
+        <dependencies>
+          <dependency>
+            <groupId>com.jcraft</groupId>
+            <artifactId>jsch</artifactId>
+            <type>jar</type>
+            <version>0.1.23</version>
+            <scope>runtime</scope>
+          </dependency>
+        </dependencies>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-utils</artifactId>
+        <type>jar</type>
+        <version>1.0.4</version>
+        <scope>compile</scope>
+      </dependency>
+    </dependencies>
+  </dependency>
+</tree>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/org/apache/maven/maven-core/2.0/maven-core-2.0.pom b/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/org/apache/maven/maven-core/2.0/maven-core-2.0.pom
new file mode 100644 (file)
index 0000000..a6e158d
--- /dev/null
@@ -0,0 +1,186 @@
+<project>
+  <parent>
+    <artifactId>maven</artifactId>
+    <groupId>org.apache.maven</groupId>
+    <version>2.0</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven</groupId>
+  <artifactId>maven-core</artifactId>
+  <name>Maven</name>
+  <version>2.0</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>2.0-beta-1</version>
+        <configuration>
+          <descriptor>src/assemble/bin.xml</descriptor>
+          <finalName>maven-${version}</finalName>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-settings</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-file</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-parameter-documenter</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-http-lightweight</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.reporting</groupId>
+      <artifactId>maven-reporting-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-profile</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-provider-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-repository-metadata</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-error-diagnostics</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-registry</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-cli</groupId>
+      <artifactId>commons-cli</artifactId>
+      <version>1.0</version>
+      <exclusions>
+        <exclusion>
+          <artifactId>commons-lang</artifactId>
+          <groupId>commons-lang</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>commons-logging</artifactId>
+          <groupId>commons-logging</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-descriptor</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-interactivity-api</artifactId>
+      <version>1.0-alpha-4</version>
+      <exclusions>
+        <exclusion>
+          <artifactId>plexus-utils</artifactId>
+          <groupId>plexus</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>plexus-container-default</artifactId>
+          <groupId>org.codehaus.plexus</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact-manager</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-monitor</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-ssh</artifactId>
+      <scope>runtime</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>plexus-utils</artifactId>
+          <groupId>plexus</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>plexus-container-default</artifactId>
+          <groupId>org.codehaus.plexus</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+  </dependencies>
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-clover-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-pmd-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+      </plugin>
+    </plugins>
+  </reporting>
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>scp://minotaur.apache.org//www/maven.apache.org/m2</url>
+    </site>
+    <status>deployed</status>
+  </distributionManagement>
+</project>
\ No newline at end of file
index 2e62ef12e538cd0a420c0d76d7de5a767b4b6b2f..703dd1b55b3af1c2bfb1e81e9acd6a19dafce11c 100644 (file)
@@ -34,6 +34,7 @@
     <module>archiva-database-consumers</module>
     <module>archiva-lucene-consumers</module>
     <module>archiva-signature-consumers</module>
+    <module>archiva-dependency-tree-consumer</module>
   </modules>
 
   <build>
diff --git a/pom.xml b/pom.xml
index f0619b92a8c54dee83bef1983ed59790943df0c3..b502551314f8cee18a8542e6a07eaea92e862253 100644 (file)
--- a/pom.xml
+++ b/pom.xml
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-utils</artifactId>
-        <version>1.4</version>
+        <version>1.4.5</version>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
     </dependencies>
   </dependencyManagement>
   <properties>
-    <maven.version>2.0.5</maven.version>
+    <maven.version>2.0.8</maven.version>
     <wagon.version>1.0-rc1-SNAPSHOT</wagon.version>
     <redback.version>1.1-SNAPSHOT</redback.version>
   </properties>