continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r431430 [1/3] - in /maven/continuum/branches/continuum-acegi: ./ continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ continuum-cc/src/main/java/org/apache/maven/con...
Date Mon, 14 Aug 2006 20:36:21 GMT
Author: carlos
Date: Mon Aug 14 13:36:17 2006
New Revision: 431430

URL: http://svn.apache.org/viewvc?rev=431430&view=rev
Log:
Merged rev# 429343-431403 from trunk

Added:
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
      - copied unchanged from r431403, maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumUnitTest.java
      - copied unchanged from r431403, maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumUnitTest.java
    maven/continuum/branches/continuum-acegi/continuum-sandbox/
      - copied from r431403, maven/continuum/trunk/continuum-sandbox/
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/
      - copied from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/README.txt
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/README.txt
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/add-continuum-projects.py
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/add-continuum-projects.py
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/add-maven-projects.py
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/add-maven-projects.py
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/add-plexus-projects.py
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/add-plexus-projects.py
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/cli.py
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/cli.py
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/continuum.py
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/continuum.py
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/continuum_cli.py
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/continuum_cli.py
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/it-2.py
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/it-2.py
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/it.py
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/it.py
    maven/continuum/branches/continuum-acegi/continuum-sandbox/continuum-python/it_utils.py
      - copied unchanged from r431403, maven/continuum/trunk/continuum-sandbox/continuum-python/it_utils.py
    maven/continuum/branches/continuum-acegi/continuum-uml/white-site/editRoles.html
      - copied unchanged from r431403, maven/continuum/trunk/continuum-uml/white-site/editRoles.html
    maven/continuum/branches/continuum-acegi/continuum-uml/white-site/groupStatus.html
      - copied unchanged from r431403, maven/continuum/trunk/continuum-uml/white-site/groupStatus.html
    maven/continuum/branches/continuum-acegi/continuum-uml/white-site/manageGroup.html
      - copied unchanged from r431403, maven/continuum/trunk/continuum-uml/white-site/manageGroup.html
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
      - copied unchanged from r431403, maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
      - copied unchanged from r431403, maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/GroupSummaryAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/mdo/
      - copied from r431403, maven/continuum/trunk/continuum-webapp/src/main/mdo/
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/mdo/view-models.xml
      - copied unchanged from r431403, maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.xml
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/META-INF/
      - copied from r431403, maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/META-INF/plexus/
      - copied from r431403, maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
      - copied unchanged from r431403, maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/groupSummary.jsp
      - copied unchanged from r431403, maven/continuum/trunk/continuum-webapp/src/main/webapp/groupSummary.jsp
Removed:
    maven/continuum/branches/continuum-acegi/continuum-core-it/README.txt
    maven/continuum/branches/continuum-acegi/continuum-core-it/add-continuum-projects.py
    maven/continuum/branches/continuum-acegi/continuum-core-it/add-maven-projects.py
    maven/continuum/branches/continuum-acegi/continuum-core-it/add-plexus-projects.py
    maven/continuum/branches/continuum-acegi/continuum-core-it/cli.py
    maven/continuum/branches/continuum-acegi/continuum-core-it/continuum.py
    maven/continuum/branches/continuum-acegi/continuum-core-it/continuum_cli.py
    maven/continuum/branches/continuum-acegi/continuum-core-it/it-2.py
    maven/continuum/branches/continuum-acegi/continuum-core-it/it.py
    maven/continuum/branches/continuum-acegi/continuum-core-it/it_utils.py
    maven/continuum/branches/continuum-acegi/continuum-core-it/run.sh
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/model/
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/plexus/
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/WEB-INF/plexus.xml
Modified:
    maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
    maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
    maven/continuum/branches/continuum-acegi/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
    maven/continuum/branches/continuum-acegi/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
    maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/aspectj/ContinuumStub.java
    maven/continuum/branches/continuum-acegi/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
    maven/continuum/branches/continuum-acegi/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
    maven/continuum/branches/continuum-acegi/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/   (props changed)
    maven/continuum/branches/continuum-acegi/continuum-webapp/pom.xml
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddBuildDefinitionAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddNotifierAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddScheduleAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CheckConfigurationAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ConfigurationAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteBuildDefinitionAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteNotifierAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/EditScheduleAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/LoginAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/jsp/ui/DateTag.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/log4j.xml
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/WEB-INF/web.xml
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/css/tigris.css
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/error.jsp
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/Menu.jsp
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/summary.jsp
    maven/continuum/branches/continuum-acegi/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
    maven/continuum/branches/continuum-acegi/pom.xml

Modified: maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Mon Aug 14 13:36:17 2006
@@ -43,6 +43,15 @@
     String ROLE = Continuum.class.getName();
 
     // ----------------------------------------------------------------------
+    // Project Groups
+    // ----------------------------------------------------------------------
+
+    public Collection getAllProjectGroupsWithProjects();
+
+    public Collection getProjectsInGroup( int projectGroupId )
+        throws ContinuumException;
+    
+    // ----------------------------------------------------------------------
     // Project
     // ----------------------------------------------------------------------
 

