continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r443225 - in /maven/continuum/branches/release-integration/maven/maven-release-plugin/src: main/java/org/apache/maven/plugins/release/ main/java/org/apache/maven/plugins/release/exec/ main/java/org/apache/maven/plugins/release/phase/ test/j...
Date Thu, 14 Sep 2006 04:28:49 GMT
Author: epunzalan
Date: Wed Sep 13 21:28:48 2006
New Revision: 443225

URL: http://svn.apache.org/viewvc?view=rev&rev=443225
Log:
PR: CONTINUUM-727

Added a ReleaseResult object to hold console output and release results

Added:
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseResult.java   (with props)
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutorResult.java   (with props)
Modified:
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/ForkedMavenExecutor.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutor.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java
    maven/continuum/branches/release-integration/maven/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java Wed Sep 13 21:28:48 2006
@@ -39,10 +39,10 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.ArrayList;
 
 /**
  * Implementation of the release manager.
@@ -96,10 +96,46 @@
         prepare( releaseDescriptor, settings, reactorProjects, resume, dryRun, null );
     }
 
+    public ReleaseResult prepareWithResult( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects, boolean resume,
+                         boolean dryRun, ReleaseManagerListener listener )
+    {
+        ReleaseResult result = new ReleaseResult();
+
+        result.setStartTime( System.currentTimeMillis() );
+
+        try
+        {
+            prepare( releaseDescriptor, settings, reactorProjects, resume, dryRun, listener, result );
+
+            result.setResultCode( ReleaseResult.SUCCESS );
+        }
+        catch ( ReleaseExecutionException e )
+        {
+            captureException( result, listener, e );
+        }
+        catch ( ReleaseFailureException e )
+        {
+            captureException( result, listener, e );
+        }
+        finally
+        {
+            result.setEndTime( System.currentTimeMillis() );
+        }
+
+        return result;
+    }
+
     public void prepare( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects, boolean resume,
                          boolean dryRun, ReleaseManagerListener listener )
         throws ReleaseExecutionException, ReleaseFailureException
     {
+        prepare( releaseDescriptor, settings, reactorProjects, resume, dryRun, listener, null );
+    }
+
+    private void prepare( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects, boolean resume,
+                         boolean dryRun, ReleaseManagerListener listener, ReleaseResult result )
+        throws ReleaseExecutionException, ReleaseFailureException
+    {
         updateListener( listener, "prepare", goalStart );
 
         ReleaseDescriptor config;
@@ -111,8 +147,6 @@
             }
             catch ( ReleaseDescriptorStoreException e )
             {
-                updateListener( listener, e.getMessage(), error );
-
                 throw new ReleaseExecutionException( "Error reading stored configuration: " + e.getMessage(), e );
             }
         }
@@ -134,12 +168,12 @@
 
         if ( index == preparePhases.size() - 1 )
         {
-            getLogger().info(
-                "Release preparation already completed. You can now continue with release:perform, or start again using the -Dresume=false flag" );
+            logInfo( result, "Release preparation already completed. You can now continue with release:perform, " +
+                             "or start again using the -Dresume=false flag" );
         }
         else if ( index >= 0 )
         {
-            getLogger().info( "Resuming release from phase '" + preparePhases.get( index + 1 ) + "'" );
+            logInfo( result, "Resuming release from phase '" + preparePhases.get( index + 1 ) + "'" );
         }
 
         // start from next phase
@@ -151,38 +185,29 @@
 
             if ( phase == null )
             {
-                String message = "Unable to find phase '" + name + "' to execute";
-
-                updateListener( listener, message, error );
-
-                throw new ReleaseExecutionException( message );
+                throw new ReleaseExecutionException( "Unable to find phase '" + name + "' to execute" );
             }
 
             updateListener( listener, name, phaseStart );
 
-            //catch the exception before re-throwing for the listeners
+            ReleaseResult phaseResult = null;
             try
             {
                 if ( dryRun )
                 {
-                    phase.simulate( config, settings, reactorProjects );
+                    phaseResult = phase.simulate( config, settings, reactorProjects );
                 }
                 else
                 {
-                    phase.execute( config, settings, reactorProjects );
+                    phaseResult = phase.execute( config, settings, reactorProjects );
                 }
             }
-            catch ( ReleaseExecutionException e )
+            finally
             {
-                updateListener( listener, e.getMessage(), error );
-
-                throw e;
-            }
-            catch ( ReleaseFailureException e )
-            {
-                updateListener( listener, e.getMessage(), error );
-
-                throw e;
+                if ( result != null && phaseResult != null )
+                {
+                    result.getOutputBuffer().append( phaseResult.getOutput() );
+                }
             }
 
             config.setCompletedPhase( name );
@@ -192,8 +217,6 @@
             }
             catch ( ReleaseDescriptorStoreException e )
             {
-                updateListener( listener, e.getMessage(), error );
-
                 // TODO: rollback?
                 throw new ReleaseExecutionException( "Error writing release properties after completing phase", e );
             }
@@ -216,9 +239,49 @@
                          ReleaseManagerListener listener )
         throws ReleaseExecutionException, ReleaseFailureException
     {
+        perform( releaseDescriptor, settings, reactorProjects, checkoutDirectory, goals,
+                 useReleaseProfile, listener, null );
+    }
+
+    public ReleaseResult performWithResult( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects,
+                                            File checkoutDirectory, String goals, boolean useReleaseProfile,
+                                            ReleaseManagerListener listener )
+    {
+        ReleaseResult result = new ReleaseResult();
+
+        try
+        {
+            result.setStartTime( System.currentTimeMillis() );
+
+            perform( releaseDescriptor, settings, reactorProjects, checkoutDirectory, goals,
+                     useReleaseProfile, listener, result );
+
+            result.setResultCode( ReleaseResult.SUCCESS );
+        }
+        catch ( ReleaseExecutionException e )
+        {
+            captureException( result, listener, e );
+        }
+        catch ( ReleaseFailureException e )
+        {
+            captureException( result, listener, e );
+        }
+        finally
+        {
+            result.setEndTime( System.currentTimeMillis() );
+        }
+
+        return result;
+    }
+
+    private void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects,
+                         File checkoutDirectory, String goals, boolean useReleaseProfile,
+                         ReleaseManagerListener listener, ReleaseResult result )
+        throws ReleaseExecutionException, ReleaseFailureException
+    {
         updateListener( listener, "perform", goalStart );
 
-        getLogger().info( "Checking out the project to perform the release ..." );
+        logInfo( result, "Checking out the project to perform the release ..." );
 
         updateListener( listener, "verify-release-configuration", phaseStart );
 
@@ -301,10 +364,10 @@
         }
         checkoutDirectory.mkdirs();
 
-        CheckOutScmResult result;
+        CheckOutScmResult scmResult;
         try
         {
-            result = provider.checkOut( repository, new ScmFileSet( checkoutDirectory ), config.getScmReleaseLabel() );
+            scmResult = provider.checkOut( repository, new ScmFileSet( checkoutDirectory ), config.getScmReleaseLabel() );
         }
         catch ( ScmException e )
         {
@@ -312,11 +375,11 @@
 
             throw new ReleaseExecutionException( "An error is occurred in the checkout process: " + e.getMessage(), e );
         }
-        if ( !result.isSuccess() )
+        if ( !scmResult.isSuccess() )
         {
-            updateListener( listener, result.getProviderMessage(), error );
+            updateListener( listener, scmResult.getProviderMessage(), error );
 
-            throw new ReleaseScmCommandException( "Unable to checkout from SCM", result );
+            throw new ReleaseScmCommandException( "Unable to checkout from SCM", scmResult );
         }
 
         updateListener( listener, "checkout-project-from-scm", phaseEnd );
@@ -349,10 +412,8 @@
         }
 
         updateListener( listener, "build-project", phaseEnd );
-        updateListener( listener, "cleanup", phaseStart );
 
         clean( config, reactorProjects );
-
         updateListener( listener, "cleanup", phaseEnd );
         updateListener( listener, "perform", goalEnd );
     }
@@ -424,5 +485,24 @@
         }
 
         return phases;
+    }
+
+    private void logInfo( ReleaseResult result, String message )
+    {
+        if ( result != null )
+        {
+            result.appendInfo( message );
+        }
+
+        getLogger().info( message );
+    }
+
+    private void captureException( ReleaseResult result, ReleaseManagerListener listener, Exception e )
+    {
+        updateListener( listener, e.getMessage(), error );
+
+        result.appendError( e );
+
+        result.setResultCode( ReleaseResult.ERROR );
     }
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java Wed Sep 13 21:28:48 2006
@@ -58,7 +58,7 @@
      * @throws ReleaseFailureException   if there is a problem performing the release
      */
     void prepare( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects, boolean resume,
-                  boolean dryRun )
+                           boolean dryRun )
         throws ReleaseExecutionException, ReleaseFailureException;
 
     /**
@@ -72,8 +72,8 @@
      * @throws ReleaseExecutionException if there is a problem performing the release
      * @throws ReleaseFailureException   if there is a problem performing the release
      */
