geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r454236 - in /geronimo/genesis/trunk/plugins: maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/ plugin-support/src/main/java/org/apache/geronimo/genesis/ plugin-support/src/main/java/org/apache/geronimo/genesis/ant...
Date Sun, 08 Oct 2006 23:39:12 GMT
Author: jdillon
Date: Sun Oct  8 16:39:11 2006
New Revision: 454236

URL: http://svn.apache.org/viewvc?view=rev&rev=454236
Log:
Repackaged support classes into ant, dependency and util packages
Using DependencyHelper component for artifactFactory and artifactResolver

Added:
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntLoggerAdapter.java
  (contents, props changed)
      - copied, changed from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntLoggerAdapter.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java
  (contents, props changed)
      - copied, changed from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntMojoSupport.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/Dependencies.java
  (contents, props changed)
      - copied, changed from r454214, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/Dependencies.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyHelper.java
  (with props)
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyResolutionListener.java
  (contents, props changed)
      - copied, changed from r454214, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/DependencyResolutionListener.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ArtifactItem.java
  (contents, props changed)
      - copied, changed from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ArtifactItem.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/MavenPluginLog.java
  (contents, props changed)
      - copied, changed from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MavenPluginLog.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ObjectHolder.java
  (contents, props changed)
      - copied, changed from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ObjectHolder.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/
    geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/plexus/
    geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/plexus/components.xml
  (with props)
Removed:
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntLoggerAdapter.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntMojoSupport.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ArtifactItem.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/Dependencies.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/DependencyResolutionListener.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MavenPluginLog.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ObjectHolder.java
Modified:
    geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java
    geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/commons-logging.properties
    geronimo/genesis/trunk/plugins/script-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/script/GroovyMojo.java
    geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/CopyLegalFilesMojo.java
    geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/ShowDependenciesMojo.java
    geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/resources/META-INF/plexus/components.xml

Modified: geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java?view=diff&rev=454236&r1=454235&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java
(original)
+++ geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java
Sun Oct  8 16:39:11 2006
@@ -25,7 +25,7 @@
 import java.util.Map;
 import java.util.Iterator;
 
-import org.apache.geronimo.genesis.AntMojoSupport;
+import org.apache.geronimo.genesis.ant.AntMojoSupport;
 
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.plugin.MojoExecutionException;

