continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r943391 [3/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
Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java
Wed May 12 06:41:26 2010
@@ -96,11 +96,12 @@ public class PrepareBuildProjectsTaskExe
 
         List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId()
);
 
-        assertEquals( "failed to add all projects", 3, projects.size() );
+        assertEquals( "failed to add all projects", 4, projects.size() );
 
         Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
         Project moduleA = getProjectDao().getProjectByName( "module-A" );
         Project moduleB = getProjectDao().getProjectByName( "module-B" );
+        Project moduleD = getProjectDao().getProjectByName( "module-D" );
 
         // wait while task finishes prepare build
         while( !prepareBuildQueue.getQueueSnapshot().isEmpty() || 
@@ -120,6 +121,16 @@ public class PrepareBuildProjectsTaskExe
 
         assertTrue( "checkout directory of project 'module-B' does not exist.", new File(
workingDir, Integer.toString( moduleB.getId() ) ).exists() );
 
+        assertTrue( "checkout directory of project 'module-D' does not exist.", new File(
workingDir, Integer.toString( moduleD.getId() ) ).exists() );
+ 
+        assertTrue( "failed to checkout project 'multi-module-parent'", new File( workingDir,
Integer.toString( rootProject.getId() ) ).list().length > 0 );
+
+        assertTrue( "failed to checkout project 'module-A'", new File( workingDir, Integer.toString(
moduleA.getId() ) ).list().length > 0 );
+
+        assertTrue( "failed to checkout project 'module-B'", new File( workingDir, Integer.toString(
moduleB.getId() ) ).list().length > 0 );
+
+        assertTrue( "failed to checkout project 'module-D'", new File( workingDir, Integer.toString(
moduleD.getId() ) ).list().length > 0 );
+
         while( !buildsManager.getCurrentBuilds().isEmpty() ||
                         isAnyProjectInBuildQueue() )
         {
@@ -136,11 +147,12 @@ public class PrepareBuildProjectsTaskExe
 
         List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId()
);
 
-        assertEquals( "failed to add all projects", 3, projects.size() );
+        assertEquals( "failed to add all projects", 4, projects.size() );
 
         Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
         Project moduleA = getProjectDao().getProjectByName( "module-A" );
         Project moduleB = getProjectDao().getProjectByName( "module-B" );
+        Project moduleD = getProjectDao().getProjectByName( "module-D" );
 
         // wait while task finishes prepare build
         while( !prepareBuildQueue.getQueueSnapshot().isEmpty() || 
@@ -159,14 +171,24 @@ public class PrepareBuildProjectsTaskExe
         assertTrue( "checkout directory of project 'module-A' does not exist.", new File(
workingDir, Integer.toString( moduleA.getId() ) ).exists() );
 
         assertTrue( "checkout directory of project 'module-B' does not exist.", new File(
workingDir, Integer.toString( moduleB.getId() ) ).exists() );
+        
+        assertTrue( "checkout directory of project 'module-D' does not exist.", new File(
workingDir, Integer.toString( moduleD.getId() ) ).exists() );
+ 
+        assertTrue( "failed to checkout project 'multi-module-parent'", new File( workingDir,
Integer.toString( rootProject.getId() ) ).list().length > 0 );
+
+        assertTrue( "failed to checkout project 'module-A'", new File( workingDir, Integer.toString(
moduleA.getId() ) ).list().length > 0 );
 
+        assertTrue( "failed to checkout project 'module-B'", new File( workingDir, Integer.toString(
moduleB.getId() ) ).list().length > 0 );
+
+        assertTrue( "failed to checkout project 'module-D'", new File( workingDir, Integer.toString(
moduleD.getId() ) ).list().length > 0 );
+ 
         while( !buildsManager.getCurrentBuilds().isEmpty() ||
                         isAnyProjectInBuildQueue() )
         {
             Thread.sleep( 10 );
         }
     }
-/*
+
     public void testCheckoutPrepareBuildSingleCheckedoutMultiModuleProject()
         throws Exception
     {
@@ -176,7 +198,7 @@ public class PrepareBuildProjectsTaskExe
 
         List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId()
);
 
-        assertEquals( "failed to add all projects", 3, projects.size() );
+        assertEquals( "failed to add all projects", 4, projects.size() );
 
         Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
 
@@ -197,6 +219,22 @@ public class PrepareBuildProjectsTaskExe
         assertTrue( "module-A was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-A" ).exists() );
 
         assertTrue( "module-B was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-B" ).exists() );
+       
+        assertTrue( "module-D was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-C/module-D" ).exists() );
+
+        assertTrue( "failed to checkout project 'multi-module-parent'", checkedOutDir.list().length
> 0 );
+   
+            assertTrue( "failed to checkout project 'module-A'", new File( checkedOutDir,
"module-A" ).list().length > 0 );
+
+        assertTrue( "failed to checkout project 'module-B'", new File( checkedOutDir, "module-B"
).list().length > 0 );
+
+        assertTrue( "failed to checkout project 'module-D'", new File( checkedOutDir, "module-C/module-D"
).list().length > 0 );
+
+        while( !buildsManager.getCurrentBuilds().isEmpty() ||
+                        isAnyProjectInBuildQueue() )
+        {
+            Thread.sleep( 10 );
+        }
     }
 
     public void testCheckoutPrepareBuildSingleCheckedoutMultiModuleProjectFreshBuild()
@@ -208,7 +246,7 @@ public class PrepareBuildProjectsTaskExe
 
         List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId()
);
 
-        assertEquals( "failed to add all projects", 3, projects.size() );
+        assertEquals( "failed to add all projects", 4, projects.size() );
 
         Project rootProject = getProjectDao().getProjectByName( "multi-module-parent" );
 
@@ -229,6 +267,22 @@ public class PrepareBuildProjectsTaskExe
         assertTrue( "module-A was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-A" ).exists() );
 
         assertTrue( "module-B was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-B" ).exists() );
+        
+        assertTrue( "module-D was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-C/module-D" ).exists() );
+
+        assertTrue( "failed to checkout project 'multi-module-parent'", checkedOutDir.list().length
> 0 );
+
+        assertTrue( "failed to checkout project 'module-A'", new File( checkedOutDir, "module-A"
).list().length > 0 );
+
+        assertTrue( "failed to checkout project 'module-B'", new File( checkedOutDir, "module-B"
).list().length > 0 );
+
+        assertTrue( "failed to checkout project 'module-D'", new File( checkedOutDir, "module-C/module-D"
).list().length > 0 );
+
+        while( !buildsManager.getCurrentBuilds().isEmpty() ||
+                        isAnyProjectInBuildQueue() )
+        {
+            Thread.sleep( 10 );
+        }
     }
 
     public void testCheckoutPrepareBuildSingleCheckoutFlatMultiModuleProject()
@@ -240,8 +294,8 @@ public class PrepareBuildProjectsTaskExe
 
         List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId()
);
 
-        assertEquals( "failed to add all projects", 3, projects.size() );
-
+        assertEquals( "failed to add all projects", 4, projects.size() );
+        
         Project rootProject = getProjectDao().getProjectByName( "parent-project" );
 
         // wait while task finishes prepare build
@@ -261,6 +315,22 @@ public class PrepareBuildProjectsTaskExe
         assertTrue( "module-a was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-a" ).exists() );
 
         assertTrue( "module-b was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-b" ).exists() );
+
+        assertTrue( "module-d was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-c/module-d" ).exists() );
+
+        assertTrue( "failed to checkout parent-project", new File( checkedOutDir, "parent-project"
).list().length > 0 );
+
+        assertTrue( "failed to checkout module-a", new File( checkedOutDir, "module-a" ).list().length
> 0 );
+        
+        assertTrue( "failed to checkout module-b", new File( checkedOutDir, "module-b" ).list().length
> 0 );
+        
+        assertTrue( "failed to checkout module-d", new File( checkedOutDir, "module-c/module-d"
).list().length > 0 );
+
+        while( !buildsManager.getCurrentBuilds().isEmpty() ||
+                        isAnyProjectInBuildQueue() )
+        {
+            Thread.sleep( 10 );
+        }
     }
 
     public void testCheckoutPrepareBuildSingleCheckoutFlatMultiModuleProjectBuildFresh()
@@ -272,7 +342,7 @@ public class PrepareBuildProjectsTaskExe
 
         List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId()
);
 
-        assertEquals( "failed to add all projects", 3, projects.size() );
+        assertEquals( "failed to add all projects", 4, projects.size() );
 
         Project rootProject = getProjectDao().getProjectByName( "parent-project" );
 
@@ -296,8 +366,82 @@ public class PrepareBuildProjectsTaskExe
         assertTrue( "module-a was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-a" ).exists() );
 
         assertTrue( "module-b was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-b" ).exists() );
+
+        assertTrue( "module-d was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-c/module-d" ).exists() );
+
+        assertTrue( "failed to checkout parent-project", new File( checkedOutDir, "parent-project"
).list().length > 0 );
+
+        assertTrue( "failed to checkout module-a", new File( checkedOutDir, "module-a" ).list().length
> 0 );
+        
+        assertTrue( "failed to checkout module-b", new File( checkedOutDir, "module-b" ).list().length
> 0 );
+       
+        assertTrue( "failed to checkout module-d", new File( checkedOutDir, "module-c/module-d"
).list().length > 0 );
+
+        while( !buildsManager.getCurrentBuilds().isEmpty() ||
+                        isAnyProjectInBuildQueue() )
+        {
+            Thread.sleep( 10 );
+        }
+    }
+    
+    public void testCheckoutPrepareBuildSingleCheckoutFlatMultiModuleProjectBuildFreshAfterRemovingWorkingCopy()
+        throws Exception
+    {
+        PrepareBuildProjectsTask task = createTask( "src/test-projects/flat-multi-module/parent-project/pom.xml",
true, true );
+     
+        List<Project> projects = getProjectDao().getProjectsInGroup( task.getProjectGroupId()
);
+     
+        assertEquals( "failed to add all projects", 4, projects.size() );
+    
+        Project rootProject = getProjectDao().getProjectByName( "parent-project" );
+    
+        File rootProjectDir = new File( configurationService.getWorkingDirectory(), Integer.toString(
rootProject.getId() ) );
+        rootProjectDir = new File( rootProjectDir, "parent-project" );
+    
+       rootProject.setWorkingDirectory( rootProjectDir.getAbsolutePath() );
+    
+        getProjectDao().updateProject( rootProject );
+   
+        this.prepareBuildQueue.put( task );
+    
+        ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId()
);
+        // wait while task finishes prepare build
+        while( !prepareBuildQueue.getQueueSnapshot().isEmpty() || 
+                        prepareBuildTaskQueueExecutor.getCurrentTask() != null || scmRoot.getState()
== ContinuumProjectState.UPDATING )
+        {
+            Thread.sleep( 10 );
+
+            scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+        }
+    
+        scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
+        assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED,
scmRoot.getState() );
+    
+        File checkedOutDir = new File( configurationService.getWorkingDirectory(), Integer.toString(
rootProject.getId() ) );
+    
+        assertTrue( "checkout directory of project 'parent-project' does not exist.", new
File( checkedOutDir, "parent-project" ).exists() );
+    
+        assertTrue( "module-a was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-a" ).exists() );
+    
+        assertTrue( "module-b was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-b" ).exists() );
+
+        assertTrue( "module-d was not checked out in the same directory as it's parent.",
new File( checkedOutDir, "module-c/module-d" ).exists() );
+
+        assertTrue( "failed to checkout parent-project", new File( checkedOutDir, "parent-project"
).list().length > 0 );
+
+        assertTrue( "failed to checkout module-a", new File( checkedOutDir, "module-a" ).list().length
> 0 );
+        
+        assertTrue( "failed to checkout module-b", new File( checkedOutDir, "module-b" ).list().length
> 0 );
+        
+        assertTrue( "failed to checkout module-d", new File( checkedOutDir, "module-c/module-d"
).list().length > 0 );
+
+        while( !buildsManager.getCurrentBuilds().isEmpty() ||
+                        isAnyProjectInBuildQueue() )
+        {
+            Thread.sleep( 10 );
+        }
     }
-*/
+
     private PrepareBuildProjectsTask createTask( String pomResource, boolean singleCheckout,
boolean buildFresh )
         throws Exception
     {
@@ -352,10 +496,10 @@ public class PrepareBuildProjectsTaskExe
             }
         }
 
