/[Apache-SVN]/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PerformReleaseMojo.java
ViewVC logotype

Diff of /maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PerformReleaseMojo.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PerformReleaseMojo.java	2005/05/17 15:41:52	170613
+++ maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PerformReleaseMojo.java	2005/05/17 16:07:47	170614
@@ -17,6 +17,16 @@ package org.apache.maven.plugin.release;
  */
 
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.codehaus.plexus.util.cli.DefaultConsumer;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+import sun.security.action.GetLongAction;
+import sun.tools.jar.CommandLine;
 
 /**
  * @goal perform
@@ -29,10 +39,18 @@ import org.apache.maven.plugin.MojoExecu
 public class PerformReleaseMojo
     extends AbstractReleaseMojo
 {
+    /**
+     * @parameter expression="${goals}"
+     * @required
+     */
+    private String goals = "deploy site:site site:deploy";
+
     protected void executeTask()
         throws MojoExecutionException
     {
         checkout();
+
+        runGoals();
     }
 
     private void checkout()
@@ -47,4 +65,22 @@ public class PerformReleaseMojo
             throw new MojoExecutionException( "An error is occurred in the checkout process.", e );
         }
     }
+
+    private void runGoals()
+        throws MojoExecutionException
+    {
+        Commandline cl = new Commandline();
+        cl.setExecutable( "m2" );
+        cl.setWorkingDirectory( getWorkingDirectory() );
+        cl.createArgument().setLine( goals );
+        StreamConsumer consumer = new DefaultConsumer();
+        try
+        {
+            CommandLineUtils.executeCommandLine( cl, consumer, consumer );
+        }
+        catch ( CommandLineException e )
+        {
+            throw new MojoExecutionException( "Can't run goal " + goals, e );
+        }
+    }
 }

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26