continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r943391 [1/3] - in /continuum/branches/continuum-flat-multi-module-updated: ./ continuum-api/src/main/java/org/apache/continuum/buildmanager/ continuum-api/src/main/java/org/apache/continuum/taskqueue/ continuum-api/src/main/java/org/apache...
Date Wed, 12 May 2010 06:41:28 GMT
Author: oching
Date: Wed May 12 06:41:26 2010
New Revision: 943391

URL: http://svn.apache.org/viewvc?rev=943391&view=rev
Log:
merge -r943159 from continuum-flat-multi-module branch

Added:
    continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/test/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryServiceTest.java
      - copied unchanged from r943159, continuum/branches/continuum-flat-multi-module/continuum-commons/src/test/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryServiceTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/pom.xml
      - copied unchanged from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/pom.xml
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/continuum/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/continuum/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/continuum/module/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/continuum/module/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/continuum/module/c/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/continuum/module/c/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/continuum/module/c/App.java
      - copied unchanged from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/main/java/org/apache/continuum/module/c/App.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/continuum/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/continuum/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/continuum/module/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/continuum/module/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/continuum/module/b/
      - copied from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/continuum/module/b/
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/continuum/module/b/AppTest.java
      - copied unchanged from r943159, continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/multi-module/module-C/module-D/src/test/java/org/apache/continuum/module/b/AppTest.java
Modified:
    continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-commons/pom.xml
    continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test-projects/multi-module/pom.xml
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/mdo/continuum.xml
    continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/resources/package-default.orm
    continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/resources/META-INF/plexus/components.xml
    continuum/branches/continuum-flat-multi-module-updated/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
    continuum/branches/continuum-flat-multi-module-updated/pom.xml

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java Wed May 12 06:41:26 2010
@@ -92,13 +92,15 @@ public interface BuildsManager
      * @param projectId
      * @param projectName
      * @param workingDirectory
+     * @param scmRootUrl TODO
      * @param scmUsername
      * @param scmPassword
      * @param defaultBuildDefinition
+     * @param subProjects TODO
      * @throws BuildManagerException
      */
-    void checkoutProject( int projectId, String projectName, File workingDirectory, String scmUsername,
-                          String scmPassword, BuildDefinition defaultBuildDefinition )
+	void checkoutProject( int projectId, String projectName, File workingDirectory, String scmRootUrl,
+			                    String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition, List<Project> subProjects )
         throws BuildManagerException;
 
     /**

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java Wed May 12 06:41:26 2010
@@ -20,7 +20,9 @@ package org.apache.continuum.taskqueue;
  */
 
 import java.io.File;
+import java.util.List;
 
+import org.apache.maven.continuum.model.project.Project;
 import org.codehaus.plexus.taskqueue.Task;
 
 /**
@@ -39,9 +41,13 @@ public class CheckOutTask
     private final String scmUserName;
 
     private final String scmPassword;
-
+    
+    private final String scmRootUrl;
+    
+    private final List<Project> projectsWithCommonScmRoot;
+    
     public CheckOutTask( int projectId, File workingDirectory, String projectName, String scmUserName,
-                         String scmPassword )
+    			String scmPassword, String scmRootUrl, List<Project> projectsWithCommonScmRoot )
     {
         this.projectId = projectId;
 
@@ -52,6 +58,10 @@ public class CheckOutTask
         this.scmUserName = scmUserName;
 
         this.scmPassword = scmPassword;
+
+        this.scmRootUrl = scmRootUrl;
+        
+        this.projectsWithCommonScmRoot = projectsWithCommonScmRoot;
     }
 
     public int getProjectId()
@@ -85,9 +95,18 @@ public class CheckOutTask
         return scmPassword;
     }
 
-
     public int getHashCode()
     {
         return this.hashCode();
     }
+    
+    public String getScmRootUrl()
+    {
+        return scmRootUrl;
+    }
+
+    public List<Project> getProjectsWithCommonScmRoot()
+    {
+        return projectsWithCommonScmRoot;
+    } 
 }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Wed May 12 06:41:26 2010
@@ -322,13 +322,14 @@ public interface Continuum
      * @param useCredentialsCache      whether to use cached scm account credentials or not
      * @param loadRecursiveProjects    if multi modules project record all projects (if false only root project added)
      * @param buildDefintionTemplateId buildDefintionTemplateId
+     * @param checkoutInSingleDirectory TODO
      * @return a holder with the projects, project groups and errors occurred during the project adding
      * @throws ContinuumException
      */
     public ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId,
                                                               boolean checkProtocol, boolean useCredentialsCache,
                                                               boolean loadRecursiveProjects,
