continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r769671 [1/2] - in /continuum/branches/continuum-flat-multi-module: 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/maven/cont...
Date Wed, 29 Apr 2009 06:08:22 GMT
Author: oching
Date: Wed Apr 29 06:08:15 2009
New Revision: 769671

URL: http://svn.apache.org/viewvc?rev=769671&view=rev
Log:
[CONTINUUM-2193]
o allow checkout of multi-module projects into a single directory
o added and updated tests of affected classes

Added:
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/.cvsignore
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/pom.xml
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/apache/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/apache/continuum/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/apache/continuum/module/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/apache/continuum/module/a/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/apache/continuum/module/a/App.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/apache/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/apache/continuum/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/apache/continuum/module/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/apache/continuum/module/a/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/apache/continuum/module/a/AppTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/pom.xml
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/apache/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/apache/continuum/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/apache/continuum/module/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/apache/continuum/module/b/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/apache/continuum/module/b/App.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/apache/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/apache/continuum/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/apache/continuum/module/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/apache/continuum/module/b/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/apache/continuum/module/b/AppTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/parent-project/
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/parent-project/pom.xml
Modified:
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilderTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
    continuum/branches/continuum-flat-multi-module/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
    continuum/branches/continuum-flat-multi-module/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/branches/continuum-flat-multi-module/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp

Modified: continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java Wed Apr 29 06:08:15 2009
@@ -87,13 +87,14 @@
      * @param projectId
      * @param projectName
      * @param workingDirectory
+     * @param scmRootUrl TODO
      * @param scmUsername
      * @param scmPassword
      * @param defaultBuildDefinition
      * @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 )
         throws BuildManagerException;
 
     /**

Modified: continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java Wed Apr 29 06:08:15 2009
@@ -39,9 +39,11 @@
     private final String scmUserName;
 
     private final String scmPassword;
+    
+    private final String scmRootUrl;
 
     public CheckOutTask( int projectId, File workingDirectory, String projectName, String scmUserName,
-                         String scmPassword )
+                         String scmPassword, String scmRootUrl )
     {
         this.projectId = projectId;
 
@@ -52,6 +54,8 @@
         this.scmUserName = scmUserName;
 
         this.scmPassword = scmPassword;
+        
+        this.scmRootUrl = scmRootUrl;
     }
 
     public int getProjectId()
@@ -90,4 +94,9 @@
     {
         return this.hashCode();
     }
+
+    public String getScmRootUrl()
+    {
+        return scmRootUrl;
+    }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Wed Apr 29 06:08:15 2009
@@ -337,13 +337,14 @@
      * @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 checkoutInSingleDirector if multi module project, check out the entire project in a single directory (handle flat multi-modules)
      * @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/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/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java Wed Apr 29 06:08:15 2009
@@ -35,12 +35,12 @@
         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/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/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java Wed Apr 29 06:08:15 2009
@@ -90,7 +90,11 @@
     private final Map<String, String> errors = new HashMap<String, String>();
 
     private static final String LS = System.getProperty( "line.separator" );
-
+    
+    private String modulePath;
+    
+    private Project rootProject;
+    
     public void addProject( Project project )
     {
         projects.add( project );
@@ -220,4 +224,24 @@
         }
         return message.toString();
     }
+
+    public String getModulePath()
+    {
+        return modulePath;
+    }
+
+    public void setModulePath( String modulePath )
+    {
+        this.modulePath = modulePath;
+    }
+
+    public Project getRootProject()
+    {
+        return rootProject;
+    }
+
+    public void setRootProject( Project rootProject )
+    {
+        this.rootProject = rootProject;
+    }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java Wed Apr 29 06:08:15 2009
@@ -367,10 +367,10 @@
     }
 
     /**
-     * @see BuildsManager#checkoutProject(int, String, File, String, String, BuildDefinition)
+     * @see BuildsManager#checkoutProject(int, String, File, String, String, String, BuildDefinition)
      */
-    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 )
         throws BuildManagerException
     {
         try
@@ -390,7 +390,7 @@
         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 );
         try
         {
             if ( overallBuildQueue != null )
@@ -873,7 +873,7 @@
             {
                 BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition( task.getProjectId() );
                 checkoutProject( task.getProjectId(), task.getProjectName(), task.getWorkingDirectory(),
-                                 task.getScmUserName(), task.getScmPassword(), buildDefinition );
+                                 null, task.getScmUserName(), task.getScmPassword(), buildDefinition );
             }
             catch ( ContinuumStoreException e )
             {

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Wed Apr 29 06:08:15 2009
@@ -1221,7 +1221,7 @@
     {
         return executeAddProjectsFromMetadataActivity( metadataUrl, MavenOneContinuumProjectBuilder.ID, projectGroupId,
                                                        checkProtocol, useCredentialsCache, true,
-                                                       buildDefinitionTemplateId );
+                                                       buildDefinitionTemplateId, false );
     }
 
     // ----------------------------------------------------------------------
