maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r430191 - /maven/sandbox/plugins/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
Date Wed, 09 Aug 2006 23:48:22 GMT
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 )



Mime
View raw message