continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r897780 - /continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Date Mon, 11 Jan 2010 07:45:04 GMT
Author: ctan
Date: Mon Jan 11 07:45:04 2010
New Revision: 897780

URL: http://svn.apache.org/viewvc?rev=897780&view=rev
Log:
[CONTINUUM-2411] added checks and break up the codes
merge -r 897779 of 1.3.x branch

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=897780&r1=897779&r2=897780&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Mon Jan 11 07:45:04 2010
@@ -1749,17 +1749,29 @@
                 AbstractContinuumAction.setProject( context, projectDao.getProject( project.getId()
) );
 
                 BuildDefinition defaultBuildDefinition = null;
+                BuildDefinitionTemplate template = null;
                 if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
                 {
-                    defaultBuildDefinition =
-                        (BuildDefinition) buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getBuildDefinitions().get(
-                            0 );
+                    template = buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate();
+
+                    if( template != null && template.getBuildDefinitions().size()
> 0 )
+                    {
+                        defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
+                    }
                 }
                 else if ( projectBuilderId.equals( MavenOneContinuumProjectBuilder.ID ) )
                 {
-                    defaultBuildDefinition =
-                        (BuildDefinition) buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate().getBuildDefinitions().get(
-                            0 );
+                    template = buildDefinitionService.getDefaultMavenOneBuildDefinitionTemplate();
+
+                    if ( template != null && template.getBuildDefinitions().size()
> 0 )
+                    {
+                        defaultBuildDefinition = template.getBuildDefinitions().get( 0 );
+                    }
+                }
+
+                if ( defaultBuildDefinition == null )
+                {
+                    throw new ContinuumException( "Error adding projects from modules because
no default build definition defined in the default template" );
                 }
 
                 // used by BuildManager to determine on which build queue will the project
be put



Mime
View raw message