continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r209176 - in /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum: ./ buildcontroller/ execution/ execution/maven/m1/ execution/maven/m2/ utils/shell/
Date Tue, 05 Jul 2005 01:41:24 GMT
Author: jvanzyl
Date: Mon Jul  4 18:41:22 2005
New Revision: 209176

URL: http://svn.apache.org/viewcvs?rev=209176&view=rev
Log:
o http://jira.codehaus.org/browse/CONTINUUM-162

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=209176&r1=209175&r2=209176&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Mon Jul  4 18:41:22 2005
@@ -46,6 +46,7 @@
 
 import org.codehaus.plexus.action.ActionManager;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.ExceptionUtils;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -84,9 +85,7 @@
         {
             ContinuumProject p = (ContinuumProject) i.next();
 
-            ContinuumBuild build = core.getLatestBuildForProject( p.getId() );
-
-            if ( build.getState() == ContinuumProjectState.FAILED )
+            if ( p.getState() == ContinuumProjectState.FAILED )
             {
                 list.add( p );
             }
@@ -104,9 +103,25 @@
         {
             ContinuumProject p = (ContinuumProject) i.next();
 
-            ContinuumBuild build = core.getLatestBuildForProject( p.getId() );
+            if ( p.getState() == ContinuumProjectState.ERROR )
+            {
+                list.add( p );
+            }
+        }
+
+        return list;
+    }
+
+    public Collection getProjectsWithSuccess()
+        throws ContinuumException
+    {
+        List list = new ArrayList();
+
+        for ( Iterator i = core.getProjects().iterator(); i.hasNext(); )
+        {
+            ContinuumProject p = (ContinuumProject) i.next();
 
-            if ( build.getState() == ContinuumProjectState.ERROR )
+            if ( p.getState() == ContinuumProjectState.OK )
             {
                 list.add( p );
             }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=209176&r1=209175&r2=209176&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Mon Jul  4 18:41:22 2005
@@ -50,7 +50,7 @@
     private ContinuumStore store;
 
     /** @plexus.requirement */
-    private ContinuumNotificationDispatcher notifier;
+    private ContinuumNotificationDispatcher notifierDispatcher;
 
     /** @plexus.requirement */
     private ActionManager actionManager;
@@ -91,7 +91,7 @@
 
         try
         {
-            notifier.buildStarted( project );
+            notifierDispatcher.buildStarted( project );
 
             Map actionContext = new HashMap();
 
@@ -188,8 +188,9 @@
                 build.setError( throwableToString( e ) );
 
                 buildId = storeBuild( project, build );
-            }
 
+                project.setState( ContinuumProjectState.ERROR );
+            }
         }
         catch ( Exception ex )
         {
@@ -214,7 +215,7 @@
                 }
             }
 
-            notifier.buildComplete( project, build );
+            notifierDispatcher.buildComplete( project, build );
         }
     }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java?rev=209176&r1=209175&r2=209176&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
Mon Jul  4 18:41:22 2005
@@ -180,7 +180,8 @@
         }
         catch ( Exception e )
         {
-            throw new ContinuumBuildExecutorException( "Error while executing shell command.",
e );
+            throw new ContinuumBuildExecutorException(
+                "Error while executing shell command. The most common error is that " + executable
+ " is not in your path.", e );
         }
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java?rev=209176&r1=209175&r2=209176&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
Mon Jul  4 18:41:22 2005
@@ -65,7 +65,10 @@
         String commandLine = StringUtils.clean( project.getCommandLineArguments() ) + " "
+
                              StringUtils.clean( project.getGoals() );
 
-        return executeShellCommand( workingDirectory, null, commandLine );
+        // Adding executable name so that i can get something meaningful in the error message.
+        // If this is not set and there's nothing in the path we have no executable name.
+        
+        return executeShellCommand( workingDirectory, "maven", commandLine );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project
)

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=209176&r1=209175&r2=209176&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Mon Jul  4 18:41:22 2005
@@ -70,9 +70,10 @@
 
         String arguments = project.getCommandLineArguments() + " " + project.getGoals();
 
-        return executeShellCommand( workingDirectory,
-                                    null,
-                                    arguments );
+        // Adding executable name so that i can get something meaningful in the error message.
+        // If this is not set and there's nothing in the path we have no executable name.
+
+        return executeShellCommand( workingDirectory, "m2", arguments );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project
)

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java?rev=209176&r1=209175&r2=209176&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
Mon Jul  4 18:41:22 2005
@@ -61,6 +61,8 @@
 
         Commandline cl = new Commandline();
 
+        System.out.println( "executable = " + executable );
+
         cl.setExecutable( executable.getAbsolutePath() );
 
         cl.setWorkingDirectory( workingDirectory.getAbsolutePath() );



Mime
View raw message