-        assertEquals( 3, map.size() );
-        PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( map, new BuildTrigger(
1, "test-user" ), 
-                                                                      projectGroupId, projectGroup.getName(),

-                                                                      scmRoot.getScmRootAddress(),
scmRoot.getId() );
+        assertEquals( 4, map.size() );
+        PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( map, new org.apache.continuum.utils.build.BuildTrigger(
1, "user" ),
+                                                                               projectGroupId,
projectGroup.getName(), 
+                                                                               scmRoot.getScmRootAddress(),
scmRoot.getId() );
 
         return task;
     }
@@ -367,8 +511,8 @@ public class PrepareBuildProjectsTaskExe
     
         assertNotNull( "Can't find project " + pomResource, pom );
 
-        //ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
pom.toURL(), null, null, true, singleCheckout );
-        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
pom.toURL(), null, null, true );
+        //ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
pom.toURL(), null, null, true );
+        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
pom.toURL(), null, null, true, singleCheckout );
 
         // some assertions to make sure our expectations match. This is NOT
         // meant as a unit test for the projectbuilder!
@@ -412,7 +556,7 @@ public class PrepareBuildProjectsTaskExe
 
         projectScmRoot.setScmRootAddress( url );
 
-        projectScmRoot.setState( ContinuumProjectState.ERROR );
+        //projectScmRoot.setState( ContinuumProjectState.ERROR );
 
         return projectScmRootDao.addProjectScmRoot( projectScmRoot );
     }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/mdo/continuum.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/mdo/continuum.xml?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/mdo/continuum.xml
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/mdo/continuum.xml
Wed May 12 06:41:26 2010
@@ -317,6 +317,12 @@
           <version>1.1.0+</version>
           <type>String</type>
         </field>
