You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm-commits@maven.apache.org by ev...@apache.org on 2007/03/12 15:27:40 UTC

svn commit: r517228 - /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java

Author: evenisse
Date: Mon Mar 12 07:27:39 2007
New Revision: 517228

URL: http://svn.apache.org/viewvc?view=rev&rev=517228
Log:
[SCM-282] Allow to define the goals working directory
Submitted by: David Jackman

Modified:
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java

Modified: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java?view=diff&rev=517228&r1=517227&r2=517228
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java (original)
+++ maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java Mon Mar 12 07:27:39 2007
@@ -28,6 +28,7 @@
 import org.codehaus.plexus.util.cli.StreamConsumer;
 
 import java.io.BufferedReader;
+import java.io.File;
 import java.io.InputStreamReader;
 import java.util.Iterator;
 import java.util.Properties;
@@ -53,6 +54,13 @@
      */
     private String goals;
 
+    /**
+     * The subdirectory (under the checkout directory) in which to run the goals.
+     *
+     * @parameter expression="${goalsDirectory}" default-value=""
+     */
+    private String goalsDirectory;
+
     public void execute()
         throws MojoExecutionException
     {
@@ -79,7 +87,14 @@
 
         cl.setExecutable( "mvn" );
 
-        cl.setWorkingDirectory( this.getCheckoutDirectory().getPath() );
+        if ( StringUtils.isEmpty( goalsDirectory ) )
+        {
+            cl.setWorkingDirectory( this.getCheckoutDirectory().getPath() );
+        }
+        else
+        {
+            cl.setWorkingDirectory( new File( this.getCheckoutDirectory(), goalsDirectory ).getPath() );
+        }
 
         if ( this.goals != null )
         {