-                                                              int buildDefintionTemplateId )
+                                                              int buildDefintionTemplateId, boolean checkoutInSingleDirectory )
         throws ContinuumException;
 
     /**

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java Wed May 12 06:41:26 2010
@@ -55,7 +55,7 @@ public interface ContinuumBuildExecutor
         throws ContinuumBuildExecutorException;
 
     //TODO: Move as a plugin
-    void backupTestFiles( Project project, int buildId );
+    void backupTestFiles( Project project, int buildId, String projectScmRootUrl, List<Project> projectsWithCommonScmRoot );
 
     boolean shouldBuild( List<ChangeSet> changes, Project continuumProject, File workingDirectory,
                          BuildDefinition buildDefinition )

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java Wed May 12 06:41:26 2010
@@ -35,12 +35,14 @@ public interface ContinuumProjectBuilder
         throws ContinuumProjectBuilderException;
 
     ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
-                                                              boolean recursiveProjects )
+                                                              boolean recursiveProjects,
+                                                              boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException;
 
     ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
                                                               boolean recursiveProjects,
-                                                              BuildDefinitionTemplate buildDefinitionTemplate )
+                                                              BuildDefinitionTemplate buildDefinitionTemplate,
+                                                              boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException;
 
     BuildDefinitionTemplate getDefaultBuildDefinitionTemplate()

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java Wed May 12 06:41:26 2010
@@ -92,6 +92,8 @@ public class ContinuumProjectBuildingRes
     private final Map<String, String> errors = new HashMap<String, String>();
 
     private static final String LS = System.getProperty( "line.separator" );
+    
+    private Project rootProject;
 
     public void addProject( Project project )
     {
@@ -222,4 +224,14 @@ public class ContinuumProjectBuildingRes
         }
         return message.toString();
     }
+
+    public Project getRootProject()
+    {
+        return rootProject;
+    }
+
+    public void setRootProject( Project rootProject )
+    {
+        this.rootProject = rootProject;
+    }
 }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java Wed May 12 06:41:26 2010
@@ -22,6 +22,7 @@ package org.apache.maven.continuum.utils
 import org.apache.maven.continuum.model.project.Project;
 
 import java.io.File;
+import java.util.List;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -32,4 +33,10 @@ public interface WorkingDirectoryService
     String ROLE = WorkingDirectoryService.class.getName();
 
     File getWorkingDirectory( Project project );
+
+    File getWorkingDirectory( Project project, boolean shouldSet );
+    
+    File getWorkingDirectory( Project project, String projectScmRootUrl, List<Project> projects );
+    
+    File getWorkingDirectory( Project project, String projectScmRootUrl, List<Project> projects, boolean shouldSet );
 }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java Wed May 12 06:41:26 2010
@@ -998,7 +998,9 @@ public class ContinuumBuildAgentServiceI
         {
             for ( Iterator modules = model.getModules().iterator(); modules.hasNext(); )
             {
-                processProject( workingDirectory + "/" + modules.next().toString(), "pom.xml", autoVersionSubmodules,
+                String module = StringUtils.replace( modules.next().toString(), '\\', '/' );
+            	
+                processProject( workingDirectory + "/" + module, "pom.xml", autoVersionSubmodules,
                                 projects );
             }
         }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-commons/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-commons/pom.xml?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-commons/pom.xml (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-commons/pom.xml Wed May 12 06:41:26 2010
@@ -48,6 +48,10 @@ under the License.
       <scope>runtime</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven.release</groupId>
+      <artifactId>maven-release-manager</artifactId>
+    </dependency>
+    <dependency>
       <groupId>javax.annotation</groupId>
       <artifactId>jsr250-api</artifactId>
     </dependency>    
@@ -67,7 +71,35 @@ under the License.
       <groupId>org.slf4j</groupId>
       <artifactId>jcl-over-slf4j</artifactId>
       <scope>runtime</scope>
-    </dependency>    
+    </dependency>   
+    <dependency>
+      <groupId>org.jmock</groupId>
+      <artifactId>jmock-junit3</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <!-- dependency of jmock3 -->
+    <dependency>
+      <groupId>cglib</groupId>
+      <artifactId>cglib-nodep</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <!-- dependency of jmock3 -->
+    <dependency>
+      <groupId>org.objenesis</groupId>
+      <artifactId>objenesis</artifactId>  
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jmock</groupId>
+      <artifactId>jmock</artifactId>
+      <version>2.4.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>jmock</groupId>
+      <artifactId>jmock</artifactId>
+      <scope>test</scope>
+    </dependency> 
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-simple</artifactId>

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java Wed May 12 06:41:26 2010
@@ -20,6 +20,8 @@ package org.apache.maven.continuum.utils
  */
 
 import java.io.File;
+import java.util.List;
+
 import javax.annotation.Resource;
 
 import org.apache.maven.continuum.configuration.ConfigurationService;
@@ -65,10 +67,25 @@ public class ChrootJailWorkingDirectoryS
 
     public File getWorkingDirectory( Project project )
     {
+    	return getWorkingDirectory( project, true );
+    }
+
+    public File getWorkingDirectory( Project project, boolean shouldSet )
+    {
         ProjectGroup projectGroup = project.getProjectGroup();
 
         File f = new File( getChrootJailDirectory(), projectGroup.getGroupId() );
         f = new File( f, getConfigurationService().getWorkingDirectory().getPath() );
         return new File( f, Integer.toString( project.getId() ) );
     }
+    
+    public File getWorkingDirectory( Project project, String projectScmRoot, List<Project> projects )
+    {
+        return getWorkingDirectory( project, true );
+    }
+
+    public File getWorkingDirectory( Project project, String projectScmRoot, List<Project> projects, boolean shouldSet )
+    {
+        return getWorkingDirectory( project, shouldSet );
+    }
 }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java Wed May 12 06:41:26 2010
@@ -21,9 +21,11 @@ package org.apache.maven.continuum.utils
 
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.Project;
+import org.codehaus.plexus.util.StringUtils;
 import org.springframework.stereotype.Service;
 
 import java.io.File;
+import java.util.List;
 
 import javax.annotation.Resource;
 
