geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r468739 - /geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java
Date Sat, 28 Oct 2006 21:11:33 GMT
Author: jdillon
Date: Sat Oct 28 14:11:32 2006
New Revision: 468739

URL: http://svn.apache.org/viewvc?view=rev&rev=468739
Log:
Add helper to resolve transitivly

Modified:
    geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java

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=468739&r1=468738&r2=468739
==============================================================================
--- 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
Sat Oct 28 14:11:32 2006
@@ -25,6 +25,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.Collections;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -244,9 +245,22 @@
      * Resolves the Artifact from the remote repository if nessessary. If no version is specified,
it will
      * be retrieved from the dependency list or from the DependencyManagement section of
the pom.
      */
-    protected Artifact resolveArtifact(final Artifact artifact) throws MojoExecutionException
{
+    protected Artifact resolveArtifact(final Artifact artifact, final boolean transitive)
throws MojoExecutionException {
         try {
-            getArtifactResolver().resolve(artifact, getProject().getRemoteArtifactRepositories(),
getArtifactRepository());
+            if (transitive) {
+                getArtifactResolver().resolveTransitively(
+                        Collections.singleton(artifact),
+                        getProject().getArtifact(),
+                        getProject().getRemoteArtifactRepositories(),
+                        getArtifactRepository(),
+                        dependencyHelper.getArtifactMetadataSource());
+            }
+            else {
+                getArtifactResolver().resolve(
+                        artifact,
+                        getProject().getRepositories(),
+                        getArtifactRepository());
+            }
         }
         catch (ArtifactResolutionException e) {
             throw new MojoExecutionException("Unable to resolve artifact.", e);
@@ -256,6 +270,14 @@
         }
 
         return artifact;
+    }
+
+    /**
+     * Resolves the Artifact from the remote repository if nessessary. If no version is specified,
it will
+     * be retrieved from the dependency list or from the DependencyManagement section of
the pom.
+     */
+    protected Artifact resolveArtifact(final Artifact artifact) throws MojoExecutionException
{
+        return resolveArtifact(artifact, false);
     }
 
     /**



Mime
View raw message