-    void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects, File checkoutDirectory,
-                  String goals, boolean useReleaseProfile )
+    void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects,
+                           File checkoutDirectory, String goals, boolean useReleaseProfile )
         throws ReleaseExecutionException, ReleaseFailureException;
 
     /**
@@ -85,11 +85,18 @@
     void clean( ReleaseDescriptor releaseDescriptor, List reactorProjects );
 
     void prepare( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects, boolean resume,
-                  boolean dryRun, ReleaseManagerListener listener )
+                           boolean dryRun, ReleaseManagerListener listener )
         throws ReleaseExecutionException, ReleaseFailureException;
 
+    ReleaseResult prepareWithResult( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects, boolean resume,
+                           boolean dryRun, ReleaseManagerListener listener );
+
     void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects,
-                  File checkoutDirectory, String goals, boolean useReleaseProfile,
-                  ReleaseManagerListener listener )
+                           File checkoutDirectory, String goals, boolean useReleaseProfile,
+                           ReleaseManagerListener listener )
         throws ReleaseExecutionException, ReleaseFailureException;
+
+    ReleaseResult performWithResult( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects,
+                           File checkoutDirectory, String goals, boolean useReleaseProfile,
+                           ReleaseManagerListener listener );
 }

Added: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseResult.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseResult.java?view=auto&rev=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseResult.java (added)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseResult.java Wed Sep 13 21:28:48 2006
@@ -0,0 +1,132 @@
+package org.apache.maven.plugins.release;
+
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+/**
+ * @author Edwin Punzalan
+ */
+public class ReleaseResult
+{
+    public static final int UNDEFINED = -1, SUCCESS = 0, ERROR = 1;
+
+    private StringBuffer stdOut = new StringBuffer();
+
+    private int resultCode = UNDEFINED;
+
+    private long startTime;
+
+    private long endTime;
+
+    private final String LS = System.getProperty( "line.separator" );
+
+    public void appendInfo( String message )
+    {
+        stdOut.append( "[INFO] " ).append( message ).append( LS );
+    }
+
+    public void appendWarn( String message )
+    {
+        stdOut.append( "[WARN] " ).append( message ).append( LS );
+    }
+
+    public void appendDebug( String message )
+    {
+        stdOut.append( "[DEBUG] " ).append( message ).append( LS );
+    }
+
+    public void appendDebug( String message, Exception e )
+    {
+        appendDebug( message );
+
+        stdOut.append( getStackTrace( e ) ).append( LS );
+    }
+
+    public void appendError( String message )
+    {
+        stdOut.append( "[ERROR] " ).append( message ).append( LS );
+
+        setResultCode( ERROR );
+    }
+
+    public void appendError( Exception e )
+    {
+        appendError( getStackTrace( e ) );
+    }
+
+    public void appendError( String message, Exception e )
+    {
+        appendError( message );
+
+        stdOut.append( getStackTrace( e ) ).append( LS );
+    }
+
+    public String getOutput()
+    {
+        return stdOut.toString();
+    }
+
+    public int getResultCode()
+    {
+        return resultCode;
+    }
+
+    public void setResultCode( int resultCode )
+    {
+        this.resultCode = resultCode;
+    }
+
+    public long getStartTime()
+    {
+        return startTime;
+    }
+
+    public void setStartTime( long startTime )
+    {
+        this.startTime = startTime;
+    }
+
+    public long getEndTime()
+    {
+        return endTime;
+    }
+
+    public void setEndTime( long endTime )
+    {
+        this.endTime = endTime;
+    }
+
+    private String getStackTrace( Exception e )
+    {
+        ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+
+        PrintStream stream = new PrintStream( byteStream );
+
+        e.printStackTrace( stream );
+
+        stream.flush();
+
+        return byteStream.toString();
+    }
+
+    public StringBuffer getOutputBuffer()
+    {
+        return stdOut;
+    }
+}