@@ -54,19 +56,94 @@ public class DefaultWorkingDirectoryServ
 
     public File getWorkingDirectory( Project project )
     {
+    	return getWorkingDirectory( project, null, null );
+    }
+
+    public File getWorkingDirectory( Project project, boolean shouldSet )
+    {
+        return getWorkingDirectory( project, null, null, shouldSet );
+    }
+
+    /**
+     * 
+     * @param project
+     * @param projectScmRoot
+     * @param projects projects under the same projectScmRoot
+     * @return
+     */
+    public File getWorkingDirectory( Project project, String projectScmRoot, List<Project> projects )
+    {
+        return getWorkingDirectory( project, projectScmRoot, projects, true );
+    }
+
+    /**
+     * 
+     * @param project
+     * @param projectScmRoot
+     * @param projects projects under the same projectScmRoot
+     * @param shouldSet
+     * @return
+     */
+    public File getWorkingDirectory( Project project, String projectScmRoot, List<Project> projects, boolean shouldSet )
+    {
 //        TODO: Enable, this is what we really want
 //        ContinuumProjectGroup projectGroup = project.getProjectGroup();
 //
 //        return new File( projectGroup.getWorkingDirectory(),
 //                         project.getPath() );
 
-        if ( project.getWorkingDirectory() == null )
+        String workingDirectory = project.getWorkingDirectory();
+    	
+        if ( project.getWorkingDirectory() == null || "".equals( project.getWorkingDirectory() ) )
+        {   
+            if ( project.isCheckedOutInSingleDirectory() && projectScmRoot != null && !"".equals( projectScmRoot ) )
+            {                
+                Project rootProject = project;
+                if( projects != null )
+                {
+                    // the root project should have the lowest id since it's always added first                    
+                    for( Project projectUnderScmRoot : projects )
+                    {
+                        if( projectUnderScmRoot.getId() < rootProject.getId() )
+                        {
+                            rootProject = projectUnderScmRoot;
+                        }
+                    }
+                }                
+                
+             // determine the path
+                String projectScmUrl = project.getScmUrl();
+                int indexDiff = StringUtils.differenceAt( projectScmUrl, projectScmRoot );
+                                
+                String pathToProject = "";
+                if( indexDiff != -1 )
+                {
+                    pathToProject = projectScmUrl.substring( indexDiff );
+                }
+                
+                if( pathToProject.startsWith( "\\" ) || pathToProject.startsWith( "/" ) )
+                {
+                    workingDirectory = Integer.toString( rootProject.getId() ) + pathToProject;
+                }
+                else
+                {
+                    workingDirectory = Integer.toString( rootProject.getId() ) + File.separatorChar + pathToProject;
+                }                
+            }
+            else
+            {
+                workingDirectory = Integer.toString( project.getId() );
+            }
+        }
+    	
+        if ( shouldSet )
         {
-            project.setWorkingDirectory( Integer.toString( project.getId() ) );
+            project.setWorkingDirectory( workingDirectory );
         }
 
         File workDir;
-        File projectWorkingDirectory = new File( project.getWorkingDirectory() );
+        File projectWorkingDirectory = new File( workingDirectory );
+        
         if ( projectWorkingDirectory.isAbsolute() )
         {
             // clean the project working directory path if it's a subdirectory of the global working directory
@@ -79,15 +156,22 @@ public class DefaultWorkingDirectoryServ
                 {
                     pwd = pwd.substring( 1 );
                 }
-                project.setWorkingDirectory( pwd );
+               
+                if ( shouldSet )
+                {
+                    project.setWorkingDirectory( pwd );
+                }
             }
 
             workDir = projectWorkingDirectory;
         }
         else
         {
-            workDir = new File( getConfigurationService().getWorkingDirectory(), project.getWorkingDirectory() );
+            File baseWorkingDir = getConfigurationService().getWorkingDirectory();            
+        	            
+            workDir = new File( baseWorkingDir, workingDirectory );
         }
+        
         return workDir;
     }
 }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java Wed May 12 06:41:26 2010
@@ -403,10 +403,11 @@ public class ParallelBuildsManager
     }
 
     /**
-     * @see BuildsManager#checkoutProject(int, String, File, String, String, BuildDefinition)
+     * @see BuildsManager#checkoutProject(int, String, File, String, String, String, BuildDefinition, List)
      */
-    public void checkoutProject( int projectId, String projectName, File workingDirectory, String scmUsername,
-                                 String scmPassword, BuildDefinition defaultBuildDefinition )
+    public void checkoutProject( int projectId, String projectName, File workingDirectory, String scmRootUrl,
+    		                                 String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition,
+    		                                 List<Project> subProjects )
         throws BuildManagerException
     {
         try
@@ -426,7 +427,7 @@ public class ParallelBuildsManager
         OverallBuildQueue overallBuildQueue =
             getOverallBuildQueue( CHECKOUT_QUEUE, defaultBuildDefinition.getSchedule().getBuildQueues() );
         CheckOutTask checkoutTask =
-            new CheckOutTask( projectId, workingDirectory, projectName, scmUsername, scmPassword );
+        	new CheckOutTask( projectId, workingDirectory, projectName, scmUsername, scmPassword, scmRootUrl, subProjects );
         try
         {
             if ( overallBuildQueue != null )
@@ -914,7 +915,8 @@ public class ParallelBuildsManager
             {
                 BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition( task.getProjectId() );
                 checkoutProject( task.getProjectId(), task.getProjectName(), task.getWorkingDirectory(),
-                                 task.getScmUserName(), task.getScmPassword(), buildDefinition );
+                		task.getScmRootUrl(), task.getScmUserName(), task.getScmPassword(), buildDefinition,
+                		task.getProjectsWithCommonScmRoot() );
             }
             catch ( ContinuumStoreException e )
             {

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Wed May 12 06:41:26 2010
@@ -108,6 +108,7 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.Properties;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -940,6 +941,7 @@ public class DefaultContinuum
         for ( Project project : projectsList )
         {
             List<Integer> buildDefIds = (List<Integer>) projectsMap.get( project.getId() );
+            int projectId = project.getId();
 
             if ( buildDefIds != null && !buildDefIds.isEmpty() )
             {
@@ -956,7 +958,7 @@ public class DefaultContinuum
                             projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
                         }
 
-                        projectsAndBuildDefinitionsMap.put( project.getId(), buildDefId );
+                        projectsAndBuildDefinitionsMap.put( projectId, buildDefId );
 
                         map.put( scmRoot, projectsAndBuildDefinitionsMap );
 
@@ -1308,7 +1310,7 @@ public class DefaultContinuum
     {
         return executeAddProjectsFromMetadataActivity( metadataUrl, MavenOneContinuumProjectBuilder.ID, projectGroupId,
                                                        checkProtocol, useCredentialsCache, true,
-                                                       buildDefinitionTemplateId );
+                                                       buildDefinitionTemplateId, false );
     }
 
     // ----------------------------------------------------------------------
@@ -1357,7 +1359,7 @@ public class DefaultContinuum
         {
             return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
                                                            projectGroupId, checkProtocol, useCredentialsCache, true,
-                                                           buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId() );
+                                                           buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId(), false );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -1375,7 +1377,7 @@ public class DefaultContinuum
             return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
                                                            projectGroupId, checkProtocol, useCredentialsCache,
                                                            recursiveProjects,
-                                                           buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId() );
+                                                           buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId(), false );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -1385,12 +1387,13 @@ public class DefaultContinuum
 
     public ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId,
                                                               boolean checkProtocol, boolean useCredentialsCache,
