continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r169455 [1/2] - /maven/continuum/trunk/continuum-core-it /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ant /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1 /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2 /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/shell /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/manager /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m1 /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m2 /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-model/src/main/resources /maven/continuum/trunk/continuum-plexus-application/src/conf /maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc
Date Tue, 10 May 2005 12:17:08 GMT
Author: trygvis
Date: Tue May 10 05:17:06 2005
New Revision: 169455

URL: http://svn.apache.org/viewcvs?rev=169455&view=rev
Log:
Fixing CONTINUUM-124: "Split out the ContinuumProject creation from the
                       ContinuumBuilder"
This commit might be a big too big ..
o Adding a ContinuumProjectBuilder interface which will take a URL and create a
  set of ContinuumProjects. Adding two implementations for Maven 1 and 2. The
  code was copied verbatim from the ContinuumBuilders. The Maven 2 project
  builder should also read the <module>s from the POM and add those as projects
  too.
o Split out the metadata reading/parsing parts of *ContinuumBuilder so it can
  be shared between the ContinuumBuilder and the ContinuumProjectBuilder.
o The addMaven{One,Two}Project() methods will now return a List of IDs instead
  of a single ID.

Added:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/DefaultMavenOneMetadataHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/MavenOneMetadataHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilderException.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManager.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManagerException.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/manager/
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/manager/DefaultBuilderManagerTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
Removed:
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m2/MavenBuilderHelperTest.java
Modified:
    maven/continuum/trunk/continuum-core-it/continuum.py
    maven/continuum/trunk/continuum-core-it/it.py
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
    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/BuildProjectTaskExecutor.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/builder/AbstractContinuumBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ContinuumBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ant/AntBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/Maven1Builder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/DefaultMavenBuilderHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenBuilderHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenShellBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/shell/ShellBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/UrlSocketRegistrar.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builder/maven/m1/Maven1BuilderTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
    maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo
    maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml
    maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
    maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultXmlRpcHelper.java
    maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/XmlRpcHelper.java

Modified: maven/continuum/trunk/continuum-core-it/continuum.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/continuum.py?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/continuum.py (original)
+++ maven/continuum/trunk/continuum-core-it/continuum.py Tue May 10 05:17:06 2005
@@ -113,22 +113,22 @@
     return BuildResult( buildResult )
 
 ####################################################################
-# Maven 2.x project
+# Maven 1.x project
 ####################################################################
 
-def addMavenTwoProject( url ):
-    result = checkResult( server.continuum.addMavenTwoProject( url ) )
+def addMavenOneProject( url ):
+    result = checkResult( server.continuum.addMavenOneProject( url ) )
 
-    return result[ "projectId" ]
+    return result[ "projectIds" ]
 
 ####################################################################
-# Maven 1.x project
+# Maven 2.x project
 ####################################################################
 
-def addMavenOneProject( url ):
-    result = checkResult( server.continuum.addMavenOneProject( url ) )
+def addMavenTwoProject( url ):
+    result = checkResult( server.continuum.addMavenTwoProject( url ) )
 
-    return result[ "projectId" ]
+    return result[ "projectIds" ]
 
 ####################################################################
 # Ant project
@@ -156,7 +156,7 @@
         self.nagEmailAddress = map[ "nagEmailAddress" ]
         self.state = decodeState( int( map[ "state" ] ) )
         self.version = map[ "version" ]
-        self.builderId = map[ "builderId" ]
+        self.executorId = map[ "executorId" ]
         self.configuration = map[ "configuration" ]
 
         if ( map.has_key( "checkOutScmResult" ) ):
@@ -170,7 +170,7 @@
               "nagEmailAddress: " + self.nagEmailAddress + os.linesep +\
               "state: " + self.state + os.linesep +\
               "version: " + self.version + os.linesep +\
-              "builder id: " + self.builderId + os.linesep +\
+              "executor id: " + self.executorId + os.linesep +\
               "check out ok: " + self.checkOutResult.success + os.linesep
 
         if ( len( self.configuration.keys() ) > 0 ):

Modified: maven/continuum/trunk/continuum-core-it/it.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/it.py?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/it.py (original)
+++ maven/continuum/trunk/continuum-core-it/it.py Tue May 10 05:17:06 2005
@@ -55,13 +55,13 @@
 
     assertionFailed( message, "Not None", condition )
 
-def assertProject( projectId, name, nagEmailAddress, state, version, builderId, project ):
+def assertProject( projectId, name, nagEmailAddress, state, version, executorId, project ):
     assertNotNull( "project.id", projectId )
     assertEquals( "project.name", name, project.name )
     assertEquals( "project.nagEmailAddress", nagEmailAddress, project.nagEmailAddress )
     assertEquals( "project.state", state, project.state )
     assertEquals( "project.version", version, project.version )
-    assertEquals( "project.builderId", builderId, project.builderId )
+    assertEquals( "project.executorId", executorId, project.executorId )
 
 def assertCheckedOutFiles( project, expectedCheckedOutFiles ):
     actualCheckedOutFiles = project.checkOutScmResult.checkedOutFiles
@@ -241,6 +241,12 @@
 
     raise Exception( "Unknown SCM type '" + scm + "'" )
 
+def getProjectId( projectIds ):
+    if ( len( projectIds ) != 1 ):
+        fail( "When adding a project only a single project was expected to be added." );
+
+    return projectIds[ 0 ]
+
 def initMaven1Project( basedir, scm, scmroot, artifactId ):
     cleanDirectory( basedir )
     os.makedirs( basedir )
@@ -379,7 +385,7 @@
     progress( "Initializing Maven 1 CVS project" )
     initMaven1Project( maven1Project, "cvs", cvsroot, "maven-1" )
     progress( "Adding Maven 1 project" )
-    maven1Id = continuum.addMavenOneProject( "file:" + maven1Project + "/project.xml" )
+    maven1Id = getProjectId( continuum.addMavenOneProject( "file:" + maven1Project + "/project.xml" ) )
     waitForCheckOut( maven1Id );
     maven1 = continuum.getProject( maven1Id )
     assertProject( maven1Id, "Maven 1 Project", email, continuum.STATE_NEW, "1.0", "maven-1", maven1 )