Modified: maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java Mon Aug 14 13:36:17 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.continuum.project.builder;
 
 /*
- * Copyright 2004-2005 The Apache Software Foundation.
+ * Copyright 2004-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.
@@ -26,7 +26,9 @@
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.net.URL;
+import java.net.UnknownHostException;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -105,6 +107,40 @@
         writer.close();
 
         return file;
+    }
+
+    /**
+     * Create metadata file and handle exceptions, adding the errors to the result object.
+     * 
+     * @param result holder with result and errors.
+     * @param metadata
+     * @param username
+     * @param password
+     * @return
+     */
+    protected File createMetadataFile( ContinuumProjectBuildingResult result, URL metadata, String username,
+                                       String password )
+    {
+        try
+        {
+            return createMetadataFile( metadata, username, password );
+        }
+        catch ( MalformedURLException e )
+        {
+            getLogger().info( "Malformed URL: " + metadata, e );
+            result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL );
+        }
+        catch ( UnknownHostException e )
+        {
+            getLogger().info( "Unknown host: " + metadata, e );
+            result.addError( ContinuumProjectBuildingResult.ERROR_UNKNOWN_HOST );
+        }
+        catch ( IOException e )
+        {
+            getLogger().warn( "Could not download the URL: " + metadata, e );
+            result.addError( ContinuumProjectBuildingResult.ERROR_UNKNOWN );
+        }
+        return null;
     }
 
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java Mon Aug 14 13:36:17 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.continuum.project.builder;
 
 /*
- * Copyright 2004-2005 The Apache Software Foundation.
+ * Copyright 2004-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.
@@ -23,16 +23,34 @@
 import java.util.List;
 
 /**
+ * Holder for results of adding projects to Continuum. Contains added projects, project groups
+ * and errors that happened during the add.
+ * 
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
  * @version $Id$
  */
 public class ContinuumProjectBuildingResult
 {
+    public static final String ERROR_MALFORMED_URL = "add.project.malformed.url.error";
+
+    public static final String ERROR_UNKNOWN_HOST = "add.project.unknown.host.error";
+    
+    public static final String ERROR_XML_PARSE = "add.project.xml.parse.error";
+
+    public static final String ERROR_EXTEND = "add.project.extend.error";
+
+    public static final String ERROR_MISSING_GROUPID = "add.project.missing.groupid.error";
+
+    public static final String ERROR_MISSING_ARTIFACTID = "add.project.missing.artifactid.error";
+
+    public static final String ERROR_UNKNOWN = "add.project.unknown.error";
+    
     private List projects = new ArrayList();
 
     private List projectGroups = new ArrayList();
 
-    private List warnings = new ArrayList();
+    private List errors = new ArrayList();
 
     public void addProject( Project project )
     {
@@ -61,13 +79,47 @@
         return projectGroups;
     }
 
-    public void addWarning( String warning )
+    /**
+     * Add a warning that happened during adding the project to Continuum.
+     * 
+     * @param warningKey warning id (so it can be internationalized later)
+     * @deprecated Use {@link #addError(String)} instead
+     */
+    public void addWarning( String warningKey )
+    {
+        addError( warningKey );
+    }
+
+    /**
+     * Add an error that happened during adding the project to Continuum.
+     * 
+     * @param errorKey error id (so it can be internationalized later)
+     */
+    public void addError( String errorKey )
+    {
+        errors.add( errorKey );
+    }
+
+    /**
+     * Get the warnings that happened during adding the project to Continuum.
+     * There is an entry with the warning key (so it can be internationalized later) for each warning.
+     * 
+     * @return {@link List} &lt; {@link String} >
+     * @deprecated Use {@link #getErrors()} instead
+     */
+    public List getWarnings()
     {
-        warnings.add( warning );
+        return getErrors();
     }
 
-    public List getWarnings()
+    /**
+     * Get the errors that happened during adding the project to Continuum.
+     * There is an entry with the error key (so it can be internationalized later) for each error.
+     * 
+     * @return {@link List} &lt; {@link String} >
+     */
+    public List getErrors()
     {
-        return warnings;
+        return errors;
     }
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-cc/src/main/java/org/apache/maven/continuum/project/builder/cc/CruiseControlProjectBuilder.java Mon Aug 14 13:36:17 2006
@@ -280,6 +280,9 @@
                     "Unsupported modification set found '" + modifactionset.getName() + "'." );
             }
 
+            // FIXME: this break ensures that null-checks for scmURL above
+            // are useless - scmURL is always null. Either remove the break or drop
+            // the checks.
             break;
         }
 

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Mon Aug 14 13:36:17 2006
@@ -24,9 +24,7 @@
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.configuration.ConfigurationStoringException;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
-import org.apache.maven.continuum.core.action.AddProjectToCheckOutQueueAction;
 import org.apache.maven.continuum.core.action.CreateProjectsFromMetadata;
-import org.apache.maven.continuum.core.action.StoreProjectAction;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.initialization.ContinuumInitializationException;
@@ -156,8 +154,6 @@
 
     public DefaultContinuum()
     {
-        super();
-
         Runtime.getRuntime().addShutdownHook( new Thread()
         {
             public void run()
@@ -174,6 +170,16 @@
         } );
     }
 
+    public void setActionManager( ActionManager actionManager )
+    {
+        this.actionManager = actionManager;
+    }
+
+    public ActionManager getActionManager()
+    {
+        return actionManager;
+    }
+
     // ----------------------------------------------------------------------
     // Projects
     // ----------------------------------------------------------------------
@@ -342,7 +348,7 @@
     {
         Map context = new HashMap();
 
-        context.put( AddProjectToCheckOutQueueAction.KEY_PROJECT_ID, new Integer( projectId ) );
+        context.put( AbstractContinuumAction.KEY_PROJECT_ID, new Integer( projectId ) );
 
         executeAction( "add-project-to-checkout-queue", context );
     }
@@ -402,8 +408,8 @@
 
             if ( buildDefId == null )
             {
-                throw new ContinuumException(
-                    "Project (id=" + project.getId() + " doens't have a default build definition." );
+                throw new ContinuumException( "Project (id=" + project.getId()
+                    + " doens't have a default build definition." );
             }
 
             buildProject( project, buildDefId.intValue(), trigger );
@@ -424,6 +430,7 @@
             if ( projectsMap == null )
             {
                 // We don't have projects attached to this schedule
+                getLogger().info( "No projects to build for schedule " + schedule );
                 return;
             }
 
@@ -440,25 +447,34 @@
             projectsList = getProjects();
         }
 
+        getLogger().info( "Building " + projectsList.size() + " projects" );
+
         for ( Iterator projectIterator = projectsList.iterator(); projectIterator.hasNext(); )
         {
             Project project = (Project) projectIterator.next();
 
+            // FIXME: if store.getProjectIdsAndBuildDefinitionsIdsBySchedule above throws a CycleDetectedException,
+            // then projectsMap is null.
             List buildDefIds = (List) projectsMap.get( new Integer( project.getId() ) );
 
             if ( buildDefIds != null && !buildDefIds.isEmpty() )
             {
+                getLogger().info( "Processing " + buildDefIds.size() + " build definitions for project " + project );
                 for ( Iterator buildDefinitionIterator = buildDefIds.iterator(); buildDefinitionIterator.hasNext(); )
                 {
                     Integer buildDefId = (Integer) buildDefinitionIterator.next();
 
-                    if ( buildDefId != null && !isInBuildingQueue( project.getId(), buildDefId.intValue() ) &&
-                        !isInCheckoutQueue( project.getId() ) )
+                    if ( buildDefId != null && !isInBuildingQueue( project.getId(), buildDefId.intValue() )
+                        && !isInCheckoutQueue( project.getId() ) )
                     {
                         buildProject( project, buildDefId.intValue(), ContinuumProjectState.TRIGGER_SCHEDULED, false );
                     }
                 }
             }
+            else
+            {
+                getLogger().info( "No build definitions, not building for project " + project );
+            }
         }
     }
 
@@ -474,7 +490,6 @@
         buildProject( projectId, buildDefinitionId, ContinuumProjectState.TRIGGER_FORCED );
     }
 
-
     public void buildProject( int projectId, int trigger )
         throws ContinuumException
     {
@@ -535,10 +550,10 @@
 
         try
         {
-            if ( project.getState() != ContinuumProjectState.NEW &&
-                project.getState() != ContinuumProjectState.CHECKEDOUT &&
-                project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED &&
-                project.getState() != ContinuumProjectState.ERROR )
+            if ( project.getState() != ContinuumProjectState.NEW
+                && project.getState() != ContinuumProjectState.CHECKEDOUT
+                && project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED
+                && project.getState() != ContinuumProjectState.ERROR )
             {
                 ContinuumBuildExecutor executor = executorManager.getBuildExecutor( project.getExecutorId() );
 
@@ -559,8 +574,7 @@
                 }
             }
 
-            getLogger().info(
-                "Enqueuing '" + project.getName() + "' (Build definition id=" + buildDefinitionId + ")." );
+            getLogger().info( "Enqueuing '" + project.getName() + "' (Build definition id=" + buildDefinitionId + ")." );
 
             buildQueue.put( new BuildProjectTask( project.getId(), buildDefinitionId, trigger ) );
         }