-                                                              boolean recursiveProjects, int buildDefinitionTemplateId )
+                                                              boolean recursiveProjects, int buildDefinitionTemplateId,
+                                                              boolean checkoutInSingleDirectory )
         throws ContinuumException
     {
         return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID, projectGroupId,
                                                        checkProtocol, useCredentialsCache, recursiveProjects,
-                                                       buildDefinitionTemplateId );
+                                                       buildDefinitionTemplateId, checkoutInSingleDirectory );
     }
 
     // ----------------------------------------------------------------------
@@ -1538,7 +1541,7 @@ public class DefaultContinuum
         throws ContinuumException
     {
         return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, projectGroupId, checkProtocol,
-                                                       false, false, buildDefinitionTemplateId );
+        						false, false, buildDefinitionTemplateId, false );
     }
 
 
@@ -1549,7 +1552,8 @@ public class DefaultContinuum
                                                                                      boolean useCredentialsCache,
                                                                                      boolean loadRecursiveProjects,
                                                                                      int buildDefinitionTemplateId,
-                                                                                     boolean addAssignableRoles )
+                                                                                     boolean addAssignableRoles,
+                                                                                     boolean checkoutInSingleDirectory )
         throws ContinuumException
     {
         if ( checkProtocol )
@@ -1564,15 +1568,22 @@ public class DefaultContinuum
 
         Map<String, Object> context = new HashMap<String, Object>();
 
-        CreateProjectsFromMetadataAction.setProjectBuilderId( context, projectBuilderId );
+        //CreateProjectsFromMetadataAction.setProjectBuilderId( context, projectBuilderId );
+        context.put( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, projectBuilderId );
 
-        CreateProjectsFromMetadataAction.setUrl( context, metadataUrl );
+        //CreateProjectsFromMetadataAction.setUrl( context, metadataUrl );
+        context.put( AbstractContinuumAction.KEY_URL, metadataUrl );
 
-        CreateProjectsFromMetadataAction.setLoadRecursiveProject( context, loadRecursiveProjects );
+        //CreateProjectsFromMetadataAction.setLoadRecursiveProject( context, loadRecursiveProjects );
+        context.put( CreateProjectsFromMetadataAction.KEY_LOAD_RECURSIVE_PROJECTS, loadRecursiveProjects );
 
-        StoreProjectAction.setUseScmCredentialsCache( context, useCredentialsCache );
-
-        AbstractContinuumAction.setWorkingDirectory( context, getWorkingDirectory() );
+        //StoreProjectAction.setUseScmCredentialsCache( context, useCredentialsCache );
+        context.put( AbstractContinuumAction.KEY_SCM_USE_CREDENTIALS_CACHE, useCredentialsCache );
+
+        //AbstractContinuumAction.setWorkingDirectory( context, getWorkingDirectory() );
+        context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+                
+        context.put( CreateProjectsFromMetadataAction.KEY_CHECKOUT_PROJECTS_IN_SINGLE_DIRECTORY, checkoutInSingleDirectory );
 
         // CreateProjectsFromMetadataAction will check null and use default
         if ( buildDefinitionTemplateId > 0 )
@@ -1594,7 +1605,9 @@ public class DefaultContinuum
 
         executeAction( "create-projects-from-metadata", context );
 
-        ContinuumProjectBuildingResult result = CreateProjectsFromMetadataAction.getProjectBuildingResult( context );
+        //ContinuumProjectBuildingResult result = CreateProjectsFromMetadataAction.getProjectBuildingResult( context );
+        ContinuumProjectBuildingResult result =
+        	            (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT );
 
         if ( log.isInfoEnabled() )
         {
@@ -1668,7 +1681,8 @@ public class DefaultContinuum
 
             projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
 
-            String url = CreateProjectsFromMetadataAction.getUrl( context );
+            //String url = CreateProjectsFromMetadataAction.getUrl( context );
+            String url = AbstractContinuumAction.getString( context, AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, null );
 
             List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( projectGroup.getId() );
 
@@ -1737,77 +1751,36 @@ public class DefaultContinuum
         {
             projectGroupDao.updateProjectGroup( projectGroup );
 
-            for ( Project project : projects )
+            if( !checkoutInSingleDirectory )
             {
-                context = new HashMap<String, Object>();
-
-                // CONTINUUM-1953 olamy : attached buildDefs from template here
-                // if no group creation
-                if ( !projectGroupCreation && buildDefinitionTemplateId > 0 )
-                {
-                    buildDefinitionService.addTemplateInProject( buildDefinitionTemplateId,
-                                                                 projectDao.getProject( project.getId() ) );
-                }
-
-                AbstractContinuumAction.setUnvalidatedProject( context, project );
-                //
-                //            executeAction( "validate-project", context );
-                //
-                //            executeAction( "store-project", context );
-                //
-                AbstractContinuumAction.setProjectId( context, project.getId() );
-
-                if ( !StringUtils.isEmpty( scmUserName ) )
-                {
-                    project.setScmUsername( scmUserName );
-                    CheckoutProjectContinuumAction.setScmUsername( context, scmUserName );
-                }
-                if ( !StringUtils.isEmpty( scmPassword ) )
-                {
-                    project.setScmPassword( scmPassword );
-                    CheckoutProjectContinuumAction.setScmPassword( context, scmPassword );
-                }
-                // FIXME
-                // olamy  : read again the project to have values because store.updateProjectGroup( projectGroup );
-                // remove object data -> we don't display the project name in the build queue
-                AbstractContinuumAction.setProject( context, projectDao.getProject( project.getId() ) );
-
-                BuildDefinition defaultBuildDefinition = null;
-                BuildDefinitionTemplate template = null;
-                if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
+                for ( Project project : projects )
                 {
-                    template = buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate();
-
-                    if( template != null && template.getBuildDefinitions().size() > 0 )
-                    {
-                        defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
-                    }
+                	context = new HashMap<String, Object>();
+            	    addProjectToCheckoutQueue( projectBuilderId, buildDefinitionTemplateId, context,
+            				                                               projectGroupCreation, scmUserName, scmPassword, project );    
                 }
-                else if ( projectBuilderId.equals( MavenOneContinuumProjectBuilder.ID ) )
-                {
-                    template = buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate();
-
-                    if ( template != null && template.getBuildDefinitions().size() > 0 )
+            }
+            else
+            {   
+                Project project = result.getRootProject();
+                
+                if( project != null )
+                {
+                	String scmRootUrl = AbstractContinuumAction.getString( context, AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, null );
+                	context = new HashMap<String, Object>();
+
+                	context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, scmRootUrl );
+                	
+                    List<Project> projectsWithSimilarScmRoot = new ArrayList<Project>();
+                    for( Project projectWithSimilarScmRoot : projects )
                     {
-                        defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
+                    	projectsWithSimilarScmRoot.add( projectWithSimilarScmRoot );
                     }
-                }
 
-                if ( defaultBuildDefinition == null )
-                {
-                    // do not throw exception
-                    // project already added so might as well continue with the rest
-                    log.warn( "No default build definition found in the template. Project cannot be checked out." );
-                }
-                else
-                {
-                    // used by BuildManager to determine on which build queue will the project be put
-                    AbstractContinuumAction.setBuildDefinition( context, defaultBuildDefinition );
-    
-                    if ( !configurationService.isDistributedBuildEnabled() )
-                    {
-                        executeAction( "add-project-to-checkout-queue", context );
-                    }
+                    context.put( AbstractContinuumAction.KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT, projectsWithSimilarScmRoot );
+                    
+                    addProjectToCheckoutQueue( projectBuilderId, buildDefinitionTemplateId, context, projectGroupCreation,
+                                               scmUserName, scmPassword, project );    
                 }
             }
         }
@@ -1828,6 +1801,82 @@ public class DefaultContinuum
         }
         return result;
     }