+        <field>
+          <name>checkedOutInSingleDirectory</name>
+          <version>1.4.0+</version>
+          <type>boolean</type>
+          <defaultValue>false</defaultValue>
+        </field>
         <field jpox.mapped-by="project" jpox.fetch-groups="project-with-builds">
           <name>buildResults</name>
           <version>1.0.9+</version>

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/resources/package-default.orm
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/resources/package-default.orm?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/resources/package-default.orm
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-model/src/main/resources/package-default.orm
Wed May 12 06:41:26 2010
@@ -17,4 +17,11 @@
       </field>
     </class>
   </package>
+  <package name="org.apache.maven.continuum.model.project">
+    <class name="Project">
+      <field name="checkedOutInSingleDirectory" null-value="default">
+        <column jdbc-type="CHAR" default-value="N" />
+      </field>
+    </class>
+  </package>
 </orm>

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
Wed May 12 06:41:26 2010
@@ -75,7 +75,7 @@ public abstract class AbstractContinuumR
                     executable = ( (ContinuumReleaseDescriptor) releaseDescriptor).getExecutable();
                 }
                 shellCommandHelper.executeGoals( determineWorkingDirectory( workingDirectory,
-                                                                            releaseDescriptor.getScmRelativePathProjectDirectory()
),
+                								 releaseDescriptor.getScmRelativePathProjectDirectory() ),
                                                  executable, goals, releaseDescriptor.isInteractive(),