@@ -416,7 +422,7 @@
     progress( "Initializing Maven 2 CVS project" )
     initMaven2Project( maven2Project, cvsroot, "maven-2" )
     progress( "Adding Maven 2 project" )
-    maven2Id = continuum.addMavenTwoProject( "file:" + maven2Project + "/pom.xml" )
+    maven2Id = getProjectId( continuum.addMavenTwoProject( "file:" + maven2Project + "/pom.xml" ) )
     waitForCheckOut( maven2Id );
     maven2 = continuum.getProject( maven2Id )
     assertProject( maven2Id, "Maven 2 Project", email, continuum.STATE_NEW, "2.0-SNAPSHOT", "maven2", maven2 )
@@ -426,14 +432,14 @@
     print "original buildId: " + buildId
     assertSuccessfulMaven2Build( buildId )
 
-    progress( "Test that a build without any files changed won't execute the builder" )
+    progress( "Test that a build without any files changed won't execute the executor" )
     expectedSize = len( continuum.getBuildsForProject( maven2.id ) )
     continuum.buildProject( maven2.id )
     time.sleep( 3.0 )
     actualSize = len( continuum.getBuildsForProject( maven2.id ) )
     assertEquals( "A build has unexpectedly been executed.", expectedSize, actualSize )
 
-    progress( "Test that a forced build without any files changed executes the builder" )
+    progress( "Test that a forced build without any files changed executes the executor" )
     buildId = buildProject( maven2.id, True ).id
     print "forced buildId: " + buildId
     build = assertSuccessfulMaven2Build( buildId )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java Tue May 10 05:17:06 2005
@@ -19,7 +19,6 @@
 import java.net.URL;
 import java.util.Collection;
 import java.util.List;
-import java.util.List;
 import java.util.Properties;
 
 import org.apache.maven.continuum.project.AntProject;
@@ -29,8 +28,8 @@
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.ShellProject;
-import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
+import org.apache.maven.continuum.store.ContinuumStoreException;
 
 /**
  * This is the main entry point for Continuum. Projects are added to Continuum
@@ -49,14 +48,14 @@
 
     //TODO: an URL converter in OGNL would be nice.
 
-    String addProjectFromUrl( String url, String builder )
+    List addProjectsFromUrl( String url, String projectBuilderId )
         throws ContinuumException;
 
-    String addProjectFromUrl( URL url, String builder )
+    List addProjectsFromUrl( URL url, String projectBuilderId )
         throws ContinuumException;
 
     String addProjectFromScm( String scmUrl,
-                              String builderType,
+                              String executorId,
                               String projectName,
                               String nagEmailAddress,
                               String version,

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=169455&r1=169454&r2=169455&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 Tue May 10 05:17:06 2005
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
@@ -41,12 +42,18 @@
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.ShellProject;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilderException;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+import org.apache.maven.continuum.project.builder.manager.ContinuumProjectBuilderManager;
+import org.apache.maven.continuum.project.builder.manager.ContinuumProjectBuilderManagerException;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.ContinuumScm;
 import org.apache.maven.continuum.scm.ContinuumScmException;
 import org.apache.maven.continuum.scm.queue.CheckOutTask;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
+
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
@@ -81,6 +88,9 @@
     private BuilderManager builderManager;
 
     /** @requirement */
+    private ContinuumProjectBuilderManager projectBuilderManager;
+
+    /** @requirement */
     private TaskQueue buildQueue;
 
     /** @requirement */
@@ -132,7 +142,7 @@
     // -> check out from scm
     // -> update the project metadata
 
-    public String addProjectFromUrl( String url, String builderType )
+    public List addProjectsFromUrl( String url, String executorId )
         throws ContinuumException
     {
         URL u;
@@ -146,10 +156,10 @@
             throw new ContinuumException( "Invalid URL", e );
         }
 
-        return addProjectFromUrl( u, builderType );
+        return addProjectsFromUrl( u, executorId );
     }
 
-    public String addProjectFromUrl( URL url, String builderType )
+    public List addProjectsFromUrl( URL url, String executorId )
         throws ContinuumException
     {
         File pomFile;
@@ -170,29 +180,40 @@
         }
 
         // ----------------------------------------------------------------------
-        // Really what we want to do is encapsulate the all handling to a builderType
-        // or project type handler to deal with everything. Take the initial
-        // URL which points to the metadata for the project and let the
-        // handler deal with everything else.
+        //
         // ----------------------------------------------------------------------
 
-        ContinuumBuilder builder = builderManager.getBuilder( builderType );
+        ContinuumProjectBuilder projectBuilder = getProjectBuilder( executorId );
 
-        getLogger().info( "We have the builder: " + builder );
+        ContinuumProjectBuildingResult result;
 
-        ContinuumProject project = builder.createProjectFromMetadata( url );
-
-        getLogger().info( "Done creating continuum project" );
+        try
+        {
+            result = projectBuilder.createProjectsFromMetadata( url );
+        }
+        catch ( ContinuumProjectBuilderException e )
+        {
+            throw new ContinuumException( "Error while creating projects from URL.", e );
+        }
 
         // TODO: Update from metadata in the initial checkout?
 
-        project = addProjectAndCheckOutSources( project, builderType );
+        List ids = new ArrayList( result.getProjects().size() );
 
