continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r755103 - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/configuration/ continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/ continuum-core/src/main/java/org/apache/continuum/release/distribut...
Date Tue, 17 Mar 2009 03:14:32 GMT
Author: ctan
Date: Tue Mar 17 03:14:30 2009
New Revision: 755103

URL: http://svn.apache.org/viewvc?rev=755103&view=rev
Log:
[CONTINUUM-2136] added actionErrors during release when build agent has been removed or disabled.
Show error message in a new page.

Added:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/BuildAgentConfigurationException.java
Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/struts.xml

Added: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/BuildAgentConfigurationException.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/BuildAgentConfigurationException.java?rev=755103&view=auto
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/BuildAgentConfigurationException.java
(added)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/BuildAgentConfigurationException.java
Tue Mar 17 03:14:30 2009
@@ -0,0 +1,20 @@
+package org.apache.continuum.configuration;
+
+public class BuildAgentConfigurationException
+    extends Exception
+{
+    public BuildAgentConfigurationException( String message )
+    {
+        super( message );
+    }
+
+    public BuildAgentConfigurationException( Throwable cause )
+    {
+        super( cause );
+    }
+
+    public BuildAgentConfigurationException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+}

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
Tue Mar 17 03:14:30 2009
@@ -23,6 +23,7 @@
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.release.ContinuumReleaseException;
@@ -31,40 +32,40 @@
 public interface DistributedReleaseManager
 {
     Map getReleasePluginParameters( int projectId, String pomFilename )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     List<Map<String, String>> processProject( int projectId, String pomFilename,
boolean autoVersionSubmodules )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     String releasePrepare( Project project, Properties releaseProperties, Map<String,
String> releaseVersion, 
                            Map<String, String> developmentVersion, Map<String, String>
environments )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     ReleaseResult getReleaseResult( String releaseId )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     Map getListener( String releaseId )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     void removeListener( String releaseId )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     String getPreparedReleaseName( String releaseId )
         throws ContinuumReleaseException;
 
     void releasePerform( int projectId, String releaseId, String goals, String arguments,
boolean useReleaseProfile, LocalRepository repository )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     void releasePerformFromScm( int projectId, String goals, String arguments, boolean useReleaseProfile,
LocalRepository repository, 
                                 String scmUrl, String scmUsername, String scmPassword, String
scmTag, String scmTagBase, Map environments )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     void releaseRollback( String releaseId, int projectId )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     String releaseCleanup( String releaseId )
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 
     List<Map> getAllReleasesInProgress()
-        throws ContinuumReleaseException;
+        throws ContinuumReleaseException, BuildAgentConfigurationException;
 }
\ No newline at end of file

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
Tue Mar 17 03:14:30 2009
@@ -32,6 +32,8 @@
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.continuum.configuration.BuildAgentConfiguration;
+import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportClient;
 import org.apache.continuum.model.repository.LocalRepository;
@@ -40,6 +42,7 @@
 import org.apache.continuum.release.model.PreparedReleaseModel;
 import org.apache.continuum.release.model.io.xpp3.ContinuumPrepareReleasesModelXpp3Reader;
 import org.apache.continuum.release.model.io.xpp3.ContinuumPrepareReleasesModelXpp3Writer;
+import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
@@ -70,15 +73,25 @@
      */
     InstallationService installationService;
 
+    /**
+     * @plexus.requirement
+     */
+    ConfigurationService configurationService;
+
     private Map<String, Map> releasesInProgress;
 
     public Map getReleasePluginParameters( int projectId, String pomFilename )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( projectId
);
 
         String buildAgentUrl = buildResult.getBuildUrl();
 
+        if ( !checkBuildAgent( buildAgentUrl ) )
+        {
+            throw new BuildAgentConfigurationException( buildAgentUrl );
+        }
+
         try
         {
             SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new
URL( buildAgentUrl ) );
@@ -97,12 +110,17 @@
     }
 
     public List<Map<String, String>> processProject( int projectId, String pomFilename,
boolean autoVersionSubmodules )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( projectId
);
 
         String buildAgentUrl = buildResult.getBuildUrl();
 
+        if ( !checkBuildAgent( buildAgentUrl ) )
+        {
+            throw new BuildAgentConfigurationException( buildAgentUrl );
+        }
+
         try
         {
             SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new
URL( buildAgentUrl ) );
@@ -122,15 +140,15 @@
 
     public String releasePrepare( Project project, Properties releaseProperties, Map<String,
String> releaseVersion, 
                                   Map<String, String> developmentVersion, Map<String,
String> environments )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( project.getId()
);
 
         String buildAgentUrl = buildResult.getBuildUrl();
 