additionalArguments, result, 
                                                  environments );
             }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
Wed May 12 06:41:26 2010
@@ -83,37 +83,16 @@ public class PerformReleaseTaskExecutor
 
         repository = performTask.getLocalRepository();
 
-        List<MavenProject> reactorProjects = getReactorProjects( performTask );
-
-        ReleaseResult result = releaseManager.performWithResult( descriptor, settings, reactorProjects,
listener );
-
-        //override to show the actual start time
-        result.setStartTime( getStartTime() );
-
-        if ( result.getResultCode() == ReleaseResult.SUCCESS )
-        {
-            continuumReleaseManager.getPreparedReleases().remove( performTask.getReleaseId()
);
-        }
-
-        continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(), result
);
-    }
-
-    protected List<MavenProject> getReactorProjects( PerformReleaseProjectTask releaseTask
)
-        throws TaskExecutionException
-    {
-        List<MavenProject> reactorProjects;
-        ReleaseDescriptor descriptor = releaseTask.getDescriptor();
-
-        if ( StringUtils.isEmpty( descriptor.getWorkingDirectory() ) )
-        {
-            //Perform with provided release parameters (CONTINUUM-1541)
-            descriptor.setCheckoutDirectory( releaseTask.getBuildDirectory().getAbsolutePath()
);
-            return null;
-        }
-
+        List reactorProjects = null;
+        MavenProject mavenProject = null;
+        
         try
         {
-            reactorProjects = getReactorProjects( descriptor );
+        	mavenProject = getMavenProject( performTask );
+            if( mavenProject != null )
+            {
+                reactorProjects = getReactorProjects( descriptor, mavenProject ); 
+            }
         }
         catch ( ContinuumReleaseException e )
         {
@@ -121,38 +100,37 @@ public class PerformReleaseTaskExecutor
 
             result.appendError( e );
 
-            continuumReleaseManager.getReleaseResults().put( releaseTask.getReleaseId(),
result );
+            continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(),
result );
 
-            releaseTask.getListener().error( e.getMessage() );
+            performTask.getListener().error( e.getMessage() );
 
             throw new TaskExecutionException( "Failed to build reactor projects.", e );
         }
 
