geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r454267 - /geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/ShowDependenciesMojo.java
Date Mon, 09 Oct 2006 03:20:29 GMT
Author: jdillon
Date: Sun Oct  8 20:20:28 2006
New Revision: 454267

URL: http://svn.apache.org/viewvc?view=rev&rev=454267
Log:
Use refactored dependency code

Modified:
    geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/ShowDependenciesMojo.java

Modified: geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/ShowDependenciesMojo.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/ShowDependenciesMojo.java?view=diff&rev=454267&r1=454266&r2=454267
==============================================================================
--- geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/ShowDependenciesMojo.java
(original)
+++ geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/ShowDependenciesMojo.java
Sun Oct  8 20:20:28 2006
@@ -24,9 +24,12 @@
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
 
 import org.apache.geronimo.genesis.dependency.DependencyHelper;
-import org.apache.geronimo.genesis.dependency.DependencyResolutionListener;
+import org.apache.geronimo.genesis.dependency.DependencyTree;
+import org.apache.geronimo.genesis.dependency.DependencyTree.Node;
 import org.apache.geronimo.genesis.MojoSupport;
 
 /**
@@ -63,14 +66,20 @@
      * @required
      * @readonly
      */
-    protected ArtifactRepository localRepository;
+    protected ArtifactRepository repository;
+
+    protected void init() throws MojoExecutionException, MojoFailureException {
+        super.init();
+        
+        helper.setArtifactRepository(repository);
+    }
 
     protected void doExecute() throws Exception {
-        DependencyResolutionListener listener = helper.resolveProject(project, localRepository);
-        printDependencyListing(listener.getRootNode(), "");
+        DependencyTree dependencies = helper.getDependencies(project);
+        printDependencyListing(dependencies.getRootNode(), "");
     }
 
-    private void printDependencyListing(DependencyResolutionListener.Node node, final String
pad) {
+    private void printDependencyListing(final Node node, final String pad) {
         Artifact artifact = node.getArtifact();
         String id = artifact.getDependencyConflictId();
 
@@ -84,9 +93,11 @@
         log.info(pad + buff);
 
         if (!node.getChildren().isEmpty()) {
-            for (Iterator deps = node.getChildren().iterator(); deps.hasNext();) {
-                DependencyResolutionListener.Node dep = (DependencyResolutionListener.Node)
deps.next();
-                printDependencyListing(dep, pad + "    ");
+            Iterator children = node.getChildren().iterator();
+            
+            while (children.hasNext()) {
+                Node child = (Node) children.next();
+                printDependencyListing(child, pad + "    ");
             }
         }
     }



Mime
View raw message