continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r726243 - in /continuum/trunk: ./ continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuu...
Date Sat, 13 Dec 2008 17:46:29 GMT
Author: olamy
Date: Sat Dec 13 09:46:29 2008
New Revision: 726243

URL: http://svn.apache.org/viewvc?rev=726243&view=rev
Log:
merge -r 726238:726239 from 1.2.x branch 
[CONTINUUM-1953]  Build definitions not linked when creating a new project with a given build
defintion template in an existing project group


Added:
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java
      - copied unchanged from r726239, continuum/branches/continuum-1.2.x/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java
Modified:
    continuum/trunk/   (props changed)
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionService.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-core/pom.xml
    continuum/trunk/continuum-docs/src/site/xdoc/   (props changed)

Propchange: continuum/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec 13 09:46:29 2008
@@ -1 +1 @@
-/continuum/branches/continuum-1.2.x:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103
+/continuum/branches/continuum-1.2.x:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103,726239

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionService.java?rev=726243&r1=726242&r2=726243&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionService.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionService.java
Sat Dec 13 09:46:29 2008
@@ -115,7 +115,7 @@
 
     public List<BuildDefinitionTemplate> getBuildDefinitionTemplatesWithType( String
type )
         throws BuildDefinitionServiceException;
-
+    
     public ProjectGroup addBuildDefinitionTemplateToProjectGroup( int projectGroupId,
                                                                   BuildDefinitionTemplate
buildDefinitionTemplate )
         throws BuildDefinitionServiceException, ContinuumObjectNotFoundException;

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=726243&r1=726242&r2=726243&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
Sat Dec 13 09:46:29 2008
@@ -1535,8 +1535,13 @@
 
         ProjectGroup projectGroup = (ProjectGroup) result.getProjectGroups().iterator().next();
 
+
         ProjectScmRoot projectScmRoot;
 
+
+        boolean projectGroupCreation = false;
+        
+
         try
         {
             if ( projectGroupId == -1 )
@@ -1566,6 +1571,8 @@
                     executeAction( "store-project-group", pgContext );
 
                     projectGroupId = AbstractContinuumAction.getProjectGroupId( pgContext
);
+                    
+                    projectGroupCreation = true;
                 }
             }
 
@@ -1624,6 +1631,14 @@
             {
                 context = new HashMap();
 
+                // CONTINUUM-1953 olamy : attached buildDefs from template here
+                // if no group creation 
+                if ( !projectGroupCreation && buildDefintionTemplateId > 0 )
+                {
+                    buildDefinitionService.addTemplateInProject( buildDefintionTemplateId,
projectDao
+                        .getProject( project.getId() ) );
+                }                
+                
                 context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
                 //
                 //            executeAction( "validate-project", context );
@@ -1649,6 +1664,10 @@
                 executeAction( "add-project-to-checkout-queue", context );
             }
         }
+        catch ( BuildDefinitionServiceException e )
+        {
+            throw new ContinuumException( "Error attaching buildDefintionTemplate to project
", e );
+        }
         catch ( ContinuumStoreException e )
         {
             throw new ContinuumException( "Error adding projects from modules", e );

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java?rev=726243&r1=726242&r2=726243&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
Sat Dec 13 09:46:29 2008
@@ -101,11 +101,18 @@
 
         try
         {
+            BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate(
context );
+            if ( buildDefinitionTemplate == null )
+            {
+                buildDefinitionTemplate = projectBuilder.getDefaultBuildDefinitionTemplate();
+            }            
             if ( !curl.startsWith( "http" ) )
             {
                 url = new URL( curl );
 
-                result = projectBuilder.buildProjectsFromMetadata( url, null, null );
+                result = projectBuilder.buildProjectsFromMetadata( url, null, null, loadRecursiveProjects,
+                                                                   buildDefinitionTemplate
);
+
             }
             else
             {
@@ -141,11 +148,7 @@
 
                 if ( urlValidator.isValid( curl ) )
                 {
-                    BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate(
context );
-                    if ( buildDefinitionTemplate == null )
-                    {
-                        buildDefinitionTemplate = projectBuilder.getDefaultBuildDefinitionTemplate();
-                    }
+
                     result = projectBuilder.buildProjectsFromMetadata( url, username, password,
loadRecursiveProjects,
                                                                        buildDefinitionTemplate
);
 

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=726243&r1=726242&r2=726243&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Sat Dec 13 09:46:29 2008
@@ -90,7 +90,9 @@
         
         //assertTrue( validator.validate( fileUrl ) );
         
-        ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( fileUrl );
+        ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( rootPom.toURI().toURL()
+                                                                              .toExternalForm(),
-1, true,
+                                                                              false, true,
-1 );
 
         assertNotNull( result );
 
@@ -473,8 +475,9 @@
         assertEquals( 0 , continuum.getAllContinuumReleaseResults().size() );
         assertFalse( logFile.exists() );
         assertEquals( defaultProjectGroup, continuum.getProjectGroupByGroupId( Continuum.DEFAULT_PROJECT_GROUP_GROUP_ID
) );
+        
     }
-
+    
     private Continuum getContinuum()
         throws Exception
     {

Modified: continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-core/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-core/pom.xml?rev=726243&r1=726242&r2=726243&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-core/pom.xml
(original)
+++ continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-core/pom.xml
Sat Dec 13 09:46:29 2008
@@ -17,7 +17,7 @@
   ~ under the License.
   -->
 
-<project>
+<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>
   <parent>
     <artifactId>continuum-parent</artifactId>

Propchange: continuum/trunk/continuum-docs/src/site/xdoc/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec 13 09:46:29 2008
@@ -1,2 +1,2 @@
-/continuum/branches/continuum-1.2.x/continuum-docs/src/site/xdoc:698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103
+/continuum/branches/continuum-1.2.x/continuum-docs/src/site/xdoc:698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103,726239
 /continuum/trunk/continuum-docs/src/site/xdoc:690494-690520



Mime
View raw message