Modified: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java?view=diff&rev=454236&r1=454235&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java
(original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java
Sun Oct  8 16:39:11 2006
@@ -20,32 +20,39 @@
 package org.apache.geronimo.genesis;
 
 import java.io.File;
-
+import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.ArrayList;
 import java.util.Set;
-import java.util.HashSet;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.MavenProject;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
-
-import org.apache.maven.model.Exclusion;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Exclusion;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+
+import org.apache.geronimo.genesis.dependency.DependencyHelper;
+import org.apache.geronimo.genesis.util.ArtifactItem;
+import org.apache.geronimo.genesis.util.MavenPluginLog;
 
 /**
  * Support for Mojo implementations.
@@ -54,6 +61,7 @@
  */
 public abstract class MojoSupport
     extends AbstractMojo
+    implements Contextualizable
 {
     static {
         //
@@ -69,16 +77,20 @@
         //       causes some other Maven plugins to have problems (like the site plugin when
it runs checkstyle).
         //       Not sure that this will always get picked up though... :-(
         //
-        // System.setProperty("org.apache.commons.logging.Log", "org.apache.geronimo.genesis.MavenPluginLog");
+        // System.setProperty("org.apache.commons.logging.Log", "org.apache.geronimo.genesis.util.MavenPluginLog");
 
         System.setProperty("geronimo.bootstrap.logging.enabled", "false");
     }
 
+    private PlexusContainer container;
+
     /**
      * Instance logger.  This is initialized to the value of {@link #getLog}
      * on execution.
      */
     protected Log log;
+    
+    private DependencyHelper dependencyHelper;
 
     /**
      * Initializes logging.  Called by {@link #execute}.
@@ -88,6 +100,20 @@
 
         // Install the bridge from JCL to this plugins Log
         MavenPluginLog.setLog(log);
+
+        //
+        // NOTE: Using direct lookup because this class may not have been directly configured
+        //
+        try {
+            this.dependencyHelper = (DependencyHelper)container.lookup(DependencyHelper.class.getName());
+        }
+        catch (ComponentLookupException e) {
+            throw new MojoExecutionException("Failed to lookup required components", e);
+        }
+    }
+
+    public void contextualize(final Context context) throws ContextException {
+        container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
     }
 
     /**
@@ -144,33 +170,27 @@
     }
 
     /**
-     * Get the artifact factory..
+     * Get the artifact repository.
      *
      * <p>
      * Sub-class must overridde to provide access.
      */
-    protected ArtifactFactory getArtifactFactory() {
-        throw new Error("Sub-class must override to provide access to: " + ArtifactFactory.class);
+    protected ArtifactRepository getArtifactRepository() {
+        throw new Error("Sub-class must override to provide access to: " + ArtifactRepository.class);
     }
 
     /**
-     * Get the artifact resolver.
-     *
-     * <p>
-     * Sub-class must overridde to provide access.
+     * Get the artifact factory.
      */
-    protected ArtifactResolver getArtifactResolver() {
-        throw new Error("Sub-class must override to provide access to: " + ArtifactResolver.class);
+    protected final ArtifactFactory getArtifactFactory() {
+        return dependencyHelper.getArtifactFactory();
     }
 
     /**
-     * Get the artifact repository.
-     *
-     * <p>
-     * Sub-class must overridde to provide access.
+     * Get the artifact resolver.
      */
-    protected ArtifactRepository getArtifactRepository() {
-        throw new Error("Sub-class must override to provide access to: " + ArtifactRepository.class);
+    protected final ArtifactResolver getArtifactResolver() {
+        return dependencyHelper.getArtifactResolver();
     }
 
     /**

Copied: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntLoggerAdapter.java
(from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntLoggerAdapter.java)
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntLoggerAdapter.java?view=diff&rev=454236&p1=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntLoggerAdapter.java&r1=454199&p2=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntLoggerAdapter.java&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntLoggerAdapter.java
(original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntLoggerAdapter.java
Sun Oct  8 16:39:11 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.genesis;
+package org.apache.geronimo.genesis.ant;
 
 import java.io.PrintStream;
 

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntLoggerAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntLoggerAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntLoggerAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java
(from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntMojoSupport.java)
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java?view=diff&rev=454236&p1=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntMojoSupport.java&r1=454199&p2=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/AntMojoSupport.java
(original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java
Sun Oct  8 16:39:11 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.genesis;
+package org.apache.geronimo.genesis.ant;
 
 import java.io.File;
 
@@ -35,6 +35,9 @@
 import org.apache.tools.ant.taskdefs.Java;
 import org.apache.tools.ant.taskdefs.Mkdir;
 import org.apache.tools.ant.taskdefs.Property;
+
+import org.apache.geronimo.genesis.ant.AntLoggerAdapter;
+import org.apache.geronimo.genesis.MojoSupport;
 
 /**
  * Support for Ant-based Mojos.

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/Dependencies.java
(from r454214, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/Dependencies.java)
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/Dependencies.java?view=diff&rev=454236&p1=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/Dependencies.java&r1=454214&p2=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/Dependencies.java&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/Dependencies.java
(original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/Dependencies.java
Sun Oct  8 16:39:11 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.genesis;
+package org.apache.geronimo.genesis.dependency;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -35,6 +35,8 @@
 import org.apache.maven.model.DependencyManagement;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.ProjectBuildingException;
+
+import org.apache.geronimo.genesis.dependency.DependencyResolutionListener;
 
 //
 // NOTE: Lifetd from the maven-project-info-plugin

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/Dependencies.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/Dependencies.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/Dependencies.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyHelper.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyHelper.java?view=auto&rev=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyHelper.java
(added)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyHelper.java
Sun Oct  8 16:39:11 2006
@@ -0,0 +1,134 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.genesis.dependency;
+
+import java.util.Map;
+import java.util.Collections;
+
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.resolver.ArtifactCollector;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.artifact.InvalidDependencyVersionException;
+
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public class DependencyHelper
+    implements Contextualizable
+{
+    private ArtifactRepositoryFactory artifactRepositoryFactory = null;
+
+    private ArtifactMetadataSource artifactMetadataSource = null;
+
+    private ArtifactCollector artifactCollector = null;
+
+    private ArtifactFactory artifactFactory = null;
+
+    private ArtifactResolver artifactResolver = null;
+
+    private PlexusContainer container;
+
+    //
+    // TODO: Figure out how to get ${localRepository} injected so we don't need it passed
in.
+    //
+
+    /**
+     * ???
+     *
+     * @param project       The maven project
+     * @param repository    The local maven repository
+     * @return
+     * 
+     * @throws ProjectBuildingException
+     * @throws ArtifactResolutionException
+     * @throws InvalidDependencyVersionException
+     */
+    public DependencyResolutionListener resolveProject(final MavenProject project, final
ArtifactRepository repository)
+        throws ProjectBuildingException, ArtifactResolutionException, InvalidDependencyVersionException
+    {
+        assert project != null;
+        assert repository != null;
+        
+        Map managedVersions = Dependencies.getManagedVersionMap(project, artifactFactory);
+        DependencyResolutionListener listener = new DependencyResolutionListener();
+
+        if (project.getDependencyArtifacts() == null) {
+            project.setDependencyArtifacts(project.createArtifacts(artifactFactory, null,
null));
+        }
+
+        artifactCollector.collect(
+                project.getDependencyArtifacts(),
+                project.getArtifact(),
+                managedVersions,
+                repository,
+                project.getRemoteArtifactRepositories(),
+                artifactMetadataSource,
+                null,
+                Collections.singletonList(listener));
+
+        return listener;
+    }
+
+    //
+    // Contextualizable
+    //
+
+    public void contextualize(final Context context) throws ContextException {
+        container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
+    }
+
+    //
+    // Component Access
+    //
+    
+    public ArtifactResolver getArtifactResolver() {
+        return artifactResolver;
+    }
+
+    public ArtifactRepositoryFactory getArtifactRepositoryFactory() {
+        return artifactRepositoryFactory;
+    }
+
+    public ArtifactMetadataSource getArtifactMetadataSource() {
+        return artifactMetadataSource;
+    }
+
+    public ArtifactCollector getArtifactCollector() {
+        return artifactCollector;
+    }
+
+    public ArtifactFactory getArtifactFactory() {
+        return artifactFactory;
+    }
+}

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyHelper.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyResolutionListener.java
(from r454214, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/DependencyResolutionListener.java)
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyResolutionListener.java?view=diff&rev=454236&p1=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/DependencyResolutionListener.java&r1=454214&p2=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyResolutionListener.java&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/DependencyResolutionListener.java
(original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyResolutionListener.java
Sun Oct  8 16:39:11 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.genesis;
+package org.apache.geronimo.genesis.dependency;
 
 import java.util.ArrayList;
 import java.util.Collection;

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyResolutionListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyResolutionListener.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/dependency/DependencyResolutionListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ArtifactItem.java
(from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ArtifactItem.java)
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ArtifactItem.java?view=diff&rev=454236&p1=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ArtifactItem.java&r1=454199&p2=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ArtifactItem.java&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ArtifactItem.java
(original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ArtifactItem.java
Sun Oct  8 16:39:11 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.genesis;
+package org.apache.geronimo.genesis.util;
 
 /**
  * Represents a Maven-artifact.

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ArtifactItem.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ArtifactItem.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ArtifactItem.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/MavenPluginLog.java
(from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MavenPluginLog.java)
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/MavenPluginLog.java?view=diff&rev=454236&p1=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MavenPluginLog.java&r1=454199&p2=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/MavenPluginLog.java&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MavenPluginLog.java
(original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/MavenPluginLog.java
Sun Oct  8 16:39:11 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.genesis;
+package org.apache.geronimo.genesis.util;
 
 import org.apache.commons.logging.Log;
 

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/MavenPluginLog.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/MavenPluginLog.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/MavenPluginLog.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ObjectHolder.java
(from r454199, geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ObjectHolder.java)
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ObjectHolder.java?view=diff&rev=454236&p1=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ObjectHolder.java&r1=454199&p2=geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ObjectHolder.java&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ObjectHolder.java
(original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ObjectHolder.java
Sun Oct  8 16:39:11 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.genesis;
+package org.apache.geronimo.genesis.util;
 
 /**
  * Simple helper that holds an object.

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ObjectHolder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ObjectHolder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/util/ObjectHolder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/plexus/components.xml
(added)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/plexus/components.xml
Sun Oct  8 16:39:11 2006
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<component-set>
+    <components>
+
+        <component>
+            <role>org.apache.geronimo.genesis.dependency.DependencyHelper</role>
+            <implementation>org.apache.geronimo.genesis.dependency.DependencyHelper</implementation>
+            <requirements>
+                <requirement>
+                    <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+                </requirement>
+                <requirement>
+                    <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
+                </requirement>
+                <requirement>
+                    <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
+                </requirement>
+                <requirement>
+                    <role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
+                </requirement>
+                <requirement>
+                    <role>org.apache.maven.artifact.resolver.ArtifactCollector</role>
+                </requirement>
+            </requirements>
+        </component>
+
+    </components>
+</component-set>
+

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/commons-logging.properties
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/commons-logging.properties?view=diff&rev=454236&r1=454235&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/commons-logging.properties
(original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/resources/commons-logging.properties
Sun Oct  8 16:39:11 2006
@@ -2,4 +2,4 @@
 ## $Rev$ $Date$
 ##
 
-org.apache.commons.logging.Log=org.apache.geronimo.genesis.MavenPluginLog
\ No newline at end of file
+org.apache.commons.logging.Log=org.apache.geronimo.genesis.util.MavenPluginLog
\ No newline at end of file

Modified: geronimo/genesis/trunk/plugins/script-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/script/GroovyMojo.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/script-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/script/GroovyMojo.java?view=diff&rev=454236&r1=454235&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/script-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/script/GroovyMojo.java
(original)
+++ geronimo/genesis/trunk/plugins/script-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/script/GroovyMojo.java
Sun Oct  8 16:39:11 2006
@@ -20,7 +20,7 @@
 package org.apache.geronimo.genesis.plugins.script;
 
 import org.apache.geronimo.genesis.MojoSupport;
-import org.apache.geronimo.genesis.ArtifactItem;
+import org.apache.geronimo.genesis.util.ArtifactItem;
 
 import java.io.File;
 import java.io.InputStream;

Modified: geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/CopyLegalFilesMojo.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/CopyLegalFilesMojo.java?view=diff&rev=454236&r1=454235&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/CopyLegalFilesMojo.java
(original)
+++ geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/tools/CopyLegalFilesMojo.java
Sun Oct  8 16:39:11 2006
@@ -19,7 +19,7 @@
 
 package org.apache.geronimo.genesis.plugins.tools;
 
-import org.apache.geronimo.genesis.AntMojoSupport;
+import org.apache.geronimo.genesis.ant.AntMojoSupport;
 import org.apache.tools.ant.taskdefs.Copy;
 import org.apache.tools.ant.types.FileSet;
 import org.apache.maven.project.MavenProject;

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=454236&r1=454235&r2=454236
==============================================================================
--- 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 16:39:11 2006
@@ -19,24 +19,15 @@
 
 package org.apache.geronimo.genesis.plugins.tools;
 
-import java.util.Collections;
 import java.util.Iterator;
-import java.util.Map;
 
 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.resolver.ArtifactCollector;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 
+import org.apache.geronimo.genesis.dependency.DependencyHelper;
+import org.apache.geronimo.genesis.dependency.DependencyResolutionListener;
 import org.apache.geronimo.genesis.MojoSupport;
-import org.apache.geronimo.genesis.Dependencies;
-import org.apache.geronimo.genesis.DependencyResolutionListener;
 
 /**
  * Helper to show a projects dependencies.
@@ -55,8 +46,27 @@
      */
     private boolean verbose = false;
 
+    /**
+     * @component
+     */
+    private DependencyHelper helper = null;
+
+    /**
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    protected MavenProject project;
+
+    /**
+     * @parameter expression="${localRepository}"
+     * @required
+     * @readonly
+     */
+    protected ArtifactRepository localRepository;
+
     protected void doExecute() throws Exception {
-        DependencyResolutionListener listener = resolveProject();
+        DependencyResolutionListener listener = helper.resolveProject(project, localRepository);
         printDependencyListing(listener.getRootNode(), "");
     }
 
@@ -79,101 +89,5 @@
                 printDependencyListing(dep, pad + "    ");
             }
         }
-    }
-
-    private DependencyResolutionListener resolveProject()
-        throws ProjectBuildingException, ArtifactResolutionException, InvalidDependencyVersionException
-    {
-        Map managedVersions = Dependencies.getManagedVersionMap(project, artifactFactory);
-        DependencyResolutionListener listener = new DependencyResolutionListener();
-
-        if (project.getDependencyArtifacts() == null) {
-            project.setDependencyArtifacts(project.createArtifacts(artifactFactory, null,
null));
-        }
-        
-        artifactCollector.collect(
-                project.getDependencyArtifacts(),
-                project.getArtifact(),
-                managedVersions,
-                localRepository,
-                project.getRemoteArtifactRepositories(),
-                artifactMetadataSource,
-                null,
-                Collections.singletonList(listener));
-
-        return listener;
-    }
-
-    /**
-     * @parameter
-     * @component
-     * @required
-     */
-    private ArtifactMetadataSource artifactMetadataSource = null;
-
-    /**
-     * ???
-     *
-     * @component
-     */
-    private ArtifactCollector artifactCollector = null;
-
-    /**
-     * Local Repository.
-     *
-     * @parameter expression="${localRepository}"
-     * @required
-     * @readonly
-     */
-    protected ArtifactRepository localRepository;
-
-    //
-    // MojoSupport Hooks
-    //
-
-    /**
-     * The maven project.
-     *
-     * @parameter expression="${project}"
-     * @required
-     * @readonly
-     */
-    protected MavenProject project;
-
-    protected MavenProject getProject() {
-        return project;
-    }
-
-    /**
-     * @component
-     * @required
-     * @readonly
-     */
-    private ArtifactFactory artifactFactory = null;
-
-    protected ArtifactFactory getArtifactFactory() {
-        return artifactFactory;
-    }
-
-    /**
-     * @component
-     * @required
-     * @readonly
-     */
-    private ArtifactResolver artifactResolver = null;
-
-    protected ArtifactResolver getArtifactResolver() {
-        return artifactResolver;
-    }
-
-    /**
-     * @parameter expression="${localRepository}"
-     * @readonly
-     * @required
-     */
-    protected ArtifactRepository artifactRepository = null;
-
-    protected ArtifactRepository getArtifactRepository() {
-        return artifactRepository;
     }
 }

Modified: geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=454236&r1=454235&r2=454236
==============================================================================
--- geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/resources/META-INF/plexus/components.xml
(original)
+++ geronimo/genesis/trunk/plugins/tools-maven-plugin/src/main/resources/META-INF/plexus/components.xml
Sun Oct  8 16:39:11 2006
@@ -1,4 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
 
 <!-- $Rev$ $Date$ -->
 



Mime
View raw message