-        if ( StringUtils.isBlank( buildAgentUrl ) )
+        if ( !checkBuildAgent( buildAgentUrl ) )
         {
-            return null;
+            throw new BuildAgentConfigurationException( buildAgentUrl );
         }
 
         try
@@ -158,13 +176,13 @@
     }
 
     public ReleaseResult getReleaseResult( String releaseId )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         String buildAgentUrl = getBuildAgentUrl( releaseId );
 
-        if ( StringUtils.isBlank( buildAgentUrl ) )
+        if ( !checkBuildAgent( buildAgentUrl ) )
         {
-            return null;
+            throw new BuildAgentConfigurationException( buildAgentUrl );
         }
 
         try
@@ -193,13 +211,13 @@
     }
 
     public Map getListener( String releaseId )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         String buildAgentUrl = getBuildAgentUrl( releaseId );
 
-        if ( StringUtils.isBlank( buildAgentUrl ) )
+        if ( !checkBuildAgent( buildAgentUrl ) )
         {
-            return null;
+            throw new BuildAgentConfigurationException( buildAgentUrl );
         }
 
         try
@@ -220,13 +238,13 @@
     }
 
     public void removeListener( String releaseId )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         String buildAgentUrl = getBuildAgentUrl( releaseId );
 
-        if ( StringUtils.isBlank( buildAgentUrl ) )
+        if ( !checkBuildAgent( buildAgentUrl ) )
         {
-            return;
+            throw new BuildAgentConfigurationException( buildAgentUrl );
         }
 
         try
@@ -276,14 +294,13 @@
 
     public void releasePerform( int projectId, String releaseId, String goals, String arguments,
boolean useReleaseProfile, 
                                 LocalRepository repository )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         String buildAgentUrl = getBuildAgentUrl( releaseId );
 
-        if ( StringUtils.isBlank( buildAgentUrl ) )
+        if ( !checkBuildAgent( buildAgentUrl ) )
         {
-            log.error( "Unable to perform release because no build agent found for " + releaseId
);
-            return;
+            throw new BuildAgentConfigurationException( buildAgentUrl );
         }
 
         if ( goals == null )
@@ -326,18 +343,17 @@
 
     public void releasePerformFromScm( int projectId, String goals, String arguments, boolean
useReleaseProfile, LocalRepository repository, 
                                        String scmUrl, String scmUsername, String scmPassword,
String scmTag, String scmTagBase, Map environments )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( projectId
);
 
         String buildAgentUrl = buildResult.getBuildUrl();
 
-        if ( StringUtils.isBlank( buildAgentUrl ) )
+        if ( !checkBuildAgent( buildAgentUrl ) )
         {
-            log.error( "Unable to perform release because no build agent found" );
-            return;
+            throw new BuildAgentConfigurationException( buildAgentUrl );
         }
-        
+
         if ( goals == null )
         {
             goals = "";
@@ -378,14 +394,13 @@
     }
 
     public void releaseRollback( String releaseId, int projectId )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         String buildAgentUrl = getBuildAgentUrl( releaseId );
 
-        if ( StringUtils.isBlank( buildAgentUrl ) )
+        if ( !checkBuildAgent( buildAgentUrl ) )
         {
-            log.info( "Unable to rollback release " + releaseId + " because no build agent
found" );
-            return;
+            throw new BuildAgentConfigurationException( buildAgentUrl );
         }
 
         try
@@ -406,14 +421,13 @@
     }
 
     public String releaseCleanup( String releaseId )
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         String buildAgentUrl = getBuildAgentUrl( releaseId );
 
-        if ( StringUtils.isBlank( buildAgentUrl ) )
+        if ( !checkBuildAgent( buildAgentUrl ) )
         {
-            log.info( "Unable to cleanup release for " + releaseId );
-            return null;
+            throw new BuildAgentConfigurationException( buildAgentUrl );
         }
 
         try
@@ -437,7 +451,7 @@
     }
 
     public List<Map> getAllReleasesInProgress()