+    
+    private void addProjectToCheckoutQueue( String projectBuilderId, int buildDefinitionTemplateId,
+                                            Map<String, Object> context, boolean projectGroupCreation,
+                                            String scmUserName, String scmPassword, Project project )
+        throws BuildDefinitionServiceException, ContinuumStoreException, ContinuumException
+    {
+        // CONTINUUM-1953 olamy : attached buildDefs from template here
+        // if no group creation
+        if ( !projectGroupCreation && buildDefinitionTemplateId > 0 )
+        {
+            buildDefinitionService.addTemplateInProject( buildDefinitionTemplateId,
+                                                         projectDao.getProject( project.getId() ) );
+        }
+
+        context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
+        //
+        //            executeAction( "validate-project", context );
+        //
+        //            executeAction( "store-project", context );
+        //
+        context.put( AbstractContinuumAction.KEY_PROJECT_ID, project.getId() );
+
+        // does the scm username & password really have to be set in the project?
+        if ( !StringUtils.isEmpty( scmUserName ) )
+        {
+            project.setScmUsername( scmUserName );
+            context.put( AbstractContinuumAction.KEY_SCM_USERNAME, scmUserName );
+        }
+        if ( !StringUtils.isEmpty( scmPassword ) )
+        {
+            project.setScmPassword( scmPassword );
+            context.put( AbstractContinuumAction.KEY_SCM_PASSWORD, scmPassword );
+        }
+        //FIXME
+        // olamy  : read again the project to have values because store.updateProjectGroup( projectGroup );
+        // remove object data -> we don't display the project name in the build queue
+        context.put( AbstractContinuumAction.KEY_PROJECT, projectDao.getProject( project.getId() ) );
+
+        BuildDefinition defaultBuildDefinition = null;
+        BuildDefinitionTemplate template = null;
+        if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
+        {
+            template = buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate();
+
+            if( template != null && template.getBuildDefinitions().size() > 0 )
+            {
+                defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
+            }
+        }
+        else if ( projectBuilderId.equals( MavenOneContinuumProjectBuilder.ID ) )
+        {
+            template = buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate();
+
+            if ( template != null && template.getBuildDefinitions().size() > 0 )
+            {
+                defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
+            }
+        }
+
+        if ( defaultBuildDefinition == null )
+        {
+            // do not throw exception
+            // project already added so might as well continue with the rest
+            log.warn( "No default build definition found in the template. Project cannot be checked out." );
+        }
+        else
+        {
+            // used by BuildManager to determine on which build queue will the project be put
+            context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, defaultBuildDefinition );
+
+            if ( !configurationService.isDistributedBuildEnabled() )
+            {
+                executeAction( "add-project-to-checkout-queue", context );
+            }
+        }
+    }
 
     private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
                                                                                    String projectBuilderId,
@@ -1835,12 +1884,13 @@ public class DefaultContinuum
                                                                                    boolean checkProtocol,
                                                                                    boolean useCredentialsCache,
                                                                                    boolean loadRecursiveProjects,