@@ -763,7 +777,7 @@
         //
         // ----------------------------------------------------------------------
 
-        context.put( CreateProjectsFromMetadata.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+        context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
 
         context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
 
@@ -782,7 +796,7 @@
 
         executeAction( "add-project-to-checkout-queue", context );
 
-        return ( (Integer) context.get( StoreProjectAction.KEY_PROJECT_ID ) ).intValue();
+        return ( (Integer) context.get( AbstractContinuumAction.KEY_PROJECT_ID ) ).intValue();
     }
 
     private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
@@ -795,7 +809,7 @@
 
         context.put( CreateProjectsFromMetadata.KEY_URL, metadataUrl );
 
-        context.put( CreateProjectsFromMetadata.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+        context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
 
         // ----------------------------------------------------------------------
         // Create the projects from the URL
@@ -803,8 +817,8 @@
 
         executeAction( "create-projects-from-metadata", context );
 
-        ContinuumProjectBuildingResult result =
-            (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT );
+        ContinuumProjectBuildingResult result = (ContinuumProjectBuildingResult) context
+            .get( CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT );
 
         if ( result.getProjects() != null )
         {
@@ -814,15 +828,15 @@
         {
             getLogger().info( "Created " + result.getProjectGroups().size() + " project groups." );
         }
-        getLogger().info( result.getWarnings().size() + " warnings." );
+        getLogger().info( result.getErrors().size() + " errors." );
 
         // ----------------------------------------------------------------------
         // Look for any warnings.
         // ----------------------------------------------------------------------
 
-        if ( result.getWarnings().size() > 0 )
+        if ( result.getErrors().size() > 0 )
         {
-            for ( Iterator i = result.getWarnings().iterator(); i.hasNext(); )
+            for ( Iterator i = result.getErrors().iterator(); i.hasNext(); )
             {
                 getLogger().info( (String) i.next() );
             }
@@ -849,7 +863,8 @@
                 projectGroup = store.getProjectGroupByGroupIdWithProjects( projectGroup.getGroupId() );
 
                 getLogger().info(
-                    "Using existing project group with the group id: '" + projectGroup.getGroupId() + "'." );
+                                  "Using existing project group with the group id: '" + projectGroup.getGroupId()
+                                      + "'." );
             }
             catch ( ContinuumObjectNotFoundException e )
             {
@@ -857,7 +872,7 @@
 
                 Map pgContext = new HashMap();
 
-                pgContext.put( CreateProjectsFromMetadata.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+                pgContext.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
 
                 pgContext.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
 
@@ -900,11 +915,11 @@
                 context = new HashMap();
 
                 context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
-//
-//            executeAction( "validate-project", context );
-//
-//            executeAction( "store-project", context );
-//
+                //
+                //            executeAction( "validate-project", context );
+                //
+                //            executeAction( "store-project", context );
+                //
                 context.put( AbstractContinuumAction.KEY_PROJECT_ID, new Integer( project.getId() ) );
 
                 executeAction( "add-project-to-checkout-queue", context );
@@ -992,8 +1007,8 @@
             if ( value instanceof String )
             {
                 String val = (String) value;
-                if ( !"sendOnSuccess".equals( val ) && !"sendOnFailure".equals( val ) && !"sendOnError".equals( val ) &&
-                    !"sendOnWarning".equals( val ) )
+                if ( !"sendOnSuccess".equals( val ) && !"sendOnFailure".equals( val ) && !"sendOnError".equals( val )
+                    && !"sendOnWarning".equals( val ) )
                 {
                     if ( !StringUtils.isEmpty( val ) )
                     {
@@ -1541,8 +1556,8 @@
 
             if ( configuration.get( "conf.workingDirectory" ) != null )
             {
-                configurationService.setWorkingDirectory(
-                    configurationService.getFile( (String) configuration.get( "conf.workingDirectory" ) ) );
+                configurationService.setWorkingDirectory( configurationService.getFile( (String) configuration
+                    .get( "conf.workingDirectory" ) ) );
             }
             else
             {
@@ -1551,8 +1566,8 @@
 
             if ( configuration.get( "conf.buildOutputDirectory" ) != null )
             {
-                configurationService.setBuildOutputDirectory(
-                    configurationService.getFile( (String) configuration.get( "conf.buildOutputDirectory" ) ) );
+                configurationService.setBuildOutputDirectory( configurationService.getFile( (String) configuration
+                    .get( "conf.buildOutputDirectory" ) ) );
             }
             else
             {
@@ -1561,8 +1576,8 @@
 
             if ( configuration.get( "conf.deploymentRepositoryDirectory" ) != null )
             {
-                configurationService.setDeploymentRepositoryDirectory( configurationService.getFile(
-                    (String) configuration.get( "conf.deploymentRepositoryDirectory" ) ) );
+                configurationService.setDeploymentRepositoryDirectory( configurationService
+                    .getFile( (String) configuration.get( "conf.deploymentRepositoryDirectory" ) ) );
             }
 
             if ( configuration.get( "conf.url" ) != null )
@@ -1909,16 +1924,16 @@
         {
             if ( !wdFile.isDirectory() )
             {
-                throw new InitializationException(
-                    "The specified working directory isn't a directory: " + "'" + wdFile.getAbsolutePath() + "'." );
+                throw new InitializationException( "The specified working directory isn't a directory: " + "'"
+                    + wdFile.getAbsolutePath() + "'." );
             }
         }
         else
         {
             if ( !wdFile.mkdirs() )
             {
-                throw new InitializationException(
-                    "Could not making the working directory: " + "'" + wdFile.getAbsolutePath() + "'." );
+                throw new InitializationException( "Could not making the working directory: " + "'"
+                    + wdFile.getAbsolutePath() + "'." );
             }
         }
 
@@ -1945,10 +1960,10 @@
                 }
             }
 
-            if ( project.getState() != ContinuumProjectState.NEW &&
-                project.getState() != ContinuumProjectState.CHECKEDOUT &&
-                project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED &&
-                project.getState() != ContinuumProjectState.ERROR )
+            if ( project.getState() != ContinuumProjectState.NEW
+                && project.getState() != ContinuumProjectState.CHECKEDOUT
+                && project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED
+                && project.getState() != ContinuumProjectState.ERROR )
             {
                 int state = project.getState();
 
@@ -1958,8 +1973,9 @@
 
                 try
                 {
-                    getLogger().info( "Fix project state for project " + project.getId() + ":" + project.getName() +
-                        ":" + project.getVersion() );
+                    getLogger().info(
+                                      "Fix project state for project " + project.getId() + ":" + project.getName()
+                                          + ":" + project.getVersion() );
 
                     store.updateProject( project );
 
@@ -1976,8 +1992,9 @@
                 }
             }
 
-            getLogger().info( " " + project.getId() + ":" + project.getName() + ":" + project.getVersion() + ":" +
-                project.getExecutorId() );
+            getLogger().info(
+                              " " + project.getId() + ":" + project.getName() + ":" + project.getVersion() + ":"
+                                  + project.getExecutorId() );
         }
     }
 
@@ -2079,12 +2096,12 @@
     // Workflow
     // ----------------------------------------------------------------------
 
-    private void executeAction( String actionName, Map context )
+    protected void executeAction( String actionName, Map context )
         throws ContinuumException
     {
         try
         {
-            Action action = actionManager.lookup( actionName );
+            Action action = getActionManager().lookup( actionName );
 
             action.execute( context );
         }
@@ -2092,6 +2109,10 @@
         {
             throw new ContinuumException( "Error while executing the action '" + actionName + "'.", e );
         }
+        catch ( ContinuumException e )
+        {
+            throw e;
+        }
         catch ( Exception e )
         {
             throw new ContinuumException( "Error while executing the action '" + actionName + "'.", e );
@@ -2247,6 +2268,30 @@
         try
         {
             return store.getProjectWithBuilds( projectId );
+        }
+        catch ( ContinuumObjectNotFoundException e )
+        {
+            throw new ContinuumException( "Unable to find the requested project", e );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ContinuumException( "Error retrieving the requested project", e );
+        }
+    }
+
+    public Collection getAllProjectGroupsWithProjects()
+    {
+        // todo check why this interface isn't throwing exceptions on this guy
+        return store.getAllProjectGroupsWithProjects();
+
+    }
+
+    public Collection getProjectsInGroup( int projectGroupId )
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getProjectGroupWithProjects( projectGroupId ).getProjects();
         }
         catch ( ContinuumObjectNotFoundException e )
         {

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java Mon Aug 14 13:36:17 2006
@@ -1,5 +1,7 @@
 package org.apache.maven.continuum.buildcontroller;
 
+import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
+
 /*
  * Copyright 2004-2005 The Apache Software Foundation.
  *
@@ -24,5 +26,6 @@
 {
     String ROLE = BuildController.class.getName();
 
-    void build( int projectId, int buildDefinitionId, int trigger );
+    void build( int projectId, int buildDefinitionId, int trigger )
+        throws TaskExecutionException;
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java Mon Aug 14 13:36:17 2006
@@ -26,15 +26,17 @@
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.scm.ContinuumScmException;
+import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.utils.ContinuumUtils;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.codehaus.plexus.action.ActionManager;
+import org.codehaus.plexus.action.ActionNotFoundException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -72,311 +74,387 @@
     // ----------------------------------------------------------------------
 
     /**
+     * @throws TaskExecutionException
      * @todo structure of this method is a bit of a mess (too much exception/finally code)
      */
     public void build( int projectId, int buildDefinitionId, int trigger )
+        throws TaskExecutionException
     {
-        long startTime = System.currentTimeMillis();
+        getLogger().info( "Initializing build" );
+        BuildContext context = initializeBuildContext( projectId, buildDefinitionId, trigger );
 
-        // ----------------------------------------------------------------------
-        // Initialize the context
-        // ----------------------------------------------------------------------
+        getLogger().info( "Starting build" );
+        startBuild( context );
 
-        // if these calls fail we're screwed anyway
-        // and it will only be logged through the logger.
+        try
+        {
+            // ----------------------------------------------------------------------
+            // TODO: Centralize the error handling from the SCM related actions.
+            // ContinuumScmResult should return a ContinuumScmResult from all
+            // methods, even in a case of failure.
+            // ----------------------------------------------------------------------
+            getLogger().info( "Updating working dir" );
+            updateWorkingDirectory( context );
 
-        Project project;
+            getLogger().info( "Merging SCM results" );
+            mergeScmResults( context );
 
-        BuildDefinition buildDefinition;
+            if ( !checkScmResult( context ) )
+            {
+                getLogger().info( "Error updating from SCM, not building" );
+                return;
+            }
 
-        BuildResult oldBuildResult = null;
+            if ( !shouldBuild( context ) )
+            {
+                getLogger().info( "No changes, not building" );
+                return;
+            }
 
-        BuildResult build = null;
+            getLogger().info( "Changes found, building" );
 
-        try
-        {
-            project = store.getProject( projectId );
+            Map actionContext = context.getActionContext();
 
-            project.setOldState( project.getState() );
+            performAction( "update-project-from-working-directory", context );
 
-            project.setState( ContinuumProjectState.BUILDING );
+            performAction( "execute-builder", context );
 
-            store.updateProject( project );
+            performAction( "deploy-artifact", context );
 
-            buildDefinition = store.getBuildDefinition( buildDefinitionId );
+            String s = (String) actionContext.get( AbstractContinuumAction.KEY_BUILD_ID );
 
-            notifierDispatcher.buildStarted( project );
+            if ( s != null )
+            {
+                try
+                {
+                    context.setBuildResult( store.getBuildResult( Integer.valueOf( s ).intValue() ) );
+                }
+                catch ( NumberFormatException e )
+                {
+                    throw new TaskExecutionException( "Internal error: build id not an integer", e );
+                }
+                catch ( ContinuumObjectNotFoundException e )
+                {
+                    throw new TaskExecutionException( "Internal error: Cannot find build result", e );
+                }
+                catch ( ContinuumStoreException e )
+                {
+                    throw new TaskExecutionException( "Error loading build result", e );
+                }
+            }
         }
-        catch ( ContinuumStoreException ex )
+        finally
         {
-            getLogger().error( "Internal error while getting the project.", ex );
+            endBuild( context );
+        }
+    }
 
-            return;
+    /**
+     * Checks if the build should be marked as ERROR and notifies
+     * the end of the build.
+     *
+     * @param context
+     * @throws TaskExecutionException
+     */
+    private void endBuild( BuildContext context )
+        throws TaskExecutionException
+    {
+        Project project = context.getProject();
+
+        if ( project.getState() != ContinuumProjectState.NEW && project.getState() != ContinuumProjectState.CHECKEDOUT
+            && project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED
+            && project.getState() != ContinuumProjectState.ERROR )
+        {
+            try
+            {
+                project.setState( ContinuumProjectState.ERROR );
+
+                store.updateProject( project );
+            }
+            catch ( ContinuumStoreException e )
+            {
+                throw new TaskExecutionException( "Error storing the project", e );
+            }
+            finally
+            {
+                notifierDispatcher.buildComplete( project, context.getBuildResult() );
+            }
         }
+    }
+
+    private void updateBuildResult( BuildContext context, String error )
+        throws TaskExecutionException
+    {
+        BuildResult build = context.getBuildResult();
+
+        build.setError( error );
 
         try
         {
-            oldBuildResult = store.getBuildResult( buildDefinition.getLatestBuildId() );
+            store.updateBuildResult( build );
+
+            build = store.getBuildResult( build.getId() );
         }
-        catch ( ContinuumStoreException ex )
+        catch ( ContinuumStoreException e )
         {
-            // Nothing to do
+            throw new TaskExecutionException( "Error updating build result", e );
         }
 
-        ScmResult oldScmResult = null;
+        context.getProject().setState( build.getState() );
 
-        if ( oldBuildResult != null )
+        try
         {
-            oldScmResult = getOldScmResult( project, oldBuildResult.getEndTime() );
+            store.updateProject( context.getProject() );
         }
-
-        // ----------------------------------------------------------------------
-        // TODO: Centralize the error handling from the SCM related actions.
-        // ContinuumScmResult should return a ContinuumScmResult from all
-        // methods, even in a case of failure.
-        // ----------------------------------------------------------------------
-
-        try
+        catch ( ContinuumStoreException e )
         {
-            Map actionContext = new HashMap();
-
-            actionContext.put( AbstractContinuumAction.KEY_PROJECT_ID, new Integer( projectId ) );
-
-            actionContext.put( AbstractContinuumAction.KEY_PROJECT, project );
-
-            actionContext.put( AbstractContinuumAction.KEY_BUILD_DEFINITION_ID, new Integer( buildDefinitionId ) );
-
-            actionContext.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
-
-            actionContext.put( AbstractContinuumAction.KEY_TRIGGER, new Integer( trigger ) );
-
-            actionContext.put( AbstractContinuumAction.KEY_FIRST_RUN, Boolean.valueOf( oldBuildResult == null ) );
-
-            ScmResult scmResult = null;
-
-            try
-            {
-                actionManager.lookup( "check-working-directory" ).execute( actionContext );
-
-                boolean workingDirectoryExists = AbstractContinuumAction.getBoolean( actionContext,
-                                                                                     AbstractContinuumAction.KEY_WORKING_DIRECTORY_EXISTS );
+            throw new TaskExecutionException( "Error updating project", e );
+        }
+    }
 
-                if ( workingDirectoryExists )
-                {
-                    actionManager.lookup( "update-working-directory-from-scm" ).execute( actionContext );
+    private void startBuild( BuildContext context )
+        throws TaskExecutionException
+    {
 
-                    scmResult = AbstractContinuumAction.getUpdateScmResult( actionContext, null );
-                }
-                else
-                {
-                    actionContext.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY,
-                                       workingDirectoryService.getWorkingDirectory( project ).getAbsolutePath() );
+        Project project = context.getProject();
 
-                    actionManager.lookup( "checkout-project" ).execute( actionContext );
+        project.setOldState( project.getState() );
 
-                    scmResult = AbstractContinuumAction.getCheckoutResult( actionContext, null );
-                }
+        project.setState( ContinuumProjectState.BUILDING );
 
-                // ----------------------------------------------------------------------
-                // Check to see if there was a error while checking out/updating the project
-                // ----------------------------------------------------------------------
+        try
+        {
+            store.updateProject( project );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new TaskExecutionException( "Error persisting project", e );
+        }
 
-                // Merge scm results so we'll have all changes since last execution of current build definition
-                scmResult = mergeScmResults( oldScmResult, scmResult );
+        notifierDispatcher.buildStarted( project );
 
-                if ( scmResult == null || !scmResult.isSuccess() )
-                {
-                    // scmResult must be converted before sotring it because jpox modify value of all fields to null
-                    String error = convertScmResultToError( scmResult );
+    }
 
-                    build = makeAndStoreBuildResult( project, scmResult, startTime, trigger );
+    /**
+     * Initializes a BuildContext for the build.
+     *
+     * @param projectId
+     * @param buildDefinitionId
+     * @param trigger
+     * @return
+     * @throws TaskExecutionException
+     */
+    private BuildContext initializeBuildContext( int projectId, int buildDefinitionId, int trigger )
+        throws TaskExecutionException
+    {
+        BuildContext context = new BuildContext();
 
-                    build.setError( error );
+        context.setStartTime( System.currentTimeMillis() );
 
-                    store.updateBuildResult( build );
+        context.setTrigger( trigger );
 
-                    build = store.getBuildResult( build.getId() );
+        try
+        {
+            context.setProject( store.getProject( projectId ) );
 
-                    project.setState( build.getState() );
+            BuildDefinition buildDefinition = store.getBuildDefinition( buildDefinitionId );
 
-                    store.updateProject( project );
+            context.setBuildDefinition( buildDefinition );
 
-                    return;
-                }
+            try
+            {
+                BuildResult oldBuildResult = store.getBuildResult( buildDefinition.getLatestBuildId() );
 
-                actionContext.put( AbstractContinuumAction.KEY_UPDATE_SCM_RESULT, scmResult );
+                context.setOldBuildResult( oldBuildResult );
 
-                List changes = scmResult.getChanges();
+                context.setOldScmResult( getOldScmResult( projectId, oldBuildResult.getEndTime() ) );
 
-                Iterator iterChanges = changes.iterator();
+            }
+            catch ( ContinuumObjectNotFoundException ex )
+            {
+                // Nothing to do
+            }
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new TaskExecutionException( "Error initializing the build context", e );
+        }
 
-                ChangeSet changeSet;
+        Map actionContext = context.getActionContext();
 
-                List changeFiles;
+        actionContext.put( AbstractContinuumAction.KEY_PROJECT_ID, new Integer( projectId ) );
 
-                Iterator iterFiles;
+        actionContext.put( AbstractContinuumAction.KEY_PROJECT, context.getProject() );
 
-                ChangeFile changeFile;
+        actionContext.put( AbstractContinuumAction.KEY_BUILD_DEFINITION_ID, new Integer( buildDefinitionId ) );
 
-                boolean allChangesUnknown = true;
+        actionContext.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, context.getBuildDefinition() );
 
-                while ( iterChanges.hasNext() )
-                {
-                    changeSet = (ChangeSet) iterChanges.next();
+        actionContext.put( AbstractContinuumAction.KEY_TRIGGER, new Integer( trigger ) );
 
-                    changeFiles = changeSet.getFiles();
+        actionContext
+            .put( AbstractContinuumAction.KEY_FIRST_RUN, Boolean.valueOf( context.getOldBuildResult() == null ) );
 
-                    iterFiles = changeFiles.iterator();
+        return context;
+    }
 
-                    while ( iterFiles.hasNext() )
-                    {
-                        changeFile = (ChangeFile) iterFiles.next();
+    private void updateWorkingDirectory( BuildContext buildContext )
+        throws TaskExecutionException
+    {
+        Map actionContext = buildContext.getActionContext();
 
-                        if ( !"unknown".equalsIgnoreCase( changeFile.getStatus() ) )
-                        {
-                            allChangesUnknown = false;
-                            break;
-                        }
-                    }
+        performAction( "check-working-directory", buildContext );
 
-                    if ( !allChangesUnknown )
-                    {
-                        break;
-                    }
-                }
+        boolean workingDirectoryExists = AbstractContinuumAction
+            .getBoolean( actionContext, AbstractContinuumAction.KEY_WORKING_DIRECTORY_EXISTS );
 
-                if ( oldBuildResult != null && allChangesUnknown &&
-                    project.getOldState() != ContinuumProjectState.NEW &&
-                    project.getOldState() != ContinuumProjectState.CHECKEDOUT &&
-                    trigger != ContinuumProjectState.TRIGGER_FORCED &&
-                    project.getState() != ContinuumProjectState.NEW &&
-                    project.getState() != ContinuumProjectState.CHECKEDOUT )
-                {
-                    if ( changes.size() > 0 )
-                    {
-                        getLogger().info( "The project was not built because all changes are unknown." );
-                    }
-                    else
-                    {
-                        getLogger().info( "The project was not built because there are no changes." );
-                    }
+        ScmResult scmResult;
 
-                    project.setState( project.getOldState() );
+        if ( workingDirectoryExists )
+        {
+            performAction( "update-working-directory-from-scm", buildContext );
 
-                    project.setOldState( 0 );
+            scmResult = AbstractContinuumAction.getUpdateScmResult( actionContext, null );
+        }
+        else
+        {
+            Project project = (Project) actionContext.get( AbstractContinuumAction.KEY_PROJECT );
 
-                    store.updateProject( project );
+            actionContext.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, workingDirectoryService
+                .getWorkingDirectory( project ).getAbsolutePath() );
 
-                    return;
-                }
+            performAction( "checkout-project", buildContext );
 
-                actionManager.lookup( "update-project-from-working-directory" ).execute( actionContext );
+            scmResult = AbstractContinuumAction.getCheckoutResult( actionContext, null );
+        }
 
-                actionManager.lookup( "execute-builder" ).execute( actionContext );
+        buildContext.setScmResult( scmResult );
+    }
 
-                actionManager.lookup( "deploy-artifact" ).execute( actionContext );
+    private void performAction( String actionName, BuildContext context )
+        throws TaskExecutionException
+    {
+        String error = null;
+        TaskExecutionException exception = null;
 
-                String s = (String) actionContext.get( AbstractContinuumAction.KEY_BUILD_ID );
+        try
+        {
+            getLogger().info( "Performing action " + actionName );
+            actionManager.lookup( actionName ).execute( context.getActionContext() );
+            return;
+        }
+        catch ( ActionNotFoundException e )
+        {
+            error = ContinuumUtils.throwableToString( e );
+            exception = new TaskExecutionException( "Error looking up action '" + actionName + "'", e );
+        }
+        catch ( ContinuumScmException e )
+        {
+            ScmResult result = e.getResult();
 
-                if ( s != null )
-                {
-                    build = store.getBuildResult( Integer.valueOf( s ).intValue() );
-                }
-            }
-            catch ( Throwable e )
+            if ( result != null )
             {
-                getLogger().error( "Error while building project.", e );
-
-                String s = (String) actionContext.get( AbstractContinuumAction.KEY_BUILD_ID );
-
-                if ( s != null )
-                {
-                    build = store.getBuildResult( Integer.valueOf( s ).intValue() );
-                }
-                else
-                {
-                    build = makeAndStoreBuildResult( project, scmResult, startTime, trigger );
-                }
-
-                // This can happen if the "update project from scm" action fails
-
-                String error = null;
+                error = convertScmResultToError( result );
+            }
 
-                if ( e instanceof ContinuumScmException )
-                {
-                    ContinuumScmException ex = (ContinuumScmException) e;
+            if ( error == null )
+            {
+                error = ContinuumUtils.throwableToString( e );
+            }
 
-                    ScmResult result = ex.getResult();
+            exception = new TaskExecutionException( "SCM error while executing '" + actionName + "'", e );
+        }
+        catch ( Exception e )
+        {
+            exception = new TaskExecutionException( "Error executing action '" + actionName + "'", e );
+        }
 
-                    if ( result != null )
-                    {
-                        error = convertScmResultToError( result );
-                    }
+        // TODO: clean this up. We catch the original exception from the action, and then update the buildresult
+        // for it - we need to because of the specialized error message for SCM.
+        // If updating the buildresult fails, log the previous error and throw the new one.
+        // If updating the buildresult succeeds, throw the original exception. The build result should NOT
+        // be updated again - a TaskExecutionException is final, no further action should be taken upon it.
 
-                }
-                if ( error == null )
-                {
-                    error = ContinuumUtils.throwableToString( e );
-                }
+        try
+        {
+            updateBuildResult( context, error );
+        }
+        catch ( TaskExecutionException e )
+        {
+            getLogger().error( "Error updating build result after receiving the following exception: ", exception );
+            throw e;
+        }
 
-                build.setError( error );
+        throw exception;
+    }
 
-                store.updateBuildResult( build );
+    private boolean shouldBuild( BuildContext context )
+        throws TaskExecutionException
+    {
+        //oldBuildResult != null &&
+        //        List changes, Project project, int trigger )
+        //        scmResult.getChanges(), project, trigger ) )
 
-                build = store.getBuildResult( build.getId() );
+        boolean allChangesUnknown = checkAllChangesUnknown( context.getScmResult().getChanges() );
 
-                project.setState( build.getState() );
+        Project project = context.getProject();
 
-                store.updateProject( project );
-            }
-        }
-        catch ( Exception ex )
+        if ( allChangesUnknown && project.getOldState() != ContinuumProjectState.NEW
+            && project.getOldState() != ContinuumProjectState.CHECKEDOUT
+            && context.getTrigger() != ContinuumProjectState.TRIGGER_FORCED
+            && project.getState() != ContinuumProjectState.NEW
+            && project.getState() != ContinuumProjectState.CHECKEDOUT )
         {
-            if ( !Thread.interrupted() )
+            if ( context.getScmResult().getChanges().size() > 0 )
             {
-                getLogger().error( "Internal error while building the project.", ex );
+                getLogger().info( "The project was not built because all changes are unknown." );
+            }
+            else
+            {
+                getLogger().info( "The project was not built because there are no changes." );
             }
 
-            String error = ContinuumUtils.throwableToString( ex );
+            project.setState( project.getOldState() );
 
-            build.setError( error );
+            project.setOldState( 0 );
 
             try
             {
-                store.updateBuildResult( build );
-
-                build = store.getBuildResult( build.getId() );
-
-                project.setState( build.getState() );
-
                 store.updateProject( project );
             }
-            catch ( Exception e )
+            catch ( ContinuumStoreException e )
             {
-                getLogger().error( "Can't store updating project.", e );
+                throw new TaskExecutionException( "Error storing project", e );
             }
+
+            return false;
         }
-        finally
+
+        return true;
+    }
+
+    private boolean checkAllChangesUnknown( List changes )
+    {
+        for ( Iterator iterChanges = changes.iterator(); iterChanges.hasNext(); )
         {
-            if ( project.getState() != ContinuumProjectState.NEW &&
-                project.getState() != ContinuumProjectState.CHECKEDOUT &&
-                project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED &&
-                project.getState() != ContinuumProjectState.ERROR )
+            ChangeSet changeSet = (ChangeSet) iterChanges.next();
+
+            List changeFiles = changeSet.getFiles();
+
+            Iterator iterFiles = changeFiles.iterator();
+
+            while ( iterFiles.hasNext() )
             {
-                try
-                {
-                    project.setState( ContinuumProjectState.ERROR );
+                ChangeFile changeFile = (ChangeFile) iterFiles.next();
 
-                    store.updateProject( project );
-                }
-                catch ( ContinuumStoreException e )
+                if ( !"unknown".equalsIgnoreCase( changeFile.getStatus() ) )
                 {
-                    getLogger().error( "Internal error while storing the project.", e );
+                    return false;
                 }
             }
-
-            notifierDispatcher.buildComplete( project, build );
         }
+
+        return true;
     }
 
     private String convertScmResultToError( ScmResult result )
@@ -391,24 +469,24 @@
         {
             if ( result.getCommandLine() != null )
             {
-                error = "Command line: " + StringUtils.clean( result.getCommandLine() ) +
-                    System.getProperty( "line.separator" );
+                error = "Command line: " + StringUtils.clean( result.getCommandLine() )
+                    + System.getProperty( "line.separator" );
             }
 
             if ( result.getProviderMessage() != null )
             {
-                error = "Provider message: " + StringUtils.clean( result.getProviderMessage() ) +
-                    System.getProperty( "line.separator" );
+                error = "Provider message: " + StringUtils.clean( result.getProviderMessage() )
+                    + System.getProperty( "line.separator" );
             }
 
             if ( result.getCommandOutput() != null )
             {
                 error += "Command output: " + System.getProperty( "line.separator" );
-                error += "-------------------------------------------------------------------------------" +
-                    System.getProperty( "line.separator" );
+                error += "-------------------------------------------------------------------------------"
+                    + System.getProperty( "line.separator" );
                 error += StringUtils.clean( result.getCommandOutput() ) + System.getProperty( "line.separator" );
-                error += "-------------------------------------------------------------------------------" +
-                    System.getProperty( "line.separator" );
+                error += "-------------------------------------------------------------------------------"
+                    + System.getProperty( "line.separator" );
             }
 
             if ( result.getException() != null )
@@ -425,29 +503,48 @@
     //
     // ----------------------------------------------------------------------
 
-    private BuildResult makeAndStoreBuildResult( Project project, ScmResult scmResult, long startTime, int trigger )
-        throws ContinuumStoreException
+    private BuildResult makeAndStoreBuildResult( BuildContext context, String error )
+        throws TaskExecutionException
     {
+        //        Project project, ScmResult scmResult, long startTime, int trigger )
+        //        project, scmResult, startTime, trigger );
+
         BuildResult build = new BuildResult();
 
         build.setState( ContinuumProjectState.ERROR );
 
-        build.setTrigger( trigger );
+        build.setTrigger( context.getTrigger() );
 
-        build.setStartTime( startTime );
+        build.setStartTime( context.getStartTime() );
 
         build.setEndTime( System.currentTimeMillis() );
 
-        build.setScmResult( scmResult );
+        build.setScmResult( context.getScmResult() );
 
-        store.addBuildResult( project, build );
+        if ( error != null )
+        {
+            build.setError( error );
+        }
 
-        return store.getBuildResult( build.getId() );
+        try
+        {
+            store.addBuildResult( context.getProject(), build );
+
+            build = store.getBuildResult( build.getId() );
+
+            context.setBuildResult( build );
+
+            return build;
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new TaskExecutionException( "Error storing build result", e );
+        }
     }
 
-    private ScmResult getOldScmResult( Project project, long fromDate )
+    private ScmResult getOldScmResult( int projectId, long fromDate )
     {
-        List results = store.getBuildResultsForProject( project.getId(), fromDate );
+        List results = store.getBuildResultsForProject( projectId, fromDate );
 
         ScmResult res = new ScmResult();
 
@@ -487,32 +584,78 @@
         return res;
     }
 
-    private ScmResult mergeScmResults( ScmResult oldScmResult, ScmResult newScmResult )
+    /**
+     *  Merges scm results so we'll have all changes since last execution of current build definition
+     */
+    private void mergeScmResults( BuildContext context )
     {
+        ScmResult oldScmResult = context.getOldScmResult();
+        ScmResult newScmResult = context.getScmResult();
+
         if ( oldScmResult != null )
         {
             if ( newScmResult == null )
             {
-                return oldScmResult;
+                context.setScmResult( oldScmResult );
             }
-
-            List oldChanges = oldScmResult.getChanges();
-
-            List newChanges = newScmResult.getChanges();
-
-            for ( Iterator i = newChanges.iterator(); i.hasNext(); )
+            else
             {
-                ChangeSet change = (ChangeSet) i.next();
+                List oldChanges = oldScmResult.getChanges();
 
-                if ( !oldChanges.contains( change ) )
+                List newChanges = newScmResult.getChanges();
+
+                for ( Iterator i = newChanges.iterator(); i.hasNext(); )
                 {
-                    oldChanges.add( change );
+                    ChangeSet change = (ChangeSet) i.next();
+
+                    if ( !oldChanges.contains( change ) )
+                    {
+                        oldChanges.add( change );
+                    }
                 }
+
+                newScmResult.setChanges( oldChanges );
+
             }
+        }
+    }
+
+    /**
+     * Check to see if there was a error while checking out/updating the project
+     *
+     * @throws TaskExecutionException
+     */
+    private boolean checkScmResult( BuildContext context )
+        throws TaskExecutionException
+    {
+        ScmResult scmResult = context.getScmResult();
+
+        if ( scmResult == null || !scmResult.isSuccess() )
+        {
+            // scmResult must be converted before storing it because jpox modifies values of all fields to null
+            String error = convertScmResultToError( scmResult );
 
-            newScmResult.setChanges( oldChanges );
+            BuildResult build = makeAndStoreBuildResult( context, error );
+
+            try
+            {
+                Project project = context.getProject();
+
+                project.setState( build.getState() );
+
+                store.updateProject( project );
+
+                return false;
+            }
+            catch ( ContinuumStoreException e )
+            {
+                throw new TaskExecutionException( "Error storing project", e );
+            }
         }
 
-        return newScmResult;
+        context.getActionContext().put( AbstractContinuumAction.KEY_UPDATE_SCM_RESULT, scmResult );
+
+        return true;
     }
+
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java Mon Aug 14 13:36:17 2006
@@ -53,12 +53,6 @@
     private boolean loaded = false;
 
     // ----------------------------------------------------------------------
-    // Continuum specifics we'll refactor out later
-    // ----------------------------------------------------------------------
-
-    private Map jdks;
-
-    // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
 
@@ -127,7 +121,7 @@
 
     public void setJdks( Map jdks )
     {
-        this.jdks = jdks;
+        // no-op
     }
 
     public String getCompanyLogo()

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java Mon Aug 14 13:36:17 2006
@@ -76,14 +76,18 @@
                 }
                 else
                 {
-                    throw new ContinuumException( "'" + u + "' is not a valid secureURL." );
+                    result = new ContinuumProjectBuildingResult();
+
+                    result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL );
                 }
             }
 
         }
         catch ( MalformedURLException e )
         {
-            throw new ContinuumException( "'" + u + "' is not a valid URL.", e );
+            result = new ContinuumProjectBuildingResult();
+
+            result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL );
         }
 
         context.put( KEY_PROJECT_BUILDING_RESULT, result );

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java Mon Aug 14 13:36:17 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.continuum.execution.maven.m1;
 
 /*
- * Copyright 2004-2005 The Apache Software Foundation.
+ * Copyright 2004-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.
@@ -21,13 +21,16 @@
 import org.apache.maven.continuum.model.project.ProjectDeveloper;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.notification.ContinuumRecipientSource;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 import java.io.File;
 import java.io.FileReader;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -45,18 +48,40 @@
     // MavenOneMetadataHelper Implementation
     // ----------------------------------------------------------------------
 
+    /**
+     * @deprecated Use {@link #mapMetadata(ContinuumProjectBuildingResult,File,Project)} instead
+     */
     public void mapMetadata( File metadata, Project project )
         throws MavenOneMetadataHelperException
     {
+        mapMetadata( new ContinuumProjectBuildingResult(), metadata, project );
+    }
+
+    public void mapMetadata( ContinuumProjectBuildingResult result, File metadata, Project project )
+        throws MavenOneMetadataHelperException
+    {
         Xpp3Dom mavenProject;
 
         try
         {
             mavenProject = Xpp3DomBuilder.build( new FileReader( metadata ) );
         }
-        catch ( Exception e )
+        catch ( XmlPullParserException e )
         {
-            throw new MavenOneMetadataHelperException( "Error while reading maven POM (" + e.getMessage() + ").", e );
+            result.addError( ContinuumProjectBuildingResult.ERROR_XML_PARSE );
+            
+            getLogger().info( "Error while reading maven POM (" + e.getMessage() + ").", e );
+            
+            return;
+        }
+        // TODO catch other IO exceptions and handle them more appropiately?
+        catch ( IOException e )
+        {
+            result.addError( ContinuumProjectBuildingResult.ERROR_UNKNOWN );
+            
+            getLogger().info( "Error while reading maven POM (" + e.getMessage() + ").", e );
+            
+            return;
         }
 
         // ----------------------------------------------------------------------
@@ -69,7 +94,11 @@
 
         if ( extend != null )
         {
-            throw new MavenOneMetadataHelperException( "Cannot use a POM with an 'extend' element." );
+            result.addError( ContinuumProjectBuildingResult.ERROR_EXTEND );
+            
+            getLogger().info( "Cannot use a POM with an 'extend' element." );
+            
+            return;
         }
 
         // ----------------------------------------------------------------------
@@ -94,14 +123,22 @@
 
             if ( StringUtils.isEmpty( groupId ) )
             {
-                throw new MavenOneMetadataHelperException( "Missing 'groupId' element in the POM." );
+                result.addError( ContinuumProjectBuildingResult.ERROR_MISSING_GROUPID );
+
+                getLogger().info( "Missing 'groupId' element in the POM." );
+
+                return;
             }
 
             artifactId = getValue( mavenProject, "artifactId", project.getArtifactId() );
 
             if ( StringUtils.isEmpty( artifactId ) )
             {
-                throw new MavenOneMetadataHelperException( "Missing 'artifactId' element in the POM." );
+                result.addError( ContinuumProjectBuildingResult.ERROR_MISSING_ARTIFACTID );
+
+                getLogger().info( "Missing 'artifactId' element in the POM." );
+
+                return;
             }
         }
 