Propchange: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/ForkedMavenExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/ForkedMavenExecutor.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/ForkedMavenExecutor.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/ForkedMavenExecutor.java Wed Sep 13 21:28:48 2006
@@ -42,8 +42,8 @@
     /**
      * @noinspection UseOfSystemOutOrSystemErr
      */
-    public void executeGoals( File workingDirectory, String goals, boolean interactive, String additionalArguments,
-                              String pomFileName )
+    public void executeGoals( File workingDirectory, String goals, boolean interactive,
+                                             String additionalArguments, String pomFileName )
         throws MavenExecutorException
     {
         Commandline cl = commandLineFactory.createCommandLine( "mvn" );
@@ -102,7 +102,8 @@
         }
     }
 
-    public void executeGoals( File workingDirectory, String goals, boolean interactive, String arguments )
+    public void executeGoals( File workingDirectory, String goals, boolean interactive,
+                                             String arguments )
         throws MavenExecutorException
     {
         executeGoals( workingDirectory, goals, interactive, arguments, null );

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutor.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutor.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutor.java Wed Sep 13 21:28:48 2006
@@ -40,8 +40,8 @@
      * @param pomFileName         the file name of the POM to execute on
      * @throws MavenExecutorException if an error occurred executing Maven
      */
-    void executeGoals( File workingDirectory, String goals, boolean interactive, String additionalArguments,
-                       String pomFileName )
+    void executeGoals( File workingDirectory, String goals, boolean interactive,
+                                      String additionalArguments, String pomFileName )
         throws MavenExecutorException;
 
     /**
@@ -53,6 +53,7 @@
      * @param additionalArguments additional arguments to pass to the Maven command
      * @throws MavenExecutorException if an error occurred executing Maven
      */
-    void executeGoals( File workingDirectory, String goals, boolean interactive, String additionalArguments )
+    void executeGoals( File workingDirectory, String goals, boolean interactive,
+                                      String additionalArguments )
         throws MavenExecutorException;
 }

Added: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutorResult.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutorResult.java?view=auto&rev=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutorResult.java (added)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutorResult.java Wed Sep 13 21:28:48 2006
@@ -0,0 +1,59 @@
+package org.apache.maven.plugins.release.exec;
+
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author Edwin Punzalan
+ */
+public class MavenExecutorResult
+{
+    private int exitCode;
+
+    private String sOut;
+
+    private String sErr;
+
+    public int getExitCode()
+    {
+        return exitCode;
+    }
+
+    public void setExitCode( int exitCode )
+    {
+        this.exitCode = exitCode;
+    }
+
+    public String getsOut()
+    {
+        return sOut;
+    }
+
+    public void setsOut( String sOut )
+    {
+        this.sOut = sOut;
+    }
+
+    public String getsErr()
+    {
+        return sErr;
+    }
+
+    public void setsErr( String sErr )
+    {
+        this.sErr = sErr;
+    }
+}