-                                                                                   int buildDefinitionTemplateId )
+                                                                                   int buildDefinitionTemplateId,
+                                                                                   boolean checkoutInSingleDirectory )
         throws ContinuumException
     {
         return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, projectGroupId, checkProtocol,
                                                        useCredentialsCache, loadRecursiveProjects,
-                                                       buildDefinitionTemplateId, true );
+                                                       buildDefinitionTemplateId, true, checkoutInSingleDirectory );
     }
 
     // ----------------------------------------------------------------------
@@ -3567,16 +3617,33 @@ public class DefaultContinuum
 
         projectsList =
             getProjectsInBuildOrder( projectDao.getProjectsWithDependenciesByGroupId( projectGroup.getId() ) );
+        
+        List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( projectGroup.getId() );
 
         String url = "";
 
         for ( Project project : projectsList )
         {
+        	boolean found = false;
+        	
             if ( StringUtils.isEmpty( url ) || !project.getScmUrl().startsWith( url ) )
             {
-                // this is a root
+            	// this is a root project or the project is part of a flat multi module 
                 url = project.getScmUrl();
-                createProjectScmRoot( projectGroup, url );
+                //createProjectScmRoot( projectGroup, url );
+                
+                for ( ProjectScmRoot scmRoot : scmRoots )
+                {
+                    if ( url.startsWith( scmRoot.getScmRootAddress() ) )
+                    {
+                        found = true;
+                    }
+                }
+
+                if ( !found )
+                {
+                    createProjectScmRoot( projectGroup, url );
+                }
             }
         }
     }