@@ -113,6 +150,7 @@
 
         if ( StringUtils.isEmpty( project.getVersion() ) && StringUtils.isEmpty( version ) )
         {
+            // TODO add to result and don't throw exception
             throw new MavenOneMetadataHelperException( "Missing 'version' element in the POM." );
         }
 
@@ -124,6 +162,7 @@
 
         if ( StringUtils.isEmpty( project.getName() ) && StringUtils.isEmpty( name ) )
         {
+            // TODO add to result and don't throw exception
             throw new MavenOneMetadataHelperException( "Missing 'name' element in POM." );
         }
 
@@ -151,6 +190,7 @@
             }
             else
             {
+                // TODO add to result and don't throw exception
                 throw new MavenOneMetadataHelperException( "Missing 'repository' element in the POM." );
             }
         }
@@ -162,6 +202,7 @@
 
             if ( StringUtils.isEmpty( scmConnection ) )
             {
+                // TODO add to result and don't throw exception
                 throw new MavenOneMetadataHelperException(
                     "Missing both anonymous and developer SCM connection URLs." );
             }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneMetadataHelper.java Mon Aug 14 13:36:17 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.continuum.execution.maven.m1;
 
 /*
- * Copyright 2004-2005 The Apache Software Foundation.
+ * Copyright 2004-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.
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 
 import java.io.File;
 
@@ -28,6 +29,19 @@
 {
     String ROLE = MavenOneMetadataHelper.class.getName();
 
+    /**
+     * @deprecated Use {@link #mapMetadata(ContinuumProjectBuildingResult,File,Project)} instead
+     */
     void mapMetadata( File metadata, Project project )