Propchange: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/exec/MavenExecutorResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java Wed Sep 13 21:28:48 2006
@@ -17,6 +17,7 @@
  */
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.apache.maven.plugins.release.ReleaseResult;
 
 import java.util.List;
 
@@ -29,8 +30,37 @@
     extends AbstractLogEnabled
     implements ReleasePhase
 {
-    public void clean( List reactorProjects )
+    public ReleaseResult clean( List reactorProjects )
     {
         // nothing to do by default
+
+        return getReleaseResultSuccess();
+    }
+
+    protected void logInfo( ReleaseResult result, String message )
+    {
+        result.appendInfo( message );
+        getLogger().info( message );
+    }
+
+    protected void logWarn( ReleaseResult result, String message )
+    {
+        result.appendWarn( message );
+        getLogger().warn( message );
+    }
+
+    protected void logDebug( ReleaseResult result, String message, Exception e )
+    {
+        result.appendDebug( message, e );
+        getLogger().debug( message, e );
+    }
+
+    protected ReleaseResult getReleaseResultSuccess()
+    {
+        ReleaseResult result = new ReleaseResult();
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java Wed Sep 13 21:28:48 2006
@@ -23,6 +23,7 @@
 import org.apache.maven.model.ReportPlugin;
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.plugins.release.scm.ReleaseScmCommandException;
 import org.apache.maven.plugins.release.scm.ReleaseScmRepositoryException;
@@ -85,28 +86,34 @@
      */
     private String pomSuffix;
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        transform( releaseDescriptor, settings, reactorProjects, false );
+        ReleaseResult result = new ReleaseResult();
+
+        transform( releaseDescriptor, settings, reactorProjects, false, result );
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
     private void transform( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects,
-                            boolean simulate )
+                            boolean simulate, ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         for ( Iterator it = reactorProjects.iterator(); it.hasNext(); )
         {
             MavenProject project = (MavenProject) it.next();
 
-            getLogger().info( "Transforming '" + project.getName() + "'..." );
+            logInfo( result, "Transforming '" + project.getName() + "'..." );
 
-            transformProject( project, releaseDescriptor, settings, reactorProjects, simulate );
+            transformProject( project, releaseDescriptor, settings, reactorProjects, simulate, result );
         }
     }
 
     private void transformProject( MavenProject project, ReleaseDescriptor releaseDescriptor, Settings settings,
-                                   List reactorProjects, boolean simulate )
+                                   List reactorProjects, boolean simulate, ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         Document document;
@@ -165,7 +172,8 @@
             throw new ReleaseExecutionException( "Unable to configure SCM repository: " + e.getMessage(), e );
         }
 
-        transformDocument( project, document.getRootElement(), releaseDescriptor, reactorProjects, scmRepository );
+        transformDocument( project, document.getRootElement(), releaseDescriptor,
+                           reactorProjects, scmRepository, result );
 
         if ( simulate )
         {
@@ -190,7 +198,7 @@
     }
 
     private void transformDocument( MavenProject project, Element rootElement, ReleaseDescriptor releaseDescriptor,
-                                    List reactorProjects, ScmRepository scmRepository )
+                                    List reactorProjects, ScmRepository scmRepository, ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         Namespace namespace = rootElement.getNamespace();
@@ -203,7 +211,8 @@
 
         rewriteVersion( rootElement, namespace, mappedVersions, projectId, project, parentVersion );
 
-        rewriteDependencies( project.getDependencies(), rootElement, mappedVersions, originalVersions, projectId );
+        rewriteDependencies( project.getDependencies(), rootElement, mappedVersions, originalVersions,
+                             projectId, result );
 
         if ( project.getDependencyManagement() != null )
         {
@@ -211,7 +220,7 @@
             if ( dependencyRoot != null )
             {
                 rewriteDependencies( project.getDependencyManagement().getDependencies(), dependencyRoot,
-                                     mappedVersions, originalVersions, projectId );
+                                     mappedVersions, originalVersions, projectId, result );
             }
         }
 
@@ -220,18 +229,19 @@
             Element buildRoot = rootElement.getChild( "build", namespace );
             if ( buildRoot != null )
             {
-                rewritePlugins( project.getBuildPlugins(), buildRoot, mappedVersions, originalVersions, projectId );
+                rewritePlugins( project.getBuildPlugins(), buildRoot, mappedVersions,
+                                originalVersions, projectId, result );
                 if ( project.getPluginManagement() != null )
                 {
                     Element pluginsRoot = buildRoot.getChild( "pluginManagement", namespace );
                     if ( pluginsRoot != null )
                     {
                         rewritePlugins( project.getPluginManagement().getPlugins(), pluginsRoot, mappedVersions,
-                                        originalVersions, projectId );
+                                        originalVersions, projectId, result );
                     }
                 }
                 rewriteExtensions( project.getBuildExtensions(), buildRoot, mappedVersions, originalVersions,
-                                   projectId );
+                                   projectId, result );
             }
         }
 