-        throws ContinuumReleaseException
+        throws ContinuumReleaseException, BuildAgentConfigurationException
     {
         List<Map> releases = new ArrayList<Map>();
         Map<String, Map> releasesMap = new HashMap<String, Map>();
@@ -450,6 +464,11 @@
 
                 if ( StringUtils.isNotBlank( buildAgentUrl ) )
                 {
+                    if ( !checkBuildAgent( buildAgentUrl ) )
+                    {
+                        throw new BuildAgentConfigurationException( buildAgentUrl );
+                    }
+
                     try
                     {
                         SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient(
new URL( buildAgentUrl ) );
@@ -699,4 +718,17 @@
         return new File( System.getProperty( "appserver.base" ) + File.separator + "conf"
+ File.separator
                          + PREPARED_RELEASES_FILENAME );
     }
+
+    private boolean checkBuildAgent( String buildAgentUrl )
+    {
+        BuildAgentConfiguration buildAgent = configurationService.getBuildAgent( buildAgentUrl
);
+
+        if ( buildAgent != null && buildAgent.isEnabled() )
+        {
+            return true;
+        }
+
+        log.info( "Build agent: " + buildAgentUrl + "is either disabled or removed" );
+        return false;
+    }
 }
\ No newline at end of file

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java
Tue Mar 17 03:14:30 2009
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
@@ -57,15 +61,26 @@
         {
             DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
 
-            String goal = releaseManager.releaseCleanup( releaseId );
-
-            if ( StringUtils.isNotBlank( goal ) )
+            try
             {
-                return goal;
+                String goal = releaseManager.releaseCleanup( releaseId );
+    
+                if ( StringUtils.isNotBlank( goal ) )
+                {
+                    return goal;
+                }
+                else
+                {
+                    throw new Exception( "No listener to cleanup for id " + releaseId );
+                }
             }
-            else
+            catch ( BuildAgentConfigurationException e )
             {
-                throw new Exception( "No listener to cleanup for id " + releaseId );
+                List<String> args = new ArrayList<String>();
+                args.add( e.getMessage() );
+
+                addActionError( getText( "releaseCleanup.error", args ) );
+                return ERROR;
             }
         }
         else

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
Tue Mar 17 03:14:30 2009
@@ -23,8 +23,11 @@
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
+import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.model.release.ContinuumReleaseResult;
 import org.apache.continuum.release.distributed.DistributedReleaseUtil;
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
@@ -80,7 +83,20 @@
         {
             DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
 
-            Map map = releaseManager.getListener( releaseId );
+            Map map; 
+
+            try
+            {
+                map = releaseManager.getListener( releaseId );
+            }
+            catch ( BuildAgentConfigurationException e )
+            {
+                List<String> args = new ArrayList<String>();
+                args.add( e.getMessage() );
+
+                addActionError( getText( "releaseInProgress.error", args ) );
+                return ERROR;
+            }
 
             if ( map != null && !map.isEmpty() )
             {
@@ -184,31 +200,42 @@
         {
             DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
 
-            Map map = releaseManager.getListener( releaseId );
-
-            if ( map != null && !map.isEmpty() )
+            try
             {
-                int state = DistributedReleaseUtil.getReleaseState( map );
-
-                listenerSummary.setPhases( DistributedReleaseUtil.getReleasePhases( map )
);
-                listenerSummary.setCompletedPhases( DistributedReleaseUtil.getCompletedReleasePhases(
map ) );
-                listenerSummary.setInProgress( DistributedReleaseUtil.getReleaseInProgress(
map ) );
-                listenerSummary.setError( DistributedReleaseUtil.getReleaseError( map ) );
-
-                if ( state == ContinuumReleaseManagerListener.FINISHED )
+                Map map = releaseManager.getListener( releaseId );
+    
+                if ( map != null && !map.isEmpty() )
                 {
-                    result = releaseManager.getReleaseResult( releaseId );
+                    int state = DistributedReleaseUtil.getReleaseState( map );
     
-                    return SUCCESS;
+                    listenerSummary.setPhases( DistributedReleaseUtil.getReleasePhases( map
) );
+                    listenerSummary.setCompletedPhases( DistributedReleaseUtil.getCompletedReleasePhases(
map ) );
+                    listenerSummary.setInProgress( DistributedReleaseUtil.getReleaseInProgress(
map ) );
+                    listenerSummary.setError( DistributedReleaseUtil.getReleaseError( map
) );
+    
+                    if ( state == ContinuumReleaseManagerListener.FINISHED )
+                    {
+                        result = releaseManager.getReleaseResult( releaseId );
+        
+                        return SUCCESS;
+                    }
+                    else
+                    {
+                        throw new Exception( "The release operation with id " + releaseId
+ "has not finished yet." );
+                    }
                 }
                 else
                 {
-                    throw new Exception( "The release operation with id " + releaseId + "has
not finished yet." );
+                    throw new Exception( "There is no finished release operation with id
" + releaseId );
                 }
             }
-            else
+            catch ( BuildAgentConfigurationException e )
             {
-                throw new Exception( "There is no finished release operation with id " +
releaseId );
+                List<String> args = new ArrayList<String>();
+                args.add( e.getMessage() );
+                
+                addActionError( getText( "releaseViewResult.error", args ) );
+                return ERROR;
             }
         }
         else

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
Tue Mar 17 03:14:30 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
 import org.apache.continuum.release.distributed.DistributedReleaseUtil;
@@ -40,6 +41,7 @@
 
 import java.io.File;
 import java.io.FileReader;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -113,7 +115,18 @@
             return REQUIRES_AUTHORIZATION;
         }
 
-        init();
+        try
+        {
+            init();
+        }
+        catch ( BuildAgentConfigurationException e )
+        {
+            List<String> args = new ArrayList<String>();
+            args.add( e.getMessage() );
+
+            addActionError( getText( "releasePerform.input.error", args ) ) ;
+            return ERROR;
+        }
 
         populateFromProject();
 
@@ -136,7 +149,19 @@
             return REQUIRES_AUTHORIZATION;
         }
 
-        init();
+        try
+        {
+            init();
+        }
+        catch ( BuildAgentConfigurationException e )
+        {
+            List<String> args = new ArrayList<String>();
+            args.add( e.getMessage() );
+
+            addActionError( getText( "releasePerform.input.error", args ) ) ;
+            return ERROR;
+        }
+
 
         return SUCCESS;
     }
@@ -208,7 +233,18 @@
         {
             DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
 
-            releaseManager.releasePerform( projectId, releaseId, goals, arguments, useReleaseProfile,
repository );
+            try
+            {
+                releaseManager.releasePerform( projectId, releaseId, goals, arguments, useReleaseProfile,
repository );
+            }
+            catch ( BuildAgentConfigurationException e )
+            {
+                List<String> args = new ArrayList<String>();
+                args.add( e.getMessage() );
+
+                addActionError( getText( "releasePerform.release.error", args ) );
+                return ERROR;
+            }
         }
         else
         {
@@ -246,8 +282,19 @@
                 environments = getEnvironments( profile );
             }
 
-            releaseManager.releasePerformFromScm( projectId, goals, arguments, useReleaseProfile,
repository, scmUrl, 
-                                                  scmUsername, scmPassword, scmTag, scmTagBase,
environments );
+            try
+            {
+                releaseManager.releasePerformFromScm( projectId, goals, arguments, useReleaseProfile,
repository, scmUrl, 
+                                                      scmUsername, scmPassword, scmTag, scmTagBase,
environments );
+            }
+            catch ( BuildAgentConfigurationException e )
+            {
+                List<String> args = new ArrayList<String>();
+                args.add( e.getMessage() );
+
+                addActionError( getText( "releasePerform.release.error", args ) );
+                return ERROR;
+            }
 
             return SUCCESS;
         }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
Tue Mar 17 03:14:30 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.release.distributed.DistributedReleaseUtil;
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.continuum.web.action.AbstractReleaseAction;
@@ -164,9 +165,20 @@
         {
             DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
 
-            getReleasePluginParameters( distributedReleaseManager.getReleasePluginParameters(
projectId, "pom.xml" ) );
+            try
+            {
+                getReleasePluginParameters( distributedReleaseManager.getReleasePluginParameters(
projectId, "pom.xml" ) );
+
+                projects = distributedReleaseManager.processProject( projectId, "pom.xml",
autoVersionSubmodules );
+            }
+            catch ( BuildAgentConfigurationException e )
+            {
+                List<String> args = new ArrayList<String>();
+                args.add( e.getMessage() );
 
-            projects = distributedReleaseManager.processProject( projectId, "pom.xml", autoVersionSubmodules
);
+                addActionError( getText( "releasePrepare.input.error", args ) );
+                return ERROR;
+            }
         }
         else
         {
@@ -286,8 +298,25 @@
         {
             DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
 
-            releaseId = distributedReleaseManager.releasePrepare( project, getReleaseProperties(),
getRelVersionMap(), getDevVersionMap(), 
-                                                                  environments );
+            try
+            {
+                releaseId = distributedReleaseManager.releasePrepare( project, getReleaseProperties(),
getRelVersionMap(), getDevVersionMap(), 
+                                                                      environments );
+
+                if ( releaseId == null )
+                {
+                    addActionError( "" );
+                    return ERROR;
+                }
+            }
+            catch ( BuildAgentConfigurationException e )
+            {
+                List<String> args = new ArrayList<String>();
+                args.add( e.getMessage() );
+
+                addActionError( getText( "releasePrepare.release.error", args ) );
+                return ERROR;
+            }
         }
         else
         {
@@ -332,7 +361,16 @@
         if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
         {
             DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
-            result = distributedReleaseManager.getReleaseResult( releaseId );
+
+            try
+            {
+                result = distributedReleaseManager.getReleaseResult( releaseId );
+            }
+            catch ( BuildAgentConfigurationException e )
+            {
+                addActionError( "release" );
+                return "viewResultError";
+            }
         }
         else
         {
@@ -361,8 +399,17 @@
         if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
         {
             DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
-            Map listenerMap  = distributedReleaseManager.getListener( releaseId );
-
+            Map listenerMap;
+            try
+            {
+                listenerMap  = distributedReleaseManager.getListener( releaseId );
+            }
+            catch ( BuildAgentConfigurationException e )
+            {
+                addActionError( "" );
+                return "";
+            }
+                
             if ( listenerMap != null && !listenerMap.isEmpty() )
             {
                 int state = DistributedReleaseUtil.getReleaseState( listenerMap );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
Tue Mar 17 03:14:30 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.continuum.ContinuumException;
@@ -28,6 +29,7 @@
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
Tue Mar 17 03:14:30 2009
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
@@ -66,7 +70,18 @@
         {
             DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
 
-            releaseManager.releaseRollback( releaseId, projectId );
+            try
+            {
+                releaseManager.releaseRollback( releaseId, projectId );
+            }
+            catch ( BuildAgentConfigurationException e )
+            {
+                List<String> args = new ArrayList<String>();
+                args.add( e.getMessage() );
+
+                addActionError( getText( "releaseRollback.error", args ) );
+                return ERROR;
+            }
         }
         else
         {

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Tue Mar 17 03:14:30 2009
@@ -697,6 +697,13 @@
 releasePerformFromScm.goals.label=Maven Arguments
 releasePerformFromScm.useReleaseProfile.label=Use Release Profile
 releasePerformFromScm.buildEnvironment.label=Build Environment
+releasePrepare.input.error = Unable to get release plugin parameters and process project
because build agent {0} was either removed or disabled
+releasePrepare.release.error = Unable to prepare release because build agent {0} was either
removed or disabled
+releaseInProgress.error = Unable to view release in progress because build agent {0} was
either removed or disabled
+releaseViewResult.error = Unable to view release result because build agent {0} was either
removed or disabled
+releaseCleanup.error = Unable to cleanup release because build agent {0} was either removed
or disabled
+releasePerform.input.error = Unable to get release plugin parameters because build agent
{0} was either removed or disabled
+releasePerform.release.error Unable to perform release because build agent {0} was either
removed or disabled
 
 # ----------------------------------------------------------------------
 # Page: User

Modified: continuum/trunk/continuum-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/struts.xml?rev=755103&r1=755102&r2=755103&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/struts.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/struts.xml Tue Mar 17 03:14:30 2009
@@ -492,6 +492,7 @@
 
     <action name="releasePrepareInput" class="releasePrepare" method="input">
       <result name="success">/WEB-INF/jsp/releasePrepare.jsp</result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePrepare" class="releasePrepare">
@@ -502,10 +503,12 @@
         <param name="projectId">${projectId}</param>
         <param name="releaseGoal">prepare</param>
       </result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePerformInput" class="releasePerform" method="input">
       <result name="success">/WEB-INF/jsp/releasePerform.jsp</result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePerform" class="releasePerform">
@@ -516,10 +519,12 @@
         <param name="projectId">${projectId}</param>
         <param name="releaseGoal">perform</param>
       </result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePerformFromScmInput" class="releasePerform" method="inputFromScm">
       <result name="success">/WEB-INF/jsp/releasePerformFromScm.jsp</result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePerformFromScm" class="releasePerform" method="executeFromScm">
@@ -530,12 +535,14 @@
         <param name="releaseId">${releaseId}</param>
         <param name="releaseGoal">perform</param>
       </result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releaseInProgress" class="releaseInProgress">
       <result name="initialized">/WEB-INF/jsp/releaseInitialized.jsp</result>
       <result name="inProgress">/WEB-INF/jsp/releaseInProgress.jsp</result>
       <result name="success">/WEB-INF/jsp/releaseFinished.jsp</result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releaseRollbackWarning" class="releaseRollback" method="warn">
@@ -548,6 +555,7 @@
         <param name="projectId">${projectId}</param>
         <param name="releaseId">${releaseId}</param>
       </result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releaseCleanup" class="releaseCleanup">
@@ -556,10 +564,12 @@
         <param name="actionName">projectGroupSummary</param>
         <param name="projectGroupId">${projectGroupId}</param>
       </result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releaseViewResult" class="releaseInProgress" method="viewResult">
       <result name="success">/WEB-INF/jsp/releaseViewResult.jsp</result>
+      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="viewReleaseResult" class="releaseResult" method="viewResult">



Mime
View raw message