@@ -3584,6 +3651,11 @@ public class DefaultContinuum
     private ProjectScmRoot createProjectScmRoot( ProjectGroup projectGroup, String url )
         throws ContinuumException
     {
+    	if ( StringUtils.isEmpty( url ) )
+        {
+            return null;
+        }
+    	
         try
         {
             ProjectScmRoot scmRoot =

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java Wed May 12 06:41:26 2010
@@ -27,6 +27,7 @@ import java.util.Map;
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.dao.ProjectDao;
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.continuum.dao.ProjectScmRootDao;
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.utils.ContinuumUtils;
@@ -40,6 +41,7 @@ import org.apache.maven.continuum.model.
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectDependency;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.scm.ChangeFile;
 import org.apache.maven.continuum.model.scm.ChangeSet;
 import org.apache.maven.continuum.model.scm.ScmResult;
@@ -84,6 +86,11 @@ public class DefaultBuildController
     /**
      * @plexus.requirement
      */
+    private ProjectGroupDao projectGroupDao;
+
+    /**
+     * @plexus.requirement
+     */
     private ProjectScmRootDao projectScmRootDao;
 
     /**
@@ -330,6 +337,8 @@ public class DefaultBuildController
         context.setStartTime( System.currentTimeMillis() );
 
         context.setBuildTrigger( buildTrigger );
+        
+        Map actionContext = context.getActionContext();
 
         try
         {
@@ -347,6 +356,37 @@ public class DefaultBuildController
             context.setOldBuildResult( oldBuildResult );
 
             context.setScmResult( scmResult );
+            
+            // CONTINUUM-2193
+            ProjectGroup projectGroup = project.getProjectGroup();
+            List<ProjectScmRoot> scmRoots = projectScmRootDao.getProjectScmRootByProjectGroup( projectGroup.getId() );
+            String projectScmUrl = project.getScmUrl();
+            String projectScmRootAddress = "";
+
+            for ( ProjectScmRoot projectScmRoot : scmRoots )
+            {
+                projectScmRootAddress = projectScmRoot.getScmRootAddress();
+                if ( projectScmUrl.startsWith( projectScmRoot.getScmRootAddress() ) )
+                {
+                    actionContext.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, projectScmRoot.getScmRootAddress() );                    
+                    break;
+                }
+            }
+
+            if( project.isCheckedOutInSingleDirectory() )
+            {
+                List<Project> projectsInGroup =
+                    projectGroupDao.getProjectGroupWithProjects( projectGroup.getId() ).getProjects(); 
+                List<Project> projectsWithCommonScmRoot = new ArrayList<Project>();            
+                for( Project projectInGroup : projectsInGroup )
+                {
+                    if( projectInGroup.getScmUrl().startsWith( projectScmRootAddress ) )
+                    {
+                        projectsWithCommonScmRoot.add( projectInGroup );
+                    }
+                }
+                actionContext.put( AbstractContinuumAction.KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT, projectsWithCommonScmRoot );
+            }
 
             // CONTINUUM-1871 olamy if continuum is killed during building oldBuildResult will have a endTime 0
             // this means all changes since the project has been loaded in continuum will be in memory
@@ -362,7 +402,7 @@ public class DefaultBuildController
             throw new TaskExecutionException( "Error initializing the build context", e );
         }
 
-        Map<String, Object> actionContext = context.getActionContext();
+       // Map<String, Object> actionContext = context.getActionContext();
 
         AbstractContinuumAction.setProjectId( actionContext, projectId );
 
@@ -518,6 +558,13 @@ public class DefaultBuildController
             try
             {
                 ContinuumBuildExecutor executor = buildExecutorManager.getBuildExecutor( project.getExecutorId() );
+                
+                Map<String, Object> actionContext = context.getActionContext();
+                List<Project> projectsWithCommonScmRoot =
+                    AbstractContinuumAction.getListOfProjectsInGroupWithCommonScmRoot( actionContext );
+                String projectScmRootUrl =
+                    AbstractContinuumAction.getString( actionContext, AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL,
+                                                       project.getScmUrl() );
 
                 if ( executor == null )
                 {
@@ -526,9 +573,11 @@ public class DefaultBuildController
                 }
                 else if ( context.getScmResult() != null )
                 {
-                    shouldBuild = executor.shouldBuild( context.getScmResult().getChanges(), project,
-                                                        workingDirectoryService.getWorkingDirectory( project ),
-                                                        context.getBuildDefinition() );
+                    shouldBuild = 
+	                        executor.shouldBuild( context.getScmResult().getChanges(), project,
+	                                              workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
+	                                                                                           projectsWithCommonScmRoot ),
+	                                              context.getBuildDefinition() );
                 }
             }
             catch ( Exception e )

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java Wed May 12 06:41:26 2010
@@ -21,6 +21,7 @@ package org.apache.maven.continuum.core.
 
 import java.io.File;
 import java.util.List;
+import java.util.ArrayList;
 import java.util.Map;
 
 import org.apache.continuum.model.project.ProjectScmRoot;
@@ -44,43 +45,86 @@ public abstract class AbstractContinuumA
     // Keys for the values that can be in the context
     // ----------------------------------------------------------------------
 
-    private static final String KEY_PROJECT_ID = "project-id";
+    // TODO: Review and fix access of constant variables used for build context!
+    
+    public static final String KEY_PROJECT_ID = "project-id";
 
-    private static final String KEY_PROJECT = "project";
+    public static final String KEY_PROJECT = "project";
 
-    private static final String KEY_PROJECTS = "projects";
+    public static final String KEY_PROJECTS = "projects";
 
-    private static final String KEY_PROJECTS_BUILD_DEFINITIONS_MAP = "projects-build-definitions";
+    public static final String KEY_PROJECTS_BUILD_DEFINITIONS_MAP = "projects-build-definitions";
 
-    private static final String KEY_BUILD_DEFINITION_TEMPLATE = "build-definition-template";
+    public static final String KEY_BUILD_DEFINITION_TEMPLATE = "build-definition-template";
 
-    private static final String KEY_BUILD_DEFINITION = "build-definition";
+    public static final String KEY_BUILD_DEFINITION = "build-definition";
 
-    private static final String KEY_BUILD_DEFINITION_ID = "build-definition-id";
+    public static final String KEY_BUILD_DEFINITION_ID = "build-definition-id";
 
-    private static final String KEY_UNVALIDATED_PROJECT = "unvalidated-project";
+    public static final String KEY_UNVALIDATED_PROJECT = "unvalidated-project";
 
-    private static final String KEY_PROJECT_GROUP_ID = "project-group-id";
+    public static final String KEY_PROJECT_GROUP_ID = "project-group-id";
 
-    private static final String KEY_UNVALIDATED_PROJECT_GROUP = "unvalidated-project-group";
+    public static final String KEY_UNVALIDATED_PROJECT_GROUP = "unvalidated-project-group";
 
-    private static final String KEY_BUILD_ID = "build-id";
+    public static final String KEY_BUILD_ID = "build-id";
 
-    private static final String KEY_WORKING_DIRECTORY = "working-directory";
+    public static final String KEY_WORKING_DIRECTORY = "working-directory";
 
-    private static final String KEY_UPDATE_DEPENDENCIES = "update-dependencies";
+    public static final String KEY_WORKING_DIRECTORY_EXISTS = "working-directory-exists";
+    
+    public static final String KEY_CHECKOUT_SCM_RESULT = "checkout-result";
+    
+    public static final String KEY_UPDATE_SCM_RESULT = "update-result";
+    
+    public static final String KEY_UPDATE_DEPENDENCIES = "update-dependencies";
 
-    private static final String KEY_BUILD_TRIGGER = "buildTrigger";
+    public static final String KEY_BUILD_TRIGGER = "buildTrigger"; 
+    
+    public static final String KEY_FIRST_RUN = "first-run";
 
-    private static final String KEY_SCM_RESULT = "scmResult";
+    //public static final String KEY_OLD_BUILD_ID = "old-buildResult-id";
 
-    private static final String KEY_OLD_SCM_RESULT = "old-scmResult";
+    //public static final String KEY_SCM_RESULT_MAP = "scm-result-map";
+    
+    public static final String KEY_PROJECT_RELATIVE_PATH = "project-relative-path";
+    
+    public static final String KEY_SCM_USE_CREDENTIALS_CACHE = "useCredentialsCache";
+    
+	public static final String KEY_SCM_USERNAME = "scmUserName";
+	
+	public static final String KEY_SCM_PASSWORD = "scmUserPassword";
+	
+	public static final String KEY_SCM_RESULT = "scmResult";
+	
+	public static final String KEY_OLD_SCM_RESULT = "old-scmResult";
+	
+	public static final String KEY_PROJECT_SCM_ROOT = "projectScmRoot";
+	
+    /**
+     * SCM root url. Used in these actions add-project-to-checkout-queue, checkout-project, clean-working-directory,
+     *      create-projects-from-metadata, update-project-from-working-directory, 
+     *      update-working-directory-from-scm
+    */
+    public static final String KEY_PROJECT_SCM_ROOT_URL = "projectScmRootUrl";
 
-    private static final String KEY_PROJECT_SCM_ROOT = "projectScmRoot";
+    /**
+     * List of projects in a project group with a common scm root url.
+    */
+    public static final String KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT = "projects-in-group-with-common-scm-root";
 
-    private static final String KEY_OLD_BUILD_ID = "old-buildResult-id";
+    public static final String KEY_OLD_BUILD_ID = "old-buildResult-id";
 
-    private static final String KEY_SCM_RESULT_MAP = "scm-result-map";
+    public static final String KEY_CANCELLED = "cancelled";
+
+    /**
+     * Metadata url for adding projects.
+    */
+    public static final String KEY_URL = "url";
+
+    public static final String KEY_SCM_RESULT_MAP = "scm-result-map";
+
+    public static final String KEY_ROOT_DIRECTORY = "root-directory";
 
     // ----------------------------------------------------------------------
     //
@@ -282,6 +326,11 @@ public abstract class AbstractContinuumA
     {
         context.put( KEY_PROJECTS, projects );
     }
+    
+    public static List<Project> getListOfProjectsInGroupWithCommonScmRoot( Map<String, Object> context )
+    {
+        return (List<Project>) getObject( context, KEY_PROJECTS_IN_GROUP_WITH_COMMON_SCM_ROOT, new ArrayList<Integer>() );
+    }
 
     public static Map<Integer, BuildDefinition> getProjectsBuildDefinitionsMap( Map<String, Object> context )
     {
@@ -303,17 +352,27 @@ public abstract class AbstractContinuumA
     {
         context.put( KEY_SCM_RESULT_MAP, scmResultMap );
     }
+    
+    public static boolean isRootDirectory( Map<String, Object> context )
+    {
+        return getBoolean( context, KEY_ROOT_DIRECTORY, true );
+    }
+
+    public static void setRootDirectory( Map<String, Object> context, boolean isRootDirectory )
+    {
+        context.put( KEY_ROOT_DIRECTORY, isRootDirectory );
+    }
 
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
 
-    protected static String getString( Map<String, Object> context, String key )
+    public static String getString( Map<String, Object> context, String key )
     {
         return (String) getObject( context, key );
     }
 
-    protected static String getString( Map<String, Object> context, String key, String defaultValue )
+    public static String getString( Map<String, Object> context, String key, String defaultValue )
     {
         return (String) getObject( context, key, defaultValue );
     }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java Wed May 12 06:41:26 2010
@@ -75,9 +75,12 @@ public class AddProjectToCheckOutQueueAc
             scmPassword = CheckoutProjectContinuumAction.getScmPassword( context, null );
         }
         
+        String scmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, null );
+        
         BuildDefinition defaultBuildDefinition = getBuildDefinition( context );
         parallelBuildsManager.checkoutProject( project.getId(), project.getName(),
                                                workingDirectoryService.getWorkingDirectory( project ),
-                                               scmUsername, scmPassword, defaultBuildDefinition );
+                                               scmRootUrl, scmUsername, scmPassword, defaultBuildDefinition,
+                                               getListOfProjectsInGroupWithCommonScmRoot( context ) );
     }
 }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java Wed May 12 06:41:26 2010