@@ -241,11 +251,11 @@
             if ( pluginsRoot != null )
             {
                 rewriteReportPlugins( project.getReportPlugins(), pluginsRoot, mappedVersions, originalVersions,
-                                      projectId );
+                                      projectId, result );
             }
         }
 
-        transformScm( project, rootElement, namespace, releaseDescriptor, projectId, scmRepository );
+        transformScm( project, rootElement, namespace, releaseDescriptor, projectId, scmRepository, result );
     }
 
     private void rewriteVersion( Element rootElement, Namespace namespace, Map mappedVersions, String projectId,
@@ -307,7 +317,7 @@
     }
 
     private void rewriteDependencies( List dependencies, Element dependencyRoot, Map mappedVersions,
-                                      Map originalVersions, String projectId )
+                                      Map originalVersions, String projectId, ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         if ( dependencies != null )
@@ -317,13 +327,13 @@
                 Dependency dep = (Dependency) i.next();
 
                 updateDomVersion( dep.getGroupId(), dep.getArtifactId(), mappedVersions, dep.getVersion(),
-                                  originalVersions, "dependencies", "dependency", dependencyRoot, projectId );
+                                  originalVersions, "dependencies", "dependency", dependencyRoot, projectId, result );
             }
         }
     }
 
     private void rewritePlugins( List plugins, Element pluginRoot, Map mappedVersions, Map originalVersions,
-                                 String projectId )
+                                 String projectId, ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         if ( plugins != null )
@@ -336,14 +346,14 @@
                 if ( plugin.getVersion() != null )
                 {
                     updateDomVersion( plugin.getGroupId(), plugin.getArtifactId(), mappedVersions, plugin.getVersion(),
-                                      originalVersions, "plugins", "plugin", pluginRoot, projectId );
+                                      originalVersions, "plugins", "plugin", pluginRoot, projectId, result );
                 }
             }
         }
     }
 
     private void rewriteExtensions( List extensions, Element extensionRoot, Map mappedVersions, Map originalVersions,
-                                    String projectId )
+                                    String projectId, ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         if ( extensions != null )
@@ -354,13 +364,13 @@
 
                 updateDomVersion( extension.getGroupId(), extension.getArtifactId(), mappedVersions,
                                   extension.getVersion(), originalVersions, "extensions", "extension", extensionRoot,
-                                  projectId );
+                                  projectId, result );
             }
         }
     }
 
     private void rewriteReportPlugins( List plugins, Element pluginRoot, Map mappedVersions, Map originalVersions,
-                                       String projectId )
+                                       String projectId, ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         if ( plugins != null )
@@ -373,7 +383,7 @@
                 if ( plugin.getVersion() != null )
                 {
                     updateDomVersion( plugin.getGroupId(), plugin.getArtifactId(), mappedVersions, plugin.getVersion(),
-                                      originalVersions, "plugins", "plugin", pluginRoot, projectId );
+                                      originalVersions, "plugins", "plugin", pluginRoot, projectId, result );
                 }
             }
         }
@@ -381,7 +391,7 @@
 
     private void updateDomVersion( String groupId, String artifactId, Map mappedVersions, String version,
                                    Map originalVersions, String groupTagName, String tagName, Element dependencyRoot,
-                                   String projectId )
+                                   String projectId, ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         String key = ArtifactUtils.versionlessKey( groupId, artifactId );
@@ -392,7 +402,7 @@
         {
             if ( mappedVersion != null )
             {
-                getLogger().debug( "Updating " + artifactId + " to " + mappedVersion );
+                logInfo( result, "Updating " + artifactId + " to " + mappedVersion );
 
                 try
                 {
@@ -525,14 +535,22 @@
         }
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        transform( releaseDescriptor, settings, reactorProjects, true );
+        ReleaseResult result = new ReleaseResult();
+
+        transform( releaseDescriptor, settings, reactorProjects, true, result );
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void clean( List reactorProjects )
+    public ReleaseResult clean( List reactorProjects )
     {
+        ReleaseResult result = new ReleaseResult();
+
         super.clean( reactorProjects );
 
         if ( reactorProjects != null )
@@ -549,6 +567,10 @@
                 }
             }
         }
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
     protected abstract Map getOriginalVersionMap( ReleaseDescriptor releaseDescriptor, List reactorProjects );
@@ -557,7 +579,7 @@
 
     protected abstract void transformScm( MavenProject project, Element rootElement, Namespace namespace,
                                           ReleaseDescriptor releaseDescriptor, String projectId,
-                                          ScmRepository scmRepository )
+                                          ScmRepository scmRepository, ReleaseResult result )
         throws ReleaseExecutionException;
 
     protected Element rewriteElement( String name, String value, Element root, Namespace namespace )

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java Wed Sep 13 21:28:48 2006
@@ -20,6 +20,7 @@
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.settings.Settings;
@@ -50,10 +51,12 @@
      */
     private Prompter prompter;
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        getLogger().info( "Checking dependencies and plugins for snapshots ..." );
+        ReleaseResult result = new ReleaseResult();
+
+        logInfo( result, "Checking dependencies and plugins for snapshots ..." );
 
         Map originalVersions = releaseDescriptor.getOriginalVersions( reactorProjects );
 
