You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2006/08/10 01:48:22 UTC

svn commit: r430191 - /maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java

Author: jdcasey
Date: Wed Aug  9 16:48:22 2006
New Revision: 430191

URL: http://svn.apache.org/viewvc?rev=430191&view=rev
Log:
Adding ability to specify a single POM to build as an override to the scanning behavior.

Modified:
    maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java

Modified: maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java?rev=430191&r1=430190&r2=430191&view=diff
==============================================================================
--- maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java (original)
+++ maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java Wed Aug  9 16:48:22 2006
@@ -29,6 +29,7 @@
 import org.apache.maven.shared.invoker.MavenInvocationException;
 import org.apache.maven.shared.model.fileset.FileSet;
 import org.apache.maven.shared.model.fileset.util.FileSetManager;
+import org.apache.maven.wagon.PathUtils;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.cli.CommandLineException;
 
@@ -70,6 +71,13 @@
      * @parameter expression="${invoker.projectsDirectory}" default-value="${basedir}/src/projects/"
      */
     private File projectsDirectory;
+    
+    /**
+     * A single POM to build, skipping any scanning parameters and behavior.
+     * 
+     * @parameter expression="${invoker.pom}"
+     */
+    private File pom;
 
     /**
      * Includes for searching the integration test directory. This parameter is meant to be set from the POM.
@@ -517,17 +525,24 @@
     private String[] getPoms()
         throws IOException
     {
-        final FileSet fs = new FileSet();
+        if ( pom != null && pom.exists() )
+        {
+            return new String[]{ PathUtils.toRelative( projectsDirectory, pom.getAbsolutePath() ) };
+        }
+        else
+        {
+            final FileSet fs = new FileSet();
 
-        fs.setIncludes( pomIncludes );
-        fs.setExcludes( pomExcludes );
-        fs.setDirectory( projectsDirectory.getCanonicalPath() );
-        fs.setFollowSymlinks( false );
-        fs.setUseDefaultExcludes( false );
+            fs.setIncludes( pomIncludes );
+            fs.setExcludes( pomExcludes );
+            fs.setDirectory( projectsDirectory.getCanonicalPath() );
+            fs.setFollowSymlinks( false );
+            fs.setUseDefaultExcludes( false );
 
-        final FileSetManager fsm = new FileSetManager( getLog() );
+            final FileSetManager fsm = new FileSetManager( getLog() );
 
-        return fsm.getIncludedFiles( fs );
+            return fsm.getIncludedFiles( fs );
+        }
     }
 
     private List readFromFile( final File projectGoalList )