-        return reactorProjects;
+        ReleaseResult result = releaseManager.performWithResult( descriptor, settings, reactorProjects,
listener );
+        
+        //override to show the actual start time
+        result.setStartTime( getStartTime() );
+
+        if ( result.getResultCode() == ReleaseResult.SUCCESS )
+        {
+            continuumReleaseManager.getPreparedReleases().remove( performTask.getReleaseId()
);
+        }
+
+        continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(), result
);
     }
 
     /**
      * @todo remove and use generate-reactor-projects phase
      */
-    protected List<MavenProject> getReactorProjects( ReleaseDescriptor descriptor )
+    protected List<MavenProject> getReactorProjects( ReleaseDescriptor descriptor,
MavenProject project )
         throws ContinuumReleaseException
     {
         List<MavenProject> reactorProjects = new ArrayList<MavenProject>();
 
-        MavenProject project;
-        try
-        {
-            project = projectBuilder.build( getProjectDescriptorFile( descriptor ), getLocalRepository(),
-                                            getProfileManager( settings ) );
-
-            reactorProjects.add( project );
-
-            addModules( reactorProjects, project );
-        }
-        catch ( ProjectBuildingException e )
-        {
-            throw new ContinuumReleaseException( "Failed to build project.", e );
-        }
+        reactorProjects.add( project );
+       
+        addModules( reactorProjects, project );
 
         try
         {
@@ -238,4 +216,30 @@ public class PerformReleaseTaskExecutor
     {
         container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
     }
+    
+    protected MavenProject getMavenProject( PerformReleaseProjectTask releaseTask )
+	    throws ContinuumReleaseException
+	{
+	    ReleaseDescriptor descriptor = releaseTask.getDescriptor();
+	
+	    if ( StringUtils.isEmpty( descriptor.getWorkingDirectory() ) )
+	    {
+	        //Perform with provided release parameters (CONTINUUM-1541)
+	        descriptor.setCheckoutDirectory( releaseTask.getBuildDirectory().getAbsolutePath()
);
+	        return null;
+	    }
+	
+	    MavenProject project;
+	    try
+	    {
+	        project = projectBuilder.build( getProjectDescriptorFile( descriptor ), getLocalRepository(),
+	                                        getProfileManager( settings ) );
+	    }
+	    catch ( ProjectBuildingException e )
+	    {
+	        throw new ContinuumReleaseException( "Failed to build project.", e );
+	    }
+	    
+	    return project;
+	}   
 }

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/GenerateReactorProjectsPhase.java
Wed May 12 06:41:26 2010
@@ -48,6 +48,7 @@ import org.codehaus.plexus.PlexusContain
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
@@ -150,7 +151,7 @@ public class GenerateReactorProjectsPhas
     {
         for ( Object o : project.getModules() )
         {
-            String moduleDir = o.toString();
+        	String moduleDir = StringUtils.replace( o.toString(), '\\', '/' );
 
             File pomFile = new File( project.getBasedir(), moduleDir + "/pom.xml" );
 

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/resources/META-INF/plexus/components.xml?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/resources/META-INF/plexus/components.xml
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-release/src/main/resources/META-INF/plexus/components.xml
Wed May 12 06:41:26 2010
@@ -279,6 +279,21 @@
           <phase>scm-commit-rollback</phase>
           <phase>remove-scm-tag</phase>
         </rollbackPhases>
+        <!-- Set <branchPhases> even though it is not used in Continuum. Having
this empty causes an NPE when cleaning up the release
+             in maven-release 2.0! -->
+        <branchPhases>
+          <phase>create-backup-poms</phase>
+          <phase>check-poms</phase>
+          <phase>scm-check-modifications</phase>
+          <phase>map-branch-versions</phase>
+          <phase>map-development-versions</phase>
+          <phase>rewrite-poms-for-branch</phase>
+          <phase>scm-commit-branch</phase>
+          <phase>scm-branch</phase>
+          <phase>rewrite-poms-for-development</phase>
+          <phase>scm-commit-release</phase>
+          <phase>end-release</phase>
+        </branchPhases>
       </configuration>
     </component>
     <component>

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
Wed May 12 06:41:26 2010
@@ -32,6 +32,7 @@ import javax.jdo.PersistenceManagerFacto
 import org.apache.continuum.dao.DaoUtils;
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.continuum.dao.ProjectGroupDao;
+import org.apache.continuum.dao.ProjectScmRootDao;
 import org.apache.continuum.dao.ScheduleDao;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
@@ -63,6 +64,8 @@ public abstract class AbstractContinuumT
     private ProjectGroupDao projectGroupDao;
 
     private ScheduleDao scheduleDao;
+    
+    private ProjectScmRootDao projectScmRootDao;
 
     // ----------------------------------------------------------------------
     //
@@ -81,6 +84,8 @@ public abstract class AbstractContinuumT
         getProjectGroupDao();
 
         getScheduleDao();
+        
+        getProjectScmRootDao();
 
         setUpConfigurationService( (ConfigurationService) lookup( "configurationService"
) );
 
@@ -246,6 +251,15 @@ public abstract class AbstractContinuumT
         }
         return scheduleDao;
     }
+    
+    protected ProjectScmRootDao getProjectScmRootDao()
+    {
+        if ( projectScmRootDao == null )
+        {
+            projectScmRootDao = (ProjectScmRootDao) lookup( ProjectScmRootDao.class.getName()
);
+        }
+        return projectScmRootDao;
+    }
 
     // ----------------------------------------------------------------------
     // Build Executor

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
Wed May 12 06:41:26 2010
@@ -53,6 +53,8 @@ public class AddMavenTwoProjectAction
     public static final String FILE_SCHEME = "file:/";
 
     private boolean nonRecursiveProject;
+    
+    private boolean checkoutInSingleDirectory;
 
     protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup,
boolean checkProtocol,
                                                         boolean scmUseCache )