@@ -63,6 +66,10 @@
 
             checkProject( project, originalVersions, releaseDescriptor );
         }
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
     private void checkProject( MavenProject project, Map originalVersions, ReleaseDescriptor releaseDescriptor )
@@ -183,11 +190,11 @@
             !artifact.getBaseVersion().equals( originalVersions.get( versionlessArtifactKey ) );
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         // It makes no modifications, so simulate is the same as execute
-        execute( releaseDescriptor, settings, reactorProjects );
+        return execute( releaseDescriptor, settings, reactorProjects );
     }
 
     public void setPrompter( Prompter prompter )

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java Wed Sep 13 21:28:48 2006
@@ -19,6 +19,7 @@
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.plugins.release.scm.ReleaseScmRepositoryException;
 import org.apache.maven.plugins.release.scm.ScmRepositoryConfigurator;
@@ -44,9 +45,11 @@
      */
     private ScmRepositoryConfigurator scmRepositoryConfigurator;
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
+        ReleaseResult result = new ReleaseResult();
+
         // Currently, we don't deal with multiple SCM locations in a multiproject
         if ( StringUtils.isEmpty( releaseDescriptor.getScmSourceUrl() ) )
         {
@@ -96,12 +99,16 @@
                     "The project " + projectId + " isn't a snapshot (" + project.getVersion() + ")." );
             }
         }
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         // It makes no modifications, so simulate is the same as execute
-        execute( releaseDescriptor, settings, reactorProjects );
+        return execute( releaseDescriptor, settings, reactorProjects );
     }
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java Wed Sep 13 21:28:48 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.settings.Settings;
 