@@ -1270,7 +1270,7 @@
         {
             return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
                                                            projectGroupId, checkProtocol, useCredentialsCache, true,
-                                                           buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId() );
+                                                           buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId(), false );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -1288,7 +1288,7 @@
             return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
                                                            projectGroupId, checkProtocol, useCredentialsCache,
                                                            recursiveProjects,
-                                                           buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId() );
+                                                           buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getId(), false );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -1298,12 +1298,12 @@
 
     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 );
     }
 
     // ----------------------------------------------------------------------
@@ -1417,7 +1417,7 @@
         throws ContinuumException
     {
         return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, projectGroupId, checkProtocol,
-                                                       false, false, buildDefinitionTemplateId );
+                                                       false, false, buildDefinitionTemplateId, false );
     }
 
 
@@ -1428,7 +1428,7 @@
                                                                                      boolean useCredentialsCache,
                                                                                      boolean loadRecursiveProjects,
                                                                                      int buildDefinitionTemplateId,
-                                                                                     boolean addAssignableRoles )
+                                                                                     boolean addAssignableRoles, boolean checkoutInSingleDirectory )
         throws ContinuumException
     {
         if ( checkProtocol )
@@ -1445,13 +1445,15 @@
 
         context.put( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, projectBuilderId );
 
-        context.put( CreateProjectsFromMetadataAction.KEY_URL, metadataUrl );
+        context.put( AbstractContinuumAction.KEY_URL, metadataUrl );
 
         context.put( CreateProjectsFromMetadataAction.KEY_LOAD_RECURSIVE_PROJECTS, loadRecursiveProjects );
 
-        context.put( CreateProjectsFromMetadataAction.KEY_SCM_USE_CREDENTIALS_CACHE, useCredentialsCache );
+        context.put( AbstractContinuumAction.KEY_SCM_USE_CREDENTIALS_CACHE, useCredentialsCache );
 
         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 )
@@ -1550,10 +1552,10 @@
 
             projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
 
-            String url = (String) context.get( CreateProjectsFromMetadataAction.KEY_URL );
+            String url = (String) context.get( AbstractContinuumAction.KEY_URL );
 
             projectScmRoot = getProjectScmRootByProjectGroupAndScmRootAddress( projectGroup.getId(), url );
-
+            
             if ( projectScmRoot == null )
             {
                 createProjectScmRoot( projectGroup, url );
@@ -1581,7 +1583,7 @@
         for ( Project project : projects )
         {
             project.setScmUseCache( useCredentialsCache );
-
+            
             // values backup for first checkout
             scmUserName = project.getScmUsername();
             scmPassword = project.getScmPassword();
@@ -1598,64 +1600,32 @@
         try
         {
             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() ) );
-                }
-
-                context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
-                //
-                //            executeAction( "validate-project", context );
-                //
-                //            executeAction( "store-project", context );
-                //
-                context.put( AbstractContinuumAction.KEY_PROJECT_ID, project.getId() );
-
-                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;
-                if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
-                {
-                    defaultBuildDefinition =
-                        (BuildDefinition) buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getBuildDefinitions().get(
-                            0 );
-                }
-                else if ( projectBuilderId.equals( MavenOneContinuumProjectBuilder.ID ) )
+                for ( Project project : projects )
                 {
-                    defaultBuildDefinition =
-                        (BuildDefinition) buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate().getBuildDefinitions().get(
-                            0 );
+                    context = new HashMap<String, Object>();
+                    
+                    addProjectToCheckoutQueue( projectBuilderId, buildDefinitionTemplateId, context,
+                                               projectGroupCreation, scmUserName, scmPassword, project );    
                 }
-
-                // 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 );
+            }
+            else
+            {   
+                Project project = result.getRootProject();                
+             
+                if( project != null )
+                {
+                    String scmRootUrl = AbstractContinuumAction.getString( context, AbstractContinuumAction.KEY_URL );
+                    
+                    context = new HashMap<String, Object>();
+                    
+                    context.put( AbstractContinuumAction.KEY_URL, scmRootUrl );
+                    
+                    addProjectToCheckoutQueue( projectBuilderId, buildDefinitionTemplateId, context, projectGroupCreation,
+                                               scmUserName, scmPassword, project );    
                 }
-
             }
         }
         catch ( BuildDefinitionServiceException e )