@@ -104,11 +106,18 @@ public class AddMavenTwoProjectAction
             }
         }
 
+     // force set checkoutInCingleDirectory to false if adding the project as non-recursive
+        if( this.isNonRecursiveProject() )
+        {
+            this.setCheckoutInSingleDirectory( false );
+        }
+        
         if ( result == null )
         {
             result = getContinuum().addMavenTwoProject( pomUrl, selectedProjectGroup, checkProtocol,
scmUseCache,
                                                         !this.isNonRecursiveProject(),
-                                                        this.getBuildDefinitionTemplateId()
);
+                                                        this.getBuildDefinitionTemplateId(),
+                                                        this.isCheckoutInSingleDirectory()
);
         }
 
         AuditLog event = new AuditLog( hidePasswordInUrl( pomUrl ), AuditLogConstants.ADD_M2_PROJECT
);
@@ -165,4 +174,14 @@ public class AddMavenTwoProjectAction
     {
         this.nonRecursiveProject = nonRecursiveProject;
     }
+    
+    public boolean isCheckoutInSingleDirectory()
+    {
+        return checkoutInSingleDirectory;
+    }
+
+    public void setCheckoutInSingleDirectory( boolean checkoutInSingleDirectory )
+    {
+        this.checkoutInSingleDirectory = checkoutInSingleDirectory;
+    }
 }

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

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/resources/localization/Continuum.properties
Wed May 12 06:41:26 2010
@@ -339,6 +339,7 @@ add.m2.project.upload.modules.error = Ca
 add.m2.project.nonRecursiveProject = For multi-module project, load only root as recursive