@@ -32,15 +33,27 @@
     extends AbstractReleasePhase
 {
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        getLogger().info( "Release preparation complete." );
+        ReleaseResult result = new ReleaseResult();
+
+        logInfo( result, "Release preparation complete." );
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        getLogger().info( "Release preparation simulation complete." );
+        ReleaseResult result = new ReleaseResult();
+
+        logInfo( result, "Release preparation simulation complete." );
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java Wed Sep 13 21:28:48 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.settings.Settings;
 
@@ -30,15 +31,21 @@
 public class GenerateReleasePomsPhase
     extends AbstractReleasePhase
 {
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException
     {
+        ReleaseResult result = new ReleaseResult();
+
         if ( releaseDescriptor.isGenerateReleasePoms() )
         {
-            getLogger().info( "Generating release POMs..." );
+            logInfo( result, "Generating release POMs..." );
 
             generateReleasePoms();
         }
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
     private void generateReleasePoms()
@@ -369,9 +376,13 @@
     }
 */
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
     {
         // TODO [!]: implement
+        ReleaseResult result = new ReleaseResult();
+
+        result.setResultCode( ReleaseResult.SUCCESS );
 
+        return result;
     }
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java Wed Sep 13 21:28:48 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.plugins.release.ReleaseExecutionException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.settings.Settings;
@@ -44,9 +45,11 @@
         this.prompter = prompter;
     }
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException
     {
+        ReleaseResult result = new ReleaseResult();
+
         // get the root project
         MavenProject project = (MavenProject) reactorProjects.get( 0 );
 
@@ -82,13 +85,23 @@
             }
             releaseDescriptor.setScmReleaseLabel( tag );
         }
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException
     {
+        ReleaseResult result = new ReleaseResult();
+
         // It makes no modifications, so simulate is the same as execute
         execute( releaseDescriptor, settings, reactorProjects );
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java Wed Sep 13 21:28:48 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.plugins.release.ReleaseExecutionException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.plugins.release.versions.DefaultVersionInfo;
 import org.apache.maven.plugins.release.versions.VersionInfo;
@@ -54,9 +55,11 @@
         this.prompter = prompter;
     }
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException
     {
+        ReleaseResult result = new ReleaseResult();
+
         for ( Iterator i = reactorProjects.iterator(); i.hasNext(); )
         {
             MavenProject project = (MavenProject) i.next();
@@ -73,8 +76,8 @@
                 String msg = "Error parsing version, cannot determine next version: " + e.getMessage();
                 if ( releaseDescriptor.isInteractive() )
                 {
-                    getLogger().warn( msg );
-                    getLogger().debug( e.getMessage(), e );
+                    logWarn( result, msg );
+                    logDebug( result, e.getMessage(), e );
                 }
                 else
                 {
@@ -140,13 +143,23 @@
                 throw new ReleaseExecutionException( "Error reading version from input handler: " + e.getMessage(), e );
             }
         }
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException
     {
+        ReleaseResult result = new ReleaseResult();
+
         // It makes no modifications, so simulate is the same as execute
         execute( releaseDescriptor, settings, reactorProjects );
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java Wed Sep 13 21:28:48 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.settings.Settings;
 
@@ -44,7 +45,7 @@
      * @throws ReleaseExecutionException an exception during the execution of the phase
      * @throws ReleaseFailureException   a failure during the execution of the phase
      */
-    void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException;
 
     /**
@@ -56,7 +57,7 @@
      * @throws ReleaseExecutionException an exception during the execution of the phase
      * @throws ReleaseFailureException   a failure during the execution of the phase
      */
-    void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException;
 
     /**
@@ -64,5 +65,5 @@
      *
      * @param reactorProjects the reactor projects
      */
-    void clean( List reactorProjects );
+    ReleaseResult clean( List reactorProjects );
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java Wed Sep 13 21:28:48 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.settings.Settings;
 
@@ -30,11 +31,13 @@
 public class RemoveReleasePomsPhase
     extends AbstractReleasePhase
 {
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException
     {
+        ReleaseResult result = new ReleaseResult();
+
         // TODO [!]: implement
-        getLogger().info( "Removing release POMs..." );
+        logInfo( result, "Removing release POMs..." );
 
 /*
         File currentReleasePomFile = null;
@@ -80,10 +83,20 @@
         }
 
 */
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
     {
+        ReleaseResult result = new ReleaseResult();
+
         // TODO [!]: implement
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhase.java Wed Sep 13 21:28:48 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.model.Scm;
 import org.apache.maven.plugins.release.ReleaseExecutionException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.plugins.release.scm.ScmTranslator;
 import org.apache.maven.project.MavenProject;
@@ -42,7 +43,8 @@
     private Map scmTranslators;
 
     protected void transformScm( MavenProject project, Element rootElement, Namespace namespace,
-                                 ReleaseDescriptor releaseDescriptor, String projectId, ScmRepository scmRepository )
+                                 ReleaseDescriptor releaseDescriptor, String projectId, ScmRepository scmRepository,
+                                 ReleaseResult result )
         throws ReleaseExecutionException
     {
         // If SCM is null in original model, it is inherited, no mods needed
@@ -79,7 +81,9 @@
                 }
                 else
                 {
-                    getLogger().debug( "No SCM translator found - skipping rewrite" );
+                    String message = "No SCM translator found - skipping rewrite";
+                    result.appendDebug( message );
+                    getLogger().debug( message );
                 }
             }
         }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhase.java Wed Sep 13 21:28:48 2006
@@ -20,6 +20,7 @@
 import org.apache.maven.model.Scm;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.plugins.release.scm.ScmTranslator;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.jdom.Element;
@@ -42,7 +43,8 @@
     private Map scmTranslators;
 
     protected void transformScm( MavenProject project, Element rootElement, Namespace namespace,
-                                 ReleaseDescriptor releaseDescriptor, String projectId, ScmRepository scmRepository )
+                                 ReleaseDescriptor releaseDescriptor, String projectId, ScmRepository scmRepository,
+                                 ReleaseResult result )
     {
         // If SCM is null in original model, it is inherited, no mods needed
         if ( project.getScm() != null )
@@ -52,7 +54,7 @@
             {
                 releaseDescriptor.mapOriginalScmInfo( projectId, project.getScm() );
 
-                translateScm( project, releaseDescriptor, scmRoot, namespace, scmRepository );
+                translateScm( project, releaseDescriptor, scmRoot, namespace, scmRepository, result );
             }
             else
             {
@@ -70,7 +72,7 @@
                         scmRoot = new Element( "scm" );
                         scmRoot.addContent( "\n  " );
 
-                        if ( translateScm( project, releaseDescriptor, scmRoot, namespace, scmRepository ) )
+                        if ( translateScm( project, releaseDescriptor, scmRoot, namespace, scmRepository, result ) )
                         {
                             rootElement.addContent( "\n  " ).addContent( scmRoot ).addContent( "\n" );
                         }
@@ -81,7 +83,7 @@
     }
 
     private boolean translateScm( MavenProject project, ReleaseDescriptor releaseDescriptor, Element scmRoot,
-                                  Namespace namespace, ScmRepository scmRepository )
+                                  Namespace namespace, ScmRepository scmRepository, ReleaseResult relResult )
     {
         ScmTranslator translator = (ScmTranslator) scmTranslators.get( scmRepository.getProvider() );
         boolean result = false;
@@ -139,7 +141,11 @@
         }
         else
         {
-            getLogger().debug( "No SCM translator found - skipping rewrite" );
+            String message = "No SCM translator found - skipping rewrite";
+
+            relResult.appendDebug( message );
+
+            getLogger().debug( message );
         }
         return result;
     }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java Wed Sep 13 21:28:48 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.plugins.release.exec.MavenExecutor;
 import org.apache.maven.plugins.release.exec.MavenExecutorException;