+        throws MavenOneMetadataHelperException;
+
+    /**
+     * 
+     * @param result contains errors that happened during the process
+     * @param metadata
+     * @param project
+     * @throws MavenOneMetadataHelperException
+     */
+    void mapMetadata( ContinuumProjectBuildingResult result, File metadata, Project project )
         throws MavenOneMetadataHelperException;
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java Mon Aug 14 13:36:17 2006
@@ -336,6 +336,7 @@
 
             getLogger().error( msg, e );
 
+            // TODO add to result and don't throw exception
             throw new MavenBuilderHelperException( msg, e );
         }
 
@@ -348,6 +349,7 @@
 
         if ( scm == null )
         {
+            // TODO add to result and don't throw exception
             throw new MavenBuilderHelperException(
                 "Missing 'scm' element in the " + getProjectName( project ) + " POM." );
         }
@@ -356,6 +358,7 @@
 
         if ( StringUtils.isEmpty( url ) )
         {
+            // TODO add to result and don't throw exception
             throw new MavenBuilderHelperException(
                 "Missing 'connection' element in the 'scm' element in the " + getProjectName( project ) + " POM." );
         }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java?rev=431430&r1=431429&r2=431430&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java Mon Aug 14 13:36:17 2006
@@ -117,7 +117,6 @@
     // ----------------------------------------------------------------------
 
     public Schedule createDefaultSchedule()
-        throws ContinuumInitializationException
     {
         Schedule schedule = new Schedule();
 



Mime
View raw message