@@ -20,6 +20,7 @@ package org.apache.maven.continuum.core.
  */
 
 import java.io.File;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.continuum.dao.ProjectDao;
@@ -52,8 +53,12 @@ public class CheckWorkingDirectoryAction
         throws Exception
     {
         Project project = projectDao.getProject( getProjectId( context ) );
-
-        File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+        List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
+        String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
+       
+        File workingDirectory =
+            workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
+                                                         projectsWithCommonScmRoot );
 
         if ( !workingDirectory.exists() )
         {

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java Wed May 12 06:41:26 2010
@@ -103,13 +103,17 @@ public class CheckoutProjectContinuumAct
 
         ScmResult result;
 
+        List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
+        
         try
         {
             String scmUserName = getScmUsername( context, project.getScmUsername() );
             String scmPassword = getScmPassword( context, project.getScmPassword() );
+            String scmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
+            
             ContinuumScmConfiguration config =
-                createScmConfiguration( project, workingDirectory, scmUserName, scmPassword );
-
+            	createScmConfiguration( project, workingDirectory, scmUserName, scmPassword, scmRootUrl, isRootDirectory( context ) );
+                
             String tag = config.getTag();
             getLogger().info(
                 "Checking out project: '" + project.getName() + "', id: '" + project.getId() + "' " + "to '" +
@@ -205,6 +209,19 @@ public class CheckoutProjectContinuumAct
 
             projectDao.updateProject( project );
 
+            // update state of sub-projects 
+            // if multi-module project was checked out in a single directory, these must not be null            
+            for( Project projectWithCommonScmRoot : projectsWithCommonScmRoot )
+            {
+                projectWithCommonScmRoot = projectDao.getProject( projectWithCommonScmRoot.getId() );
+                if( projectWithCommonScmRoot != null && projectWithCommonScmRoot.getId() != project.getId() &&
+                                projectWithCommonScmRoot.getState() == ContinuumProjectState.NEW )
+                {
+                    projectWithCommonScmRoot.setState( ContinuumProjectState.CHECKEDOUT );
+                   projectDao.updateProject( projectWithCommonScmRoot );                    
+                }
+            }
+            
             notifier.checkoutComplete( project, buildDefinition );
         }
 
@@ -213,10 +230,19 @@ public class CheckoutProjectContinuumAct
     }
 
     private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory,
-                                                              String scmUserName, String scmPassword )
+    													String scmUserName, String scmPassword, String scmRootUrl,
+    		                                                              boolean isRootDirectory )
     {
         ContinuumScmConfiguration config = new ContinuumScmConfiguration();
-        config.setUrl( project.getScmUrl() );
+        
+        if( project.isCheckedOutInSingleDirectory() && scmRootUrl!= null && !"".equals( scmRootUrl ) && isRootDirectory )
+        {
+            config.setUrl( scmRootUrl );
+        }
+        else
+        {
+            config.setUrl( project.getScmUrl() );
+        }
         config.setUsername( scmUserName );
         config.setPassword( scmPassword );
         config.setUseCredentialsCache( project.isScmUseCache() );

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java (original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java Wed May 12 06:41:26 2010
@@ -26,6 +26,7 @@ import org.apache.maven.shared.model.fil
 import org.apache.maven.shared.model.fileset.util.FileSetManager;
 
 import java.io.File;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -51,8 +52,12 @@ public class CleanWorkingDirectoryAction
         throws Exception
     {
         Project project = projectDao.getProject( getProjectId( context ) );
+        List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );        
+        String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
 
-        File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+        File workingDirectory =
+        	            workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
+        	                                                         projectsWithCommonScmRoot );
 
         if ( workingDirectory.exists() )
         {



Mime
View raw message