@@ -39,15 +40,17 @@
      */
     private MavenExecutor mavenExecutor;
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException
     {
+        ReleaseResult result = new ReleaseResult();
+
         try
         {
             String goals = releaseDescriptor.getPreparationGoals();
             if ( !StringUtils.isEmpty( goals ) )
             {
-                getLogger().info( "Executing preparation goals '" + goals + "'..." );
+                logInfo( result, "Executing preparation goals '" + goals + "'..." );
 
                 mavenExecutor.executeGoals( new File( releaseDescriptor.getWorkingDirectory() ), goals,
                                             releaseDescriptor.isInteractive(),
@@ -58,15 +61,23 @@
         {
             throw new ReleaseExecutionException( e.getMessage(), e );
         }
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException
     {
-        getLogger().info(
-            "Executing preparation goals - since this is simulation mode it is running against the original project, not the rewritten ones" );
+        ReleaseResult result = new ReleaseResult();
+
+        logInfo( result, "Executing preparation goals - since this is simulation mode it is running against the " +
+                         "original project, not the rewritten ones" );
 
         execute( releaseDescriptor, settings, reactorProjects );
+
+        return result;
     }
 
     public void setMavenExecutor( MavenExecutor mavenExecutor )

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java Wed Sep 13 21:28:48 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.plugins.release.scm.ReleaseScmCommandException;
 import org.apache.maven.plugins.release.scm.ReleaseScmRepositoryException;
@@ -60,10 +61,12 @@
     private Set excludedFiles = new HashSet( Arrays.asList(
         new String[]{"pom.xml", "pom.xml.backup", "pom.xml.tag", "pom.xml.next", "release.properties"} ) );
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        getLogger().info( "Verifying that there are no local modifications..." );
+        ReleaseResult relResult = new ReleaseResult();
+
+        logInfo( relResult, "Verifying that there are no local modifications..." );
 
         ScmRepository repository;
         ScmProvider provider;
@@ -132,12 +135,16 @@
             throw new ReleaseFailureException(
                 "Cannot prepare the release because you have local modifications : \n" + message );
         }
+
+        relResult.setResultCode( ReleaseResult.SUCCESS );
+
+        return relResult;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         // It makes no modifications, so simulate is the same as execute
-        execute( releaseDescriptor, settings, reactorProjects );
+        return execute( releaseDescriptor, settings, reactorProjects );
     }
 }

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java Wed Sep 13 21:28:48 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.plugins.release.scm.ReleaseScmCommandException;
 import org.apache.maven.plugins.release.scm.ReleaseScmRepositoryException;
@@ -57,9 +58,11 @@
      */
     private String messageFormat;
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
+        ReleaseResult relResult = new ReleaseResult();
+
         validateConfiguration( releaseDescriptor );
 
         getLogger().info( "Checking in modified POMs..." );
@@ -98,16 +101,26 @@
         {
             throw new ReleaseScmCommandException( "Unable to commit files", result );
         }
+
+        relResult.setResultCode( ReleaseResult.SUCCESS );
+
+        return relResult;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
+        ReleaseResult result = new ReleaseResult();
+
         validateConfiguration( releaseDescriptor );
 
         Collection pomFiles = createPomFiles( reactorProjects );
-        getLogger().info( "Full run would be checking in " + pomFiles.size() + " files with message: '" +
+        logInfo( result, "Full run would be checking in " + pomFiles.size() + " files with message: '" +
             createMessage( releaseDescriptor ) + "'" );
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
     private static void validateConfiguration( ReleaseDescriptor releaseDescriptor )

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java Wed Sep 13 21:28:48 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.apache.maven.plugins.release.scm.ReleaseScmCommandException;
 import org.apache.maven.plugins.release.scm.ReleaseScmRepositoryException;
@@ -47,12 +48,14 @@
      */
     private ScmRepositoryConfigurator scmRepositoryConfigurator;
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
+        ReleaseResult relResult = new ReleaseResult();
+
         validateConfiguration( releaseDescriptor );
 
-        getLogger().info( "Tagging release with the label " + releaseDescriptor.getScmReleaseLabel() + "..." );
+        logInfo( relResult, "Tagging release with the label " + releaseDescriptor.getScmReleaseLabel() + "..." );
 
         ScmRepository repository;
         ScmProvider provider;
@@ -87,15 +90,25 @@
         {
             throw new ReleaseScmCommandException( "Unable to tag SCM", result );
         }
+
+        relResult.setResultCode( ReleaseResult.SUCCESS );
+
+        return relResult;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
+        ReleaseResult result = new ReleaseResult();
+
         validateConfiguration( releaseDescriptor );
 
-        getLogger().info( "Full run would be tagging " + releaseDescriptor.getWorkingDirectory() + " with label: '" +
+        logInfo( result, "Full run would be tagging " + releaseDescriptor.getWorkingDirectory() + " with label: '" +
             releaseDescriptor.getScmReleaseLabel() + "'" );
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
     private static void validateConfiguration( ReleaseDescriptor releaseDescriptor )

Modified: maven/continuum/branches/release-integration/maven/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/maven/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java?view=diff&rev=443225&r1=443224&r2=443225
==============================================================================
--- maven/continuum/branches/release-integration/maven/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java (original)
+++ maven/continuum/branches/release-integration/maven/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java Wed Sep 13 21:28:48 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.settings.Settings;
 
 import java.util.List;
@@ -44,19 +45,37 @@
      */
     private boolean cleaned;
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
     {
+        ReleaseResult result = new ReleaseResult();
+
         executed = true;
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
     {
+        ReleaseResult result = new ReleaseResult();
+
         simulated = true;
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void clean( List reactorProjects )
+    public ReleaseResult clean( List reactorProjects )
     {
+        ReleaseResult result = new ReleaseResult();
+
         cleaned = true;
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
     public boolean isExecuted()



Mime
View raw message