This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-invoker-plugin-1.0
in repository https://gitbox.apache.org/repos/asf/maven-invoker-plugin.git

commit 6f921e1ade278ad2551d392ed1ffab45bbabc50d
Author: John Dennis Casey <jdca...@apache.org>
AuthorDate: Wed Aug 9 23:48:22 2006 +0000

    Adding ability to specify a single POM to build as an override to the 
scanning behavior.
    
    git-svn-id: 
https://svn.apache.org/repos/asf/maven/sandbox/plugins/maven-invoker-plugin@430191
 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/maven/plugin/invoker/InvokerMojo.java   | 31 ++++++++++++++++------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java 
b/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
index 685cc73..dff9799 100644
--- a/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
@@ -29,6 +29,7 @@ import org.apache.maven.shared.invoker.Invoker;
 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 @@ public class InvokerMojo
      * @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 @@ public class InvokerMojo
     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 )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <commits@maven.apache.org>.

Reply via email to