build
 add.m2.project.buildDefinitionTemplate = Build Definition Template
 add.m2.project.defaultBuildDefinition = Default
+add.m2.project.checkoutInSingleDirectory = Checkout multi-module project in single directory
 
 # ----------------------------------------------------------------------
 # Page: AddProject (ant or shell)

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
Wed May 12 06:41:26 2010
@@ -82,6 +82,7 @@
                             </c:otherwise>
                             </c:choose>
                             <s:checkbox label="%{getText('add.m2.project.nonRecursiveProject')}"
name="nonRecursiveProject" />
+                            <s:checkbox label="%{getText('add.m2.project.checkoutInSingleDirectory')}"
name="checkoutInSingleDirectory" />
                             <s:select label="%{getText('add.m2.project.buildDefinitionTemplate')}"
name="buildDefinitionTemplateId"
                                        list="buildDefinitionTemplates" listKey="id" listValue="name"
headerKey="-1" 
                                        headerValue="%{getText('add.m2.project.defaultBuildDefinition')}"/>


Modified: continuum/branches/continuum-flat-multi-module-updated/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/pom.xml?rev=943391&r1=943390&r2=943391&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/pom.xml (original)
+++ continuum/branches/continuum-flat-multi-module-updated/pom.xml Wed May 12 06:41:26 2010
@@ -549,7 +549,7 @@ under the License.
       <dependency>
         <groupId>org.apache.maven.release</groupId>
         <artifactId>maven-release-manager</artifactId>
-        <version>2.0-beta-9</version>
+        <version>2.0</version>
         <exclusions>
           <exclusion>
             <groupId>commons-logging</groupId>



Mime
View raw message