-        return project.getId();
+        for ( Iterator it = result.getProjects().iterator(); it.hasNext(); )
+        {
+            ContinuumProject project = ( ContinuumProject ) it.next();
+
+            project = addProjectAndCheckOutSources( project, project.getExecutorId() );
+
+            ids.add( project.getId() );
+        }
+
+        return ids;
     }
 
     public String addProjectFromScm( String scmUrl,
-                                     String builderType,
+                                     String executorId,
                                      String projectName,
                                      String nagEmailAddress,
                                      String version,
@@ -207,7 +228,7 @@
 
         project.setScmUrl( scmUrl );
 
-        project.setBuilderId( builderType );
+        project.setExecutorId( executorId );
 
         project.setName( projectName );
 
@@ -222,9 +243,9 @@
         // stuff out
         // ----------------------------------------------------------------------
 
-        if ( !builderManager.hasBuilder( builderType ) )
+        if ( !builderManager.hasBuilder( executorId ) )
         {
-            throw new ContinuumException( "No such builder '" + builderType + "'." );
+            throw new ContinuumException( "No such executor with id '" + executorId + "'." );
         }
 
         // ----------------------------------------------------------------------
@@ -237,7 +258,7 @@
         //
         // ----------------------------------------------------------------------
 
-        project = addProjectAndCheckOutSources( project, builderType );
+        project = addProjectAndCheckOutSources( project, executorId );
 
         updateProjectFromCheckOut( project );
 
@@ -247,42 +268,44 @@
     public void updateProjectFromScm( String projectId )
         throws ContinuumException
     {
+        ContinuumProject project;
+
         try
         {
-            ContinuumProject project = store.getProject( projectId );
+            project = store.getProject( projectId );
+        }
+        catch ( ContinuumStoreException ex )
+        {
+            throw logAndCreateException( "Error while updating project from SCM.", ex );
+        }
+
+        File workingDirectory = new File( project.getWorkingDirectory() );
 
-            File workingDirectory = new File( project.getWorkingDirectory() );
+        if ( !workingDirectory.exists() )
+        {
+            getLogger().warn( "Creating missing working directory for project '" + project.getName() + "'." );
 
             if ( !workingDirectory.exists() )
             {
-                getLogger().warn( "Creating missing working directory for project '" + project.getName() + "'." );
-
-                if ( !workingDirectory.exists() )
-                {
-                    throw new ContinuumException( "Could not make missing working directory for " +
-                                                  "project '" + project.getName() + "'." );
-                }
+                throw new ContinuumException( "Could not make missing working directory for " +
+                                              "project '" + project.getName() + "'." );
             }
+        }
 
-            // ----------------------------------------------------------------------
-            // Update the source code
-            // ----------------------------------------------------------------------
-
-            try
-            {
-                scm.updateProject( project );
-            }
-            catch ( ContinuumScmException e )
-            {
-                throw new ContinuumException( "Error while updating project.", e );
-            }
+        // ----------------------------------------------------------------------
+        // Update the source code
+        // ----------------------------------------------------------------------
 
-            updateProjectFromCheckOut( project );
+        try
+        {
+            scm.updateProject( project );
         }
-        catch ( ContinuumStoreException ex )
+        catch ( ContinuumScmException e )
         {
-            throw logAndCreateException( "Error while updating project from SCM.", ex );
+            throw new ContinuumException( "Error while updating project.", e );
         }
+
+        updateProjectFromCheckOut( project );
     }
 
     public void updateProjectConfiguration( String projectId, Properties configuration )
@@ -359,8 +382,6 @@
         {
             ContinuumProject project = store.getProject( projectId );
 
-//            store.setBuildSignalled( projectId );
-
             getLogger().info( "Enqueuing '" + project.getName() + "'." );
 
             buildQueue.put( new BuildProjectTask( projectId, force ) );
@@ -652,14 +673,27 @@
 
         p2.setVersion( p1.getVersion() );
 
-        p2.setBuilderId( p1.getBuilderId() );
+        p2.setExecutorId( p1.getExecutorId() );
     }
 
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
 
-    private ContinuumProject addProjectAndCheckOutSources( ContinuumProject project, String builderType )
+    private ContinuumProjectBuilder getProjectBuilder( String projectBuilderId )
+        throws ContinuumException
+    {
+        try
+        {
+            return projectBuilderManager.getProjectCreator( projectBuilderId );
+        }
+        catch ( ContinuumProjectBuilderManagerException e )
+        {
+            throw new ContinuumException( "Error while getting project builder '" + projectBuilderId + "'.", e );
+        }
+    }
+
+    private ContinuumProject addProjectAndCheckOutSources( ContinuumProject project, String executorId )
         throws ContinuumException
     {
         String projectId;
@@ -676,7 +710,7 @@
                                           project.getScmUrl(),
                                           project.getNagEmailAddress(),
                                           project.getVersion(),
-                                          builderType,
+                                          executorId,
                                           null,
                                           project.getConfiguration() );
 
@@ -760,13 +794,13 @@
     private void updateProjectFromCheckOut( ContinuumProject project )
         throws ContinuumException
     {
+        getLogger().info( "Updating project '" + project.getName() + "'.");
+
         // ----------------------------------------------------------------------
         // Make a new descriptor
         // ----------------------------------------------------------------------
 
-        ContinuumBuilder builder = builderManager.getBuilder( project.getBuilderId() );
-
-        String id = project.getId();
+        ContinuumBuilder builder = builderManager.getBuilder( project.getExecutorId() );
 
         builder.updateProjectFromCheckOut( new File( project.getWorkingDirectory() ), project );
 
@@ -776,6 +810,8 @@
 
         try
         {
+            String id = project.getId();
+
             store.updateProject( id,
                                  project.getName(),
                                  project.getScmUrl(),
@@ -788,8 +824,6 @@
         {
             throw logAndCreateException( "Error while storing the updated project.", e );
         }
-
-        getLogger().info( "Updated project: " + project.getName() );
     }
 
     // ----------------------------------------------------------------------
@@ -826,7 +860,7 @@
         {
             ContinuumProject project = (ContinuumProject) it.next();
 
-            getLogger().info( " " + project.getId() + ":" + project.getName() + ":" + project.getBuilderId() );
+            getLogger().info( " " + project.getId() + ":" + project.getName() + ":" + project.getExecutorId() );
         }
     }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java Tue May 10 05:17:06 2005
@@ -18,12 +18,11 @@
 
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
 import org.apache.maven.continuum.store.ContinuumStore;
-import org.apache.maven.continuum.store.ContinuumStoreException;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.taskqueue.Task;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>

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=169455&r1=169454&r2=169455&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 Tue May 10 05:17:06 2005
@@ -19,6 +19,7 @@
 import java.io.File;
 import java.util.Collection;
 
+import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.builder.ContinuumBuilder;
 import org.apache.maven.continuum.builder.manager.BuilderManager;
@@ -32,6 +33,7 @@
 import org.apache.maven.continuum.scm.UpdateScmResult;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
+
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
@@ -52,6 +54,9 @@
     private ContinuumNotificationDispatcher notifier;
 
     /** @requirement */
+    private Continuum continuum;
+
+    /** @requirement */
     private ContinuumScm scm;
 
     // ----------------------------------------------------------------------
@@ -107,11 +112,11 @@
 
         try
         {
-            context.builder = builderManager.getBuilder( context.project.getBuilderId() );
+            context.builder = builderManager.getBuilder( context.project.getExecutorId() );
         }
         catch ( ContinuumException e )
         {
-            getLogger().fatalError( "Error while getting builder '" + context.project.getBuilderId() + "'. " +
+            getLogger().fatalError( "Error while getting builder '" + context.project.getExecutorId() + "'. " +
                                     "Project Id: '" + projectId + "'.", e );
 
             return;
@@ -224,7 +229,8 @@
 
         try
         {
-            builder.updateProjectFromCheckOut( workingDirectory, project );
+            continuum.updateProjectFromScm( project.getId() );
+//            builder.updateProjectFromCheckOut( workingDirectory, project );
         }
         catch ( ContinuumException e )
         {
@@ -234,15 +240,15 @@
 
             return false;
         }
-
-        String projectId = project.getId();
-
-        store.updateProject( projectId,
-                             project.getName(),
-                             project.getScmUrl(),
-                             project.getNagEmailAddress(),
-                             project.getVersion() );
-
+//
+//        String projectId = project.getId();
+//
+//        store.updateProject( projectId,
+//                             project.getName(),
+//                             project.getScmUrl(),
+//                             project.getNagEmailAddress(),
+//                             project.getVersion() );
+//
 //            store.updateProjectConfiguration( projectId, project.getConfiguration() );
 
         return true;

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/AbstractContinuumBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/AbstractContinuumBuilder.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/AbstractContinuumBuilder.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/AbstractContinuumBuilder.java Tue May 10 05:17:06 2005
@@ -16,17 +16,18 @@
  * limitations under the License.
  */
 
-import org.apache.maven.continuum.ContinuumException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.StringUtils;
-
 import java.io.File;
 import java.io.FileWriter;
 import java.io.InputStream;
 import java.net.URL;
 import java.util.Properties;
 
+import org.apache.maven.continuum.ContinuumException;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id: AbstractContinuumBuilder.java,v 1.1.1.1 2005/03/29 20:42:00 trygvis Exp $
@@ -37,7 +38,7 @@
 {
     protected String getConfigurationString( Properties configuration, String property )
         throws ContinuumException
-    {                
+    {
         String string = configuration.getProperty( property );
 
         if ( StringUtils.isEmpty( string ) )
@@ -94,7 +95,7 @@
         return array;
     }
 
-    protected static File createMetadataFile( URL metadata )
+    public static File createMetadataFile( URL metadata )
         throws ContinuumException
     {
         try

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ContinuumBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ContinuumBuilder.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ContinuumBuilder.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ContinuumBuilder.java Tue May 10 05:17:06 2005
@@ -17,7 +17,6 @@
  */
 
 import java.io.File;
-import java.net.URL;
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
@@ -34,8 +33,8 @@
     ContinuumBuildResult build( ContinuumProject project )
         throws ContinuumException;
 
-    ContinuumProject createProjectFromMetadata( URL metadata )
-        throws ContinuumException;
+//    ContinuumProject createProjectFromMetadata( URL metadata )
+//        throws ContinuumException;
 
     void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project )
         throws ContinuumException;

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ant/AntBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ant/AntBuilder.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ant/AntBuilder.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/ant/AntBuilder.java Tue May 10 05:17:06 2005
@@ -17,7 +17,6 @@
  */
 
 import java.io.File;
-import java.net.URL;
 import java.util.Properties;
 
 import org.apache.maven.continuum.ContinuumException;
@@ -84,12 +83,6 @@
         result.setExitCode( executionResult.getExitCode() );
 
         return result;
-    }
-
-    public ContinuumProject createProjectFromMetadata( URL metadata )
-        throws ContinuumException
-    {
-        throw new ContinuumException( "The Ant builder cannot create metadata from a URL." );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project )

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/DefaultMavenOneMetadataHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/DefaultMavenOneMetadataHelper.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/DefaultMavenOneMetadataHelper.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/DefaultMavenOneMetadataHelper.java Tue May 10 05:17:06 2005
@@ -0,0 +1,169 @@
+package org.apache.maven.continuum.builder.maven.m1;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.io.FileReader;
+import java.util.Properties;
+
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.project.ContinuumProject;
+
+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;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public class DefaultMavenOneMetadataHelper
+    extends AbstractLogEnabled
+    implements MavenOneMetadataHelper
+{
+    // ----------------------------------------------------------------------
+    // MavenOneMetadataHelper Implementation
+    // ----------------------------------------------------------------------
+
+    public void mapMetadata( File metadata, ContinuumProject project )
+        throws ContinuumException
+    {
+        Xpp3Dom mavenProject;
+
+        try
+        {
+            mavenProject = Xpp3DomBuilder.build( new FileReader( metadata ) );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "Error while reading maven POM.", e );
+        }
+
+        // ----------------------------------------------------------------------
+        // Populating the descriptor
+        // ----------------------------------------------------------------------
+
+        // Name
+        String name = getValue( mavenProject, "name", project.getName() );
+
+        if ( StringUtils.isEmpty( name ) )
+        {
+            throw new ContinuumException( "Missing <name> from the project descriptor." );
+        }
+
+        // Scm
+        Xpp3Dom repository = mavenProject.getChild( "repository" );
+
+        String scmConnection;
+
+        if ( repository == null )
+        {
+            if ( !StringUtils.isEmpty( project.getScmUrl() ) )
+            {
+                scmConnection = project.getScmUrl();
+            }
+            else
+            {
+                throw new ContinuumException( "The project descriptor is missing the SCM information." );
+            }
+        }
+        else
+        {
+            scmConnection = getValue( repository, "developerConnection", project.getScmUrl() );
+
+            scmConnection = getValue( repository, "connection", scmConnection );
+
+            if ( StringUtils.isEmpty( scmConnection ) )
+            {
+                throw new ContinuumException( "Missing both anonymous and developer scm connection urls." );
+            }
+        }
+
+        // Nag email address
+        Xpp3Dom build = mavenProject.getChild( "build" );
+
+        String nagEmailAddress;
+
+        if ( build == null )
+        {
+            if ( !StringUtils.isEmpty( project.getNagEmailAddress() ) )
+            {
+                nagEmailAddress = project.getNagEmailAddress();
+            }
+            else
+            {
+                throw new ContinuumException( "Missing build section." );
+            }
+        }
+        else
+        {
+            nagEmailAddress = getValue( build, "nagEmailAddress", project.getNagEmailAddress() );
+        }
+
+        if ( StringUtils.isEmpty( nagEmailAddress ) )
+        {
+            throw new ContinuumException( "Missing nag email address from the project descriptor." );
+        }
+
+        // Version
+        String version = getValue( mavenProject, "currentVersion", project.getVersion() );
+
+        if ( StringUtils.isEmpty( version ) )
+        {
+            throw new ContinuumException( "Missing version from the project descriptor." );
+        }
+
+        // Goals
+        Properties configuration = new Properties();
+
+        if ( !configuration.containsKey( Maven1Builder.CONFIGURATION_GOALS ) )
+        {
+            configuration.setProperty( Maven1Builder.CONFIGURATION_GOALS, "clean:clean, jar:install" );
+        }
+
+        // ----------------------------------------------------------------------
+        // Make the project
+        // ----------------------------------------------------------------------
+
+        project.setName( name );
+
+        project.setScmUrl( scmConnection );
+
+        project.setNagEmailAddress( nagEmailAddress );
+
+        project.setVersion( version );
+
+        project.setConfiguration( configuration );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    private String getValue( Xpp3Dom dom, String key, String defaultValue )
+    {
+        Xpp3Dom child = dom.getChild( key );
+
+        if ( child == null )
+        {
+            return defaultValue;
+        }
+
+        return child.getValue();
+    }
+}

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/Maven1Builder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/Maven1Builder.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/Maven1Builder.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/Maven1Builder.java Tue May 10 05:17:06 2005
@@ -17,8 +17,6 @@
  */
 
 import java.io.File;
-import java.io.FileReader;
-import java.net.URL;
 import java.util.Properties;
 
 import org.apache.maven.continuum.ContinuumException;
@@ -29,10 +27,6 @@
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumProject;
 
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id: Maven1Builder.java,v 1.2 2005/04/03 21:27:17 trygvis Exp $
@@ -48,6 +42,9 @@
     /** @requirement */
     private ShellCommandHelper shellCommandHelper;
 
+    /** @requirement */
+    private MavenOneMetadataHelper metadataHelper;
+
     /** @configuration */
     private String mavenCommand;
 
@@ -90,167 +87,28 @@
         return result;
     }
 
-    public ContinuumProject createProjectFromMetadata( URL metadata )
-        throws ContinuumException
-    {
-        File pomFile = createMetadataFile( metadata );
-
-        ContinuumProject project = new ContinuumProject();
-
-        mapMetadata( pomFile, project );
-
-        return project;
-    }
+//    public ContinuumProject createProjectFromMetadata( URL metadata )
+//        throws ContinuumException
+//    {
+//        File pomFile = createMetadataFile( metadata );
+//
+//        ContinuumProject project = new ContinuumProject();
+//
+//        mapMetadata( pomFile, project );
+//
+//        return project;
+//    }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project )
         throws ContinuumException
     {
-        File projectXmlFile = getProjectXmlFile( workingDirectory );
-
-        mapMetadata( projectXmlFile, project );
-    }
-
-    // ----------------------------------------------------------------------
-    //
-    // ----------------------------------------------------------------------
-
-    protected void mapMetadata( File metadata, ContinuumProject project )
-        throws ContinuumException
-    {
-        Xpp3Dom mavenProject;
-
-        try
-        {
-            mavenProject = Xpp3DomBuilder.build( new FileReader( metadata ) );
-        }
-        catch ( Exception e )
-        {
-            throw new ContinuumException( "Error while reading maven POM.", e );
-        }
-
-        // ----------------------------------------------------------------------
-        // Populating the descriptor
-        // ----------------------------------------------------------------------
-
-        // Name
-        String name = getValue( mavenProject, "name", project.getName() );
-
-        if ( StringUtils.isEmpty( name ) )
-        {
-            throw new ContinuumException( "Missing <name> from the project descriptor." );
-        }
-
-        // Scm
-        Xpp3Dom repository = mavenProject.getChild( "repository" );
-
-        String scmConnection;
-
-        if ( repository == null )
-        {
-            if ( !StringUtils.isEmpty( project.getScmUrl() ) )
-            {
-                scmConnection = project.getScmUrl();
-            }
-            else
-            {
-                throw new ContinuumException( "The project descriptor is missing the SCM information." );
-            }
-        }
-        else
-        {
-            scmConnection = getValue( repository, "developerConnection", project.getScmUrl() );
-
-            scmConnection = getValue( repository, "connection", scmConnection );
-
-            if ( StringUtils.isEmpty( scmConnection ) )
-            {
-                throw new ContinuumException( "Missing both anonymous and developer scm connection urls." );
-            }
-        }
-
-        // Nag email address
-        Xpp3Dom build = mavenProject.getChild( "build" );
-
-        String nagEmailAddress;
-
-        if ( build == null )
-        {
-            if ( !StringUtils.isEmpty( project.getNagEmailAddress() ) )
-            {
-                nagEmailAddress = project.getNagEmailAddress();
-            }
-            else
-            {
-                throw new ContinuumException( "Missing build section." );
-            }
-        }
-        else
-        {
-            nagEmailAddress = getValue( build, "nagEmailAddress", project.getNagEmailAddress() );
-        }
-
-        if ( StringUtils.isEmpty( nagEmailAddress ) )
-        {
-            throw new ContinuumException( "Missing nag email address from the project descriptor." );
-        }
-
-        // Version
-        String version = getValue( mavenProject, "currentVersion", project.getVersion() );
-
-        if ( StringUtils.isEmpty( version ) )
-        {
-            throw new ContinuumException( "Missing version from the project descriptor." );
-        }
-
-        // Goals
-        Properties configuration = new Properties();
-
-        if ( !configuration.containsKey( CONFIGURATION_GOALS ) )
-        {
-            configuration.setProperty( CONFIGURATION_GOALS, "clean:clean, jar:install" );
-        }
-
-        // ----------------------------------------------------------------------
-        // Make the project
-        // ----------------------------------------------------------------------
-
-        project.setName( name );
-
-        project.setScmUrl( scmConnection );
-
-        project.setNagEmailAddress( nagEmailAddress );
-
-        project.setVersion( version );
-
-        project.setConfiguration( configuration );
-    }
-
-    // ----------------------------------------------------------------------
-    //
-    // ----------------------------------------------------------------------
-
-    private File getProjectXmlFile( File basedir )
-        throws ContinuumException
-    {
-        File projectXmlFile = new File( basedir, "project.xml" );
+        File projectXmlFile = new File( workingDirectory, "project.xml" );
 
         if ( !projectXmlFile.isFile() )
         {
             throw new ContinuumException( "Could not find Maven project descriptor." );
         }
 
-        return projectXmlFile;
-    }
-
-    private String getValue( Xpp3Dom dom, String key, String defaultValue )
-    {
-        Xpp3Dom child = dom.getChild( key );
-
-        if ( child == null )
-        {
-            return defaultValue;
-        }
-
-        return child.getValue();
+        metadataHelper.mapMetadata( projectXmlFile, project );
     }
 }

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/MavenOneMetadataHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/MavenOneMetadataHelper.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/MavenOneMetadataHelper.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m1/MavenOneMetadataHelper.java Tue May 10 05:17:06 2005
@@ -0,0 +1,34 @@
+package org.apache.maven.continuum.builder.maven.m1;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.project.ContinuumProject;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public interface MavenOneMetadataHelper
+{
+    String ROLE = MavenOneMetadataHelper.class.getName();
+
+    void mapMetadata( File metadata, ContinuumProject project )
+        throws ContinuumException;
+}

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/DefaultMavenBuilderHelper.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/DefaultMavenBuilderHelper.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/DefaultMavenBuilderHelper.java Tue May 10 05:17:06 2005
@@ -28,7 +28,6 @@
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.model.CiManagement;
 import org.apache.maven.model.Notifier;
 import org.apache.maven.model.Repository;
@@ -68,35 +67,56 @@
     // MavenBuilderHelper Implementation
     // ----------------------------------------------------------------------
 
-    public ContinuumProject createProjectFromMetadata( URL metadata )
+//    public ContinuumProject createProjectFromMetadata( URL metadata )
+//        throws ContinuumException
+//    {
+//        // ----------------------------------------------------------------------
+//        // We need to roll the project data into a file so that we can use it
+//        // ----------------------------------------------------------------------
+//
+//        MavenTwoProject project = new MavenTwoProject();
+//
+//        try
+//        {
+//            File file = createMetadataFile( metadata );
+//
+//            mapMetadataToProject( file, project );
+//        }
+//        catch ( Exception e )
+//        {
+//            throw new ContinuumException( "Cannot create continuum project:", e );
+//        }
+//
+//        return project;
+//    }
+//
+//    public void updateProjectFromMetadata( File workingDirectory, ContinuumProject project )
+//        throws ContinuumException
+//    {
+//        File f = new File( workingDirectory, "pom.xml" );
+//
+//        mapMetadataToProject( f, project );
+//    }
+
+    public void mapMetadataToProject( File metadata, ContinuumProject project )
         throws ContinuumException
     {
-        // ----------------------------------------------------------------------
-        // We need to roll the project data into a file so that we can use it
-        // ----------------------------------------------------------------------
+        MavenProject mavenProject = getProject( metadata );
 
-        MavenTwoProject project = new MavenTwoProject();
+        project.setNagEmailAddress( getNagEmailAddress( mavenProject ) );
 
-        try
-        {
-            File file = createMetadataFile( metadata );
+        project.setName( getProjectName( mavenProject ) );
 
-            mapMetadataToProject( file, project );
-        }
-        catch ( Exception e )
-        {
-            throw new ContinuumException( "Cannot create continuum project:", e );
-        }
+        project.setScmUrl( getScmUrl( mavenProject ) );
 
-        return project;
-    }
+        project.setVersion( getVersion( mavenProject ) );
 
-    public void updateProjectFromMetadata( File workingDirectory, ContinuumProject project )
-        throws ContinuumException
-    {
-        File f = new File( workingDirectory, "pom.xml" );
+        Properties configuration = project.getConfiguration();
 
-        mapMetadataToProject( f, project );
+        if ( !configuration.containsKey( MavenShellBuilder.CONFIGURATION_GOALS ) )
+        {
+            configuration.setProperty( MavenShellBuilder.CONFIGURATION_GOALS, "clean:clean, install" );
+        }
     }
 
     // ----------------------------------------------------------------------
@@ -166,27 +186,6 @@
         catch ( Exception e )
         {
             throw new ContinuumException( "Cannot create metadata file:", e );
-        }
-    }
-
-    protected void mapMetadataToProject( File metadata, ContinuumProject project )
-        throws ContinuumException
-    {
-        MavenProject mavenProject = getProject( metadata );
-
-        project.setNagEmailAddress( getNagEmailAddress( mavenProject ) );
-
-        project.setName( getProjectName( mavenProject ) );
-
-        project.setScmUrl( getScmUrl( mavenProject ) );
-
-        project.setVersion( getVersion( mavenProject ) );
-
-        Properties configuration = project.getConfiguration();
-
-        if ( !configuration.containsKey( MavenShellBuilder.CONFIGURATION_GOALS ) )
-        {
-            configuration.setProperty( MavenShellBuilder.CONFIGURATION_GOALS, "clean:clean, install" );
         }
     }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenBuilderHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenBuilderHelper.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenBuilderHelper.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenBuilderHelper.java Tue May 10 05:17:06 2005
@@ -17,7 +17,6 @@
  */
 
 import java.io.File;
-import java.net.URL;
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.project.ContinuumProject;
@@ -30,9 +29,12 @@
 {
     String ROLE = MavenBuilderHelper.class.getName();
 
-    public ContinuumProject createProjectFromMetadata( URL metadata )
-        throws ContinuumException;
+//    public ContinuumProject createProjectFromMetadata( URL metadata )
+//        throws ContinuumException;
 
-    public void updateProjectFromMetadata( File workingDirectory, ContinuumProject project )
+//    public void updateProjectFromMetadata( File workingDirectory, ContinuumProject project )
+//        throws ContinuumException;
+
+    void mapMetadataToProject( File metadata, ContinuumProject project )
         throws ContinuumException;
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenShellBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenShellBuilder.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenShellBuilder.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/maven/m2/MavenShellBuilder.java Tue May 10 05:17:06 2005
@@ -17,7 +17,6 @@
  */
 
 import java.io.File;
-import java.net.URL;
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.builder.AbstractContinuumBuilder;
@@ -90,19 +89,25 @@
         return result;
     }
 
-    public ContinuumProject createProjectFromMetadata( URL metadata )
-        throws ContinuumException
-    {
-        return builderHelper.createProjectFromMetadata( metadata );
-    }
-
+//    public ContinuumProject createProjectFromMetadata( URL metadata )
+//        throws ContinuumException
+//    {
+//        return builderHelper.createProjectFromMetadata( metadata );
+//    }
+//
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project )
         throws ContinuumException
     {
-        builderHelper.updateProjectFromMetadata( workingDirectory, project );
+        File f = new File( workingDirectory, "pom.xml" );
+
+        builderHelper.mapMetadataToProject( f, project );
     }
 
-    protected String[] getArguments( ContinuumProject project )
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    private String[] getArguments( ContinuumProject project )
         throws ContinuumException
     {
         String[] a = splitAndTrimString( this.arguments, " " );

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/shell/ShellBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/shell/ShellBuilder.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/shell/ShellBuilder.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builder/shell/ShellBuilder.java Tue May 10 05:17:06 2005
@@ -17,7 +17,6 @@
  */
 
 import java.io.File;
-import java.net.URL;
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.builder.AbstractContinuumBuilder;
@@ -109,12 +108,6 @@
         result.setExitCode( executionResult.getExitCode() );
 
         return result;
-    }
-
-    public ContinuumProject createProjectFromMetadata( URL metadata )
-        throws ContinuumException
-    {
-        throw new ContinuumException( "The Ant builder cannot create metadata from a URL." );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java Tue May 10 05:17:06 2005
@@ -21,9 +21,9 @@
 
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.scm.UpdateScmResult;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.apache.maven.continuum.scm.UpdateScmResult;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.notification.NotificationDispatcher;

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java Tue May 10 05:17:06 2005
@@ -34,6 +34,7 @@
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.exception.ResourceNotFoundException;
+
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.mailsender.MailMessage;
 import org.codehaus.plexus.mailsender.MailSender;
@@ -199,7 +200,7 @@
 
         String packageName = getClass().getPackage().getName().replace( '.', '/' );
 
-        String templateName = "/" + packageName + "/templates/" + project.getBuilderId() + "/" + source + ".vm";
+        String templateName = "/" + packageName + "/templates/" + project.getExecutorId() + "/" + source + ".vm";
 
         StringWriter writer = new StringWriter();
 

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java Tue May 10 05:17:06 2005
@@ -0,0 +1,31 @@
+package org.apache.maven.continuum.project.builder;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public interface ContinuumProjectBuilder
+{
+    String ROLE = ContinuumProjectBuilder.class.getName();
+
+    ContinuumProjectBuildingResult createProjectsFromMetadata( URL url )
+        throws ContinuumProjectBuilderException;
+}

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilderException.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilderException.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilderException.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilderException.java Tue May 10 05:17:06 2005
@@ -0,0 +1,35 @@
+package org.apache.maven.continuum.project.builder;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public class ContinuumProjectBuilderException
+    extends Exception
+{
+    public ContinuumProjectBuilderException( String message )
+    {
+        super( message );
+    }
+
+    public ContinuumProjectBuilderException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+}

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java Tue May 10 05:17:06 2005
@@ -0,0 +1,46 @@
+package org.apache.maven.continuum.project.builder;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+import java.util.ArrayList;
+
+import org.apache.maven.continuum.project.ContinuumProject;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public class ContinuumProjectBuildingResult
+{
+    private List projects;
+
+    public ContinuumProjectBuildingResult()
+    {
+        projects = new ArrayList();
+    }
+
+    public void addProject( ContinuumProject project )
+    {
+        projects.add( project );
+    }
+
+    public List getProjects()
+    {
+        return projects;
+    }
+}

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManager.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManager.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManager.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManager.java Tue May 10 05:17:06 2005
@@ -0,0 +1,31 @@
+package org.apache.maven.continuum.project.builder.manager;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public interface ContinuumProjectBuilderManager
+{
+    String ROLE = ContinuumProjectBuilderManager.class.getName();
+
+    ContinuumProjectBuilder getProjectCreator( String id )
+        throws ContinuumProjectBuilderManagerException;
+}

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManagerException.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManagerException.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManagerException.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/ContinuumProjectBuilderManagerException.java Tue May 10 05:17:06 2005
@@ -0,0 +1,35 @@
+package org.apache.maven.continuum.project.builder.manager;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public class ContinuumProjectBuilderManagerException
+    extends Exception
+{
+    public ContinuumProjectBuilderManagerException( String message )
+    {
+        super( message );
+    }
+
+    public ContinuumProjectBuilderManagerException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+}

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java Tue May 10 05:17:06 2005
@@ -0,0 +1,52 @@
+package org.apache.maven.continuum.project.builder.manager;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.Map;
+
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public class DefaultContinuumProjectBuilderManager
+    extends AbstractLogEnabled
+    implements ContinuumProjectBuilderManager
+{
+    /** @requirement */
+    private Map projectBuilders;
+
+    // ----------------------------------------------------------------------
+    // ProjectCreatorManager Implementation
+    // ----------------------------------------------------------------------
+
+    public ContinuumProjectBuilder getProjectCreator( String id )
+        throws ContinuumProjectBuilderManagerException
+    {
+        ContinuumProjectBuilder projectBuilder = ( ContinuumProjectBuilder ) projectBuilders.get( id );
+
+        if ( projectBuilder == null )
+        {
+            throw new ContinuumProjectBuilderManagerException( "No such project creator with id '" + id + "'." );
+        }
+
+        return projectBuilder;
+    }
+}

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java Tue May 10 05:17:06 2005
@@ -0,0 +1,73 @@
+package org.apache.maven.continuum.project.builder.maven;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.net.URL;
+
+import org.apache.maven.continuum.builder.AbstractContinuumBuilder;
+import org.apache.maven.continuum.builder.maven.m1.Maven1Builder;
+import org.apache.maven.continuum.builder.maven.m1.MavenOneMetadataHelper;
+import org.apache.maven.continuum.project.MavenOneProject;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilderException;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public class MavenOneContinuumProjectBuilder
+    extends AbstractLogEnabled
+    implements ContinuumProjectBuilder
+{
+    public static final String ID = "maven-one-builder";
+
+    /** @requirement */
+    private MavenOneMetadataHelper metadataHelper;
+
+    // ----------------------------------------------------------------------
+    // ProjectCreator Implementation
+    // ----------------------------------------------------------------------
+
+    public ContinuumProjectBuildingResult createProjectsFromMetadata( URL url )
+        throws ContinuumProjectBuilderException
+    {
+        ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult();
+
+        try
+        {
+            File pomFile = AbstractContinuumBuilder.createMetadataFile( url );
+
+            MavenOneProject project = new MavenOneProject();
+
+            metadataHelper.mapMetadata( pomFile, project );
+
+            project.setExecutorId( Maven1Builder.ID );
+
+            result.addProject( project );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumProjectBuilderException( "Cannot create continuum project.", e );
+        }
+
+        return result;
+    }
+}

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java?rev=169455&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java Tue May 10 05:17:06 2005
@@ -0,0 +1,77 @@
+package org.apache.maven.continuum.project.builder.maven;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.net.URL;
+
+import org.apache.maven.continuum.builder.AbstractContinuumBuilder;
+import org.apache.maven.continuum.builder.maven.m2.MavenBuilderHelper;
+import org.apache.maven.continuum.builder.maven.m2.MavenShellBuilder;
+import org.apache.maven.continuum.project.MavenTwoProject;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilderException;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public class MavenTwoContinuumProjectBuilder
+    extends AbstractLogEnabled
+    implements ContinuumProjectBuilder
+{
+    public static final String ID = "maven-two-builder";
+
+    /** @requirement */
+    private MavenBuilderHelper builderHelper;
+
+    // ----------------------------------------------------------------------
+    // ProjectCreator Implementation
+    // ----------------------------------------------------------------------
+
+    public ContinuumProjectBuildingResult createProjectsFromMetadata( URL url )
+        throws ContinuumProjectBuilderException
+    {
+        // ----------------------------------------------------------------------
+        // We need to roll the project data into a file so that we can use it
+        // ----------------------------------------------------------------------
+
+        ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult();
+
+        MavenTwoProject project = new MavenTwoProject();
+
+        try
+        {
+            File file = AbstractContinuumBuilder.createMetadataFile( url );
+
+            builderHelper.mapMetadataToProject( file, project );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumProjectBuilderException( "Cannot create continuum project.", e );
+        }
+
+        project.setExecutorId( MavenShellBuilder.ID );
+
+        result.addProject( project );
+
+        return result;
+    }
+}

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/UrlSocketRegistrar.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/UrlSocketRegistrar.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/UrlSocketRegistrar.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/registration/socket/UrlSocketRegistrar.java Tue May 10 05:17:06 2005
@@ -20,8 +20,11 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
 
 import org.apache.maven.continuum.network.ConnectionConsumer;
+import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
 import org.apache.maven.continuum.registration.AbstractContinuumRegistrar;
 import org.apache.maven.continuum.socket.SimpleSocket;
 import org.apache.maven.continuum.utils.ContinuumUtils;
@@ -49,11 +52,16 @@
 
             URL u = new URL( url );
 
-            String projectId = getContinuum().addProjectFromUrl( u, "maven2" );
+            List ids = getContinuum().addProjectsFromUrl( u, MavenTwoContinuumProjectBuilder.ID );
 
-            socket.writeLine( "OK" );
+            for ( Iterator it = ids.iterator(); it.hasNext(); )
+            {
+                String id = (String) it.next();
+
+                socket.writeLine( "id=" + id );
+            }
 
-            socket.writeLine( "id=" + projectId );
+            socket.writeLine( "OK" );
         }
         catch( Exception ex )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java Tue May 10 05:17:06 2005
@@ -18,17 +18,17 @@
 
 import java.io.File;
 
+import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.ContinuumScm;
 import org.apache.maven.continuum.scm.ContinuumScmException;
-import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.apache.maven.continuum.project.ContinuumProject;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.taskqueue.Task;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?rev=169455&r1=169454&r2=169455&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java Tue May 10 05:17:06 2005
@@ -48,7 +48,13 @@
     // ContinuumProject
     // ----------------------------------------------------------------------
 
-    String addProject( String name, String scmUrl, String nagEmailAddress, String version, String builderId, String workingDirectory, Properties properties )
+    String addProject( String name,
+                       String scmUrl,
+                       String nagEmailAddress,
+                       String version,
+                       String executorId,
+                       String workingDirectory,
+                       Properties properties )
         throws ContinuumStoreException;
 
     void removeProject( String projectId )
@@ -57,7 +63,11 @@
     void setWorkingDirectory( String projectId, String workingDirectory )
         throws ContinuumStoreException;
 
-    void updateProject( String projectId, String name, String scmUrl, String nagEmailAddress, String version )
+    void updateProject( String projectId,
+                        String name,
+                        String scmUrl,
+                        String nagEmailAddress,
+                        String version )
         throws ContinuumStoreException;
 
     void updateProjectConfiguration( String projectId, Properties configuration )
@@ -85,7 +95,11 @@
     String createBuild( String projectId, boolean forced )
         throws ContinuumStoreException;
 
-    void setBuildResult( String buildId, int state, ContinuumBuildResult result, UpdateScmResult scmResult, Throwable error )
+    void setBuildResult( String buildId,
+                         int state,
+                         ContinuumBuildResult result,
+                         UpdateScmResult scmResult,
+                         Throwable error )
         throws ContinuumStoreException;
 
     ContinuumBuild getBuild( String buildId )



Mime
View raw message