@@ -1676,18 +1646,78 @@
         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;
+        if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
+        {
+            defaultBuildDefinition =
+                (BuildDefinition) buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getBuildDefinitions().get(
+                    0 );
+        }
+        else if ( projectBuilderId.equals( MavenOneContinuumProjectBuilder.ID ) )
+        {
+            defaultBuildDefinition =
+                (BuildDefinition) buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate().getBuildDefinitions().get(
+                    0 );
+        }
+
+        // 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 );
+        }
+    }
+
     protected ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
                                                                                      String projectBuilderId,
                                                                                      int projectGroupId,
                                                                                      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 );
     }
 
     // ----------------------------------------------------------------------
@@ -3083,7 +3113,7 @@
         ProjectGroup group = getProjectGroupByProjectId( projectId );
 
         List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( group.getId() );
-
+        
         for ( ProjectScmRoot scmRoot : scmRoots )
         {
             if ( project.getScmUrl() != null && project.getScmUrl().startsWith( scmRoot.getScmRootAddress() ) )
@@ -3363,9 +3393,9 @@
 
     private void prepareBuildProjects( Map<ProjectScmRoot, Map<Integer, Integer>> map, int trigger )
         throws ContinuumException
-    {
+    {        
         for ( ProjectScmRoot scmRoot : map.keySet() )
-        {
+        {   
             prepareBuildProjects( map.get( scmRoot ), trigger, scmRoot.getScmRootAddress(),
                                   scmRoot.getProjectGroup().getId(), scmRoot.getId() );
         }
@@ -3377,6 +3407,10 @@
     {
         ProjectGroup group = getProjectGroup( projectGroupId );
 
+        // TODO: [deng] there should be a check somewhere that if the project was checked out in a 
+        //   single directory, then only the root project should be added in the projectsBuildDefinitionsMap!
+        //   --> only the root url will be updated!
+        
         try
         {
             if ( configurationService.isDistributedBuildEnabled() )
@@ -3449,7 +3483,7 @@
             projectScmRoot.setProjectGroup( projectGroup );
 
             projectScmRoot.setScmRootAddress( url );
-
+             
             return projectScmRootDao.addProjectScmRoot( projectScmRoot );
         }
         catch ( ContinuumStoreException e )

Modified: continuum/branches/continuum-flat-multi-module/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/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java Wed Apr 29 06:08:15 2009
@@ -98,6 +98,8 @@
     public static final String KEY_CANCELLED = "cancelled";
 
     public static final String KEY_SCM_RESULT_MAP = "scm-result-map";
+    
+    public static final String KEY_URL = "url";
 
     // ----------------------------------------------------------------------
     //
@@ -228,17 +230,17 @@
     {
         return (Map<Integer, ScmResult>) getObject( context, KEY_SCM_RESULT_MAP );
     }
-
+    
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
 
-    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/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/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java Wed Apr 29 06:08:15 2009
@@ -61,10 +61,12 @@
             project = projectDao.getProject( getProjectId( context ) );
         }
 
+        String scmRootUrl = getString( context, KEY_URL, null );
+        
         BuildDefinition defaultBuildDefinition = getBuildDefinition( context );
         parallelBuildsManager.checkoutProject( project.getId(), project.getName(),
                                                workingDirectoryService.getWorkingDirectory( project ),
-                                               project.getScmUsername(), project.getScmPassword(),
-                                               defaultBuildDefinition );
+                                               scmRootUrl, project.getScmUsername(),
+                                               project.getScmPassword(), defaultBuildDefinition );
     }
 }

Modified: continuum/branches/continuum-flat-multi-module/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/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java Wed Apr 29 06:08:15 2009
@@ -97,8 +97,10 @@
         {
             String scmUserName = getString( context, KEY_SCM_USERNAME, project.getScmUsername() );
             String scmPassword = getString( context, KEY_SCM_PASSWORD, project.getScmPassword() );
+            String scmRootUrl = getString( context, KEY_URL, project.getScmUrl() );
+            
             ContinuumScmConfiguration config =
-                createScmConfiguration( project, workingDirectory, scmUserName, scmPassword );
+                createScmConfiguration( project, workingDirectory, scmUserName, scmPassword, scmRootUrl );
 
             String tag = config.getTag();
             getLogger().info(
@@ -197,10 +199,10 @@
     }
 
     private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory,
-                                                              String scmUserName, String scmPassword )
+                                                              String scmUserName, String scmPassword, String scmRootUrl )
     {
         ContinuumScmConfiguration config = new ContinuumScmConfiguration();
-        config.setUrl( project.getScmUrl() );
+        config.setUrl( scmRootUrl );
         config.setUsername( scmUserName );
         config.setPassword( scmPassword );
         config.setUseCredentialsCache( project.isScmUseCache() );

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java Wed Apr 29 06:08:15 2009
@@ -76,13 +76,13 @@
      */
     private ContinuumUrlValidator urlValidator;    
 
-    public static final String KEY_URL = "url";
-
     public static final String KEY_PROJECT_BUILDER_ID = "builderId";
 
     public static final String KEY_PROJECT_BUILDING_RESULT = "projectBuildingResult";
 
     public static final String KEY_LOAD_RECURSIVE_PROJECTS = "loadRecursiveProjects";
+    
+    public static final String KEY_CHECKOUT_PROJECTS_IN_SINGLE_DIRECTORY = "checkoutProjectsInSingleDirectory";
 
     public void execute( Map context )
         throws ContinuumException, ContinuumProjectBuilderManagerException, ContinuumProjectBuilderException
@@ -90,6 +90,8 @@
         String projectBuilderId = getString( context, KEY_PROJECT_BUILDER_ID );
 
         boolean loadRecursiveProjects = getBoolean( context, KEY_LOAD_RECURSIVE_PROJECTS );
+        
+        boolean checkoutProjectsInSingleDirectory = getBoolean( context, KEY_CHECKOUT_PROJECTS_IN_SINGLE_DIRECTORY );
 
         String curl = getString( context, KEY_URL );
 
@@ -111,7 +113,7 @@
                 url = new URL( curl );
 
                 result = projectBuilder.buildProjectsFromMetadata( url, null, null, loadRecursiveProjects,
-                                                                   buildDefinitionTemplate );
+                                                                   buildDefinitionTemplate, checkoutProjectsInSingleDirectory );
 
             }
             else
@@ -150,7 +152,7 @@
                 {
 
                     result = projectBuilder.buildProjectsFromMetadata( url, username, password, loadRecursiveProjects,
-                                                                       buildDefinitionTemplate );
+                                                                       buildDefinitionTemplate, checkoutProjectsInSingleDirectory );
 
                 }
                 else
@@ -164,7 +166,7 @@
             if ( result.getProjects() != null )
             {
                 String scmRootUrl = getScmRootUrl( result.getProjects() );
-         
+                
                 if ( scmRootUrl == null || scmRootUrl.equals( "" ) )
                 {
                     if ( curl.indexOf( "pom.xml" ) > 0 )

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java Wed Apr 29 06:08:15 2009
@@ -67,17 +67,17 @@
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password )
         throws ContinuumProjectBuilderException
     {
-        return buildProjectsFromMetadata( url, username, password, true );
+        return buildProjectsFromMetadata( url, username, password, true, false );
     }
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
-                                                                     boolean recursiveProjects )
+                                                                     boolean recursiveProjects, boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException
     {
         try
         {
             return buildProjectsFromMetadata( url, username, password, recursiveProjects,
-                                              buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate() );
+                                              buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate(), checkoutInSingleDirectory );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -87,7 +87,7 @@
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
                                                                      boolean recursiveProjects,
-                                                                     BuildDefinitionTemplate buildDefinitionTemplate )
+                                                                     BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException
     {
         ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult();

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java Wed Apr 29 06:08:15 2009
@@ -83,6 +83,8 @@
      * @plexus.configuration
      */
     private List<String> excludedPackagingTypes = new ArrayList<String>();
+    
+    private Project rootProject;
 
     // ----------------------------------------------------------------------
     // AbstractContinuumProjectBuilder Implementation
@@ -90,17 +92,17 @@
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password )
         throws ContinuumProjectBuilderException
     {
-        return buildProjectsFromMetadata( url, username, password, true );
+        return buildProjectsFromMetadata( url, username, password, true, false );
     }
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
-                                                                     boolean loadRecursiveProjects )
+                                                                     boolean loadRecursiveProjects, boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException
     {
         try
         {
             return buildProjectsFromMetadata( url, username, password, loadRecursiveProjects,
-                                              buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate() );
+                                              buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate(), checkoutInSingleDirectory );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -110,7 +112,7 @@
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password,
                                                                      boolean loadRecursiveProjects,
-                                                                     BuildDefinitionTemplate buildDefinitionTemplate )
+                                                                     BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException
     {
         // ----------------------------------------------------------------------
@@ -121,7 +123,7 @@
 
         try
         {
-            readModules( url, result, true, username, password, null, loadRecursiveProjects, buildDefinitionTemplate );
+            readModules( url, result, true, username, password, null, loadRecursiveProjects, buildDefinitionTemplate, checkoutInSingleDirectory );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -136,7 +138,7 @@
 
     private void readModules( URL url, ContinuumProjectBuildingResult result, boolean groupPom, String username,
                               String password, String scmUrl, boolean loadRecursiveProjects,
-                              BuildDefinitionTemplate buildDefinitionTemplate )
+                              BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory )
         throws ContinuumProjectBuilderException, BuildDefinitionServiceException
     {
 
@@ -154,7 +156,20 @@
             }
 
             mavenProject = builderHelper.getMavenProject( result, pomFile );
-
+                        
+            if( !mavenProject.getModules().isEmpty() && checkoutInSingleDirectory )
+            {   
+                String module = ( String ) mavenProject.getModules().get( 0 );
+                StringUtils.replace( module, '/', '\\' );
+                
+                // confirm project is a flat multi-module project!
+                if( module.indexOf( '\\' ) != 0 )
+                {
+                    String modulePath = StringUtils.substring( module, module.lastIndexOf( '\\' ) + 1 );
+                    result.setModulePath( modulePath );
+                }
+            }
+            
             if ( result.hasErrors() )
             {
                 return;
@@ -264,6 +279,12 @@
                 continuumProject.setScmTag( mavenProject.getScm().getTag() );
             }
             result.addProject( continuumProject, MavenTwoBuildExecutor.ID );
+            
+            if( checkoutInSingleDirectory && rootProject == null )
+            {
+                rootProject = continuumProject;
+                result.setRootProject( rootProject );
+            }
         }
 
         List<String> modules = mavenProject.getModules();
@@ -289,13 +310,13 @@
 
         prefix = prefix.substring( 0, lastSlash );
         if ( loadRecursiveProjects )
-        {
+        {   
             for ( String module : modules )
             {
                 if ( StringUtils.isNotEmpty( module ) )
-                {
+                {   
                     String urlString = prefix + "/" + module + POM_PART + suffix;
-
+                 
                     URL moduleUrl;
 
                     try
@@ -309,18 +330,46 @@
                         continue;
                     }
 
-                    String moduleScmUrl;
-                    if ( scmUrl.endsWith( "/" ) )
-                    {
-                        moduleScmUrl = scmUrl + module;
+                    String moduleScmUrl = "";                    
+                 
+                    String modulePath = StringUtils.replace( new String( module ), '\\', '/' );
+                    
+                    // check if module is relative
+                    if( modulePath.indexOf( "/" ) != -1 )
+                    {   
+                        int depth =
+                            StringUtils.countMatches( StringUtils.substring( modulePath, 0,
+                                                                             modulePath.lastIndexOf( '/' ) + 1 ), "/" );
+                        
+                        String baseUrl = "";
+                        for( int j = 1; j <= depth; j++ )
+                        {
+                            if( scmUrl.endsWith( "/" ) )
+                            {
+                                String trimmedScmUrl = StringUtils.chompLast( new String( scmUrl ), "/" );
+                                baseUrl = StringUtils.substring( trimmedScmUrl, 0, trimmedScmUrl.lastIndexOf( '/' ) );
+                            }
+                            else
+                            {
+                                baseUrl = StringUtils.substring( scmUrl, 0, scmUrl.lastIndexOf( '/' ) );
+                            }
+                        }
+                        moduleScmUrl = baseUrl + "/" + StringUtils.substring( modulePath, modulePath.lastIndexOf( '/' ) + 1 );
                     }
                     else
                     {
-                        moduleScmUrl = scmUrl + "/" + module;
+                        if ( scmUrl.endsWith( "/" ) )
+                        {
+                            moduleScmUrl = scmUrl + module;
+                        }
+                        else
+                        {
+                            moduleScmUrl = scmUrl + "/" + module;
+                        }
                     }
                     // we are in recursive loading mode
                     readModules( moduleUrl, result, false, username, password, moduleScmUrl, true,
-                                 buildDefinitionTemplate );
+                                 buildDefinitionTemplate, checkoutInSingleDirectory );
                 }
             }
         }

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java Wed Apr 29 06:08:15 2009
@@ -93,8 +93,8 @@
 
         context.put( AbstractContinuumAction.KEY_SCM_USERNAME, task.getScmUserName() );
 
-        context.put( AbstractContinuumAction.KEY_SCM_PASSWORD, task.getScmPassword() );
-
+        context.put( AbstractContinuumAction.KEY_URL, task.getScmRootUrl() );
+        
         try
         {
             actionManager.lookup( "checkout-project" ).execute( context );

Added: continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/.cvsignore
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/.cvsignore?rev=769671&view=auto
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/.cvsignore (added)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/.cvsignore Wed Apr 29 06:08:15 2009
@@ -0,0 +1,8 @@
+target
+*~
+*.log
+.classpath
+.project
+*.ipr
+*.iws
+*.iml

Added: continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/pom.xml?rev=769671&view=auto
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/pom.xml (added)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/pom.xml Wed Apr 29 06:08:15 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0"?><project>
+  <parent>
+    <artifactId>parent-project</artifactId>
+    <groupId>org.apache.continuum</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.continuum</groupId>
+  <artifactId>module-a</artifactId>
+  <name>module-a</name>
+  <version>1.0-SNAPSHOT</version>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Added: continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/apache/continuum/module/a/App.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/apache/continuum/module/a/App.java?rev=769671&view=auto
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/apache/continuum/module/a/App.java (added)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/main/java/org/apache/continuum/module/a/App.java Wed Apr 29 06:08:15 2009
@@ -0,0 +1,13 @@
+package org.apache.continuum.module.a;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Added: continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/apache/continuum/module/a/AppTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/apache/continuum/module/a/AppTest.java?rev=769671&view=auto
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/apache/continuum/module/a/AppTest.java (added)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-a/src/test/java/org/apache/continuum/module/a/AppTest.java Wed Apr 29 06:08:15 2009
@@ -0,0 +1,38 @@
+package org.apache.continuum.module.a;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertTrue( true );
+    }
+}

Added: continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/pom.xml?rev=769671&view=auto
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/pom.xml (added)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/pom.xml Wed Apr 29 06:08:15 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0"?><project>
+  <parent>
+    <artifactId>parent-project</artifactId>
+    <groupId>org.apache.continuum</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.continuum</groupId>
+  <artifactId>module-b</artifactId>
+  <name>module-b</name>
+  <version>1.0-SNAPSHOT</version>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Added: continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/apache/continuum/module/b/App.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/apache/continuum/module/b/App.java?rev=769671&view=auto
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/apache/continuum/module/b/App.java (added)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/main/java/org/apache/continuum/module/b/App.java Wed Apr 29 06:08:15 2009
@@ -0,0 +1,13 @@
+package org.apache.continuum.module.b;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Added: continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/apache/continuum/module/b/AppTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/apache/continuum/module/b/AppTest.java?rev=769671&view=auto
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/apache/continuum/module/b/AppTest.java (added)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/module-b/src/test/java/org/apache/continuum/module/b/AppTest.java Wed Apr 29 06:08:15 2009
@@ -0,0 +1,38 @@
+package org.apache.continuum.module.b;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertTrue( true );
+    }
+}

Added: continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/parent-project/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/parent-project/pom.xml?rev=769671&view=auto
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/parent-project/pom.xml (added)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test-projects/flat-multi-module/parent-project/pom.xml Wed Apr 29 06:08:15 2009
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.continuum</groupId>
+  <artifactId>parent-project</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>parent-project</name>
+  <url>http://maven.apache.org</url>
+  <scm>
+    <connection>scm:local:src/test-projects:flat-multi-module/parent-project</connection>
+    <url>http://cvs.plexus.codehaus.org/plexus-components/native/continuum/src/test-projects/flat-multi-module/parent-project</url>
+  </scm>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <modules>
+    <module>../module-a</module>
+    <module>../module-b</module>
+  </modules>
+</project>

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java Wed Apr 29 06:08:15 2009
@@ -391,8 +391,8 @@
         recordCheckoutProjectBuildQueuesAreEmpty();
 
         buildsManager.checkoutProject( 1, "continuum-project-test-1",
-                                       new File( getBasedir(), "/target/test-working-dir/1" ), "dummy", "dummypass",
-                                       buildDef );
+                                       new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy",
+                                       "dummypass", buildDef );
         context.assertIsSatisfied();
     }
 
@@ -408,8 +408,8 @@
         recordCheckoutProjectBuildQueuesAreEmpty();
 
         buildsManager.checkoutProject( 1, "continuum-project-test-1",
-                                       new File( getBasedir(), "/target/test-working-dir/1" ), "dummy", "dummypass",
-                                       buildDef );
+                                       new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy",
+                                       "dummypass", buildDef );
         context.assertIsSatisfied();
 
         // queue second project - 1st queue has 1 task while 2nd queue is empty; project should be queued in
@@ -421,7 +421,7 @@
         final List<Task> tasksInFirstCheckoutQueue = new ArrayList<Task>();
         tasksInFirstCheckoutQueue.add(
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
-                              "dummy", "dummypass" ) );
+                              "dummy", "dummypass", null ) );
 
         context.checking( new Expectations()
         {
@@ -439,8 +439,8 @@
         recordAddToCheckoutQueue();
 
         buildsManager.checkoutProject( 2, "continuum-project-test-2",
-                                       new File( getBasedir(), "/target/test-working-dir/1" ), "dummy", "dummypass",
-                                       buildDef );
+                                       new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy",
+                                       "dummypass", buildDef );
         context.assertIsSatisfied();
 
         // queue third project - both queues have 1 task queued each; third project should be queued in 1st queue
@@ -459,8 +459,8 @@
         recordAddToCheckoutQueue();
 
         buildsManager.checkoutProject( 3, "continuum-project-test-3",
-                                       new File( getBasedir(), "/target/test-working-dir/1" ), "dummy", "dummypass",
-                                       buildDef );
+                                       new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy",
+                                       "dummypass", buildDef );
         context.assertIsSatisfied();
     }
 
@@ -563,7 +563,7 @@
         final List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
         checkoutTasks.add(
             new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-2",
-                              "dummy", "dummypass" ) );
+                              "dummy", "dummypass", null ) );
 
         final ParallelBuildsThreadedTaskQueueExecutor buildTaskQueueExecutor =
             context.mock( ParallelBuildsThreadedTaskQueueExecutor.class, "parallel-build-task-executor" );
@@ -688,7 +688,7 @@
         final List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
         checkoutTasks.add(
             new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-2",
-                              "dummy", "dummypass" ) );
+                              "dummy", "dummypass", null ) );
 
         try
         {
@@ -786,7 +786,7 @@
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add(
             new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-2",
-                              "dummy", "dummypass" ) );
+                              "dummy", "dummypass", null ) );
 
         context.checking( new Expectations()
         {

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java Wed Apr 29 06:08:15 2009
@@ -84,7 +84,7 @@
     {
         final CheckOutTask checkoutTask =
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
-                              "dummy", "dummypass" );
+                              "dummy", "dummypass", null );
         final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
 
         context.checking( new Expectations()
@@ -107,7 +107,7 @@
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add(
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
-                              "dummy", "dummypass" ) );
+                              "dummy", "dummypass", null ) );
 
         context.checking( new Expectations()
         {
@@ -133,7 +133,7 @@
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add(
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
-                              "dummy", "dummypass" ) );
+                              "dummy", "dummypass", null ) );
 
         context.checking( new Expectations()
         {
@@ -154,7 +154,7 @@
     {
         final Task checkoutTask =
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
-                              "dummy", "dummypass" );
+                              "dummy", "dummypass", null );
         final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add( checkoutTask );

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java Wed Apr 29 06:08:15 2009
@@ -91,7 +91,7 @@
         ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
                                                                                    rootPom.toURI().toURL()
                                                                                        .toExternalForm(), pg.getId(),
-                                                                                   true, false, false, bdt.getId() );
+                                                                                   true, false, false, bdt.getId(), false );
         assertNotNull( result );
 
         assertEquals( 1, result.getProjects().size() );
@@ -118,7 +118,7 @@
         ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
                                                                                    rootPom.toURI().toURL()
                                                                                        .toExternalForm(), -1, true,
-                                                                                   false, true, bdt.getId() );
+                                                                                   false, true, bdt.getId(), false );
         assertNotNull( result );
 
         assertEquals( 1, result.getProjects().size() );
@@ -154,7 +154,7 @@
         ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
                                                                                    rootPom.toURI().toURL()
                                                                                        .toExternalForm(), -1, true,
-                                                                                   false, true, -1 );
+                                                                                   false, true, -1, false );
         assertNotNull( result );
 
         assertEquals( 1, result.getProjects().size() );
@@ -202,7 +202,7 @@
         ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
                                                                                    rootPom.toURI().toURL()
                                                                                        .toExternalForm(), pg.getId(),
-                                                                                   true, false, false, -1 );
+                                                                                   true, false, false, -1, false );
         assertNotNull( result );
 
         assertEquals( 1, result.getProjects().size() );

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java Wed Apr 29 06:08:15 2009
@@ -38,7 +38,7 @@
         
         ContinuumProjectBuildingResult result = continuum
             .executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
-                                                     getDefaultProjectGroup().getId(), false, true, false, -1, false );
+                                                     getDefaultProjectGroup().getId(), false, true, false, -1, false, false );
         assertEquals( 1, result.getProjects().size() );
         
         // read the project from store
@@ -56,7 +56,7 @@
 
         ContinuumProjectBuildingResult result = continuum
             .executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
-                                                     getDefaultProjectGroup().getId(), false, false, false, -1, false );
+                                                     getDefaultProjectGroup().getId(), false, false, false, -1, false, false );
         assertEquals( 1, result.getProjects().size() );
 
         // read the project from store

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=769671&r1=769670&r2=769671&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java Wed Apr 29 06:08:15 2009
@@ -95,7 +95,7 @@
         assertTrue( rootPom.exists() );
 
         ContinuumProjectBuildingResult result =
-            continuum.addMavenTwoProject( rootPom.toURI().toURL().toExternalForm(), -1, true, false, true, -1 );
+            continuum.addMavenTwoProject( rootPom.toURI().toURL().toExternalForm(), -1, true, false, true, -1, false );
 
         assertNotNull( result );
 
@@ -128,8 +128,64 @@
         assertTrue( "no irc notifier", projects.containsKey( "Continuum IRC Notifier" ) );
 
         assertTrue( "no jabber notifier", projects.containsKey( "Continuum Jabber Notifier" ) );
+    }
+    
+    // handle flat multi-module projects
+    public void testAddMavenTwoProjectSetInSingleDirectory()
+        throws Exception
+    {   
+        Continuum continuum = (Continuum) lookup( Continuum.ROLE );
+        
+        String url = getTestFile( "src/test-projects/flat-multi-module/parent-project/pom.xml" ).toURL().toExternalForm();
+
+        ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( url, -1, true, false, true, -1, true );
+
+        assertNotNull( result );
+
+        List<Project> projects = result.getProjects();
 
+        assertEquals( 3, projects.size() );        
+        
+        Map<String, Project> projectsMap = new HashMap<String, Project>();
 
+        for ( Project project : getProjectDao().getAllProjectsByName() )
+        {
+            projectsMap.put( project.getName(), project );
+
+            // validate project in project group
+            assertTrue( "project not in project group",
+                        getProjectGroupDao().getProjectGroupByProjectId( project.getId() ) != null );
+        }
+        
+        assertTrue( "no module-a", projectsMap.containsKey( "module-a" ) );
+        
+        assertTrue( "no module-b", projectsMap.containsKey( "module-b" ) );
+        
+        // check if the modules were checked out in the same directory as the parent
+        ConfigurationService configurationService = ( ConfigurationService ) lookup( "configurationService" );
+        
+        File workingDir = configurationService.getWorkingDirectory();
+        
+        Project parentProject = getProjectDao().getProjectByName( "parent-project" );
+        
+        File checkoutDir = new File( workingDir, String.valueOf( parentProject.getId() ) );
+        
+        for( long delay = 0; delay <= 999999999; delay++ )
+        {
+            // wait while the project has been checked out
+        }
+        
+        assertTrue( "checkout directory of project 'parent-project' does not exist." , checkoutDir.exists() );
+        
+        assertFalse( "module-a should not have been checked out as a separate project.",
+                    new File( workingDir, String.valueOf( getProjectDao().getProjectByName( "module-a" ).getId() ) ).exists() );
+        
+        assertFalse( "module-b should not have been checked out as a separate project.",
+                    new File( workingDir, String.valueOf( getProjectDao().getProjectByName( "module-b" ).getId() ) ).exists() );
+        
+        assertTrue( "module-a was not checked out in the same directory as it's parent.", new File( checkoutDir, "module-a" ).exists() );
+        
+        assertTrue( "module-b was not checked out in the same directory as it's parent.", new File( checkoutDir, "module-b" ).exists() );        
     }
 
     public void testUpdateMavenTwoProject()



Mime
View raw message