continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1372260 [8/30] - in /continuum/trunk: ./ continuum-api/ continuum-api/src/main/java/org/apache/continuum/builder/distributed/ continuum-api/src/main/java/org/apache/continuum/builder/distributed/executor/ continuum-api/src/main/java/org/ap...
Date Mon, 13 Aug 2012 04:29:28 GMT
Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java (original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java Mon Aug 13 04:29:09 2012
@@ -26,14 +26,13 @@ import org.springframework.stereotype.Se
 
 import java.io.File;
 import java.util.List;
-
 import javax.annotation.Resource;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
  */
-@Service("workingDirectoryService")
+@Service( "workingDirectoryService" )
 public class DefaultWorkingDirectoryService
     implements WorkingDirectoryService
 {
@@ -56,7 +55,7 @@ public class DefaultWorkingDirectoryServ
 
     public File getWorkingDirectory( Project project )
     {
-    	return getWorkingDirectory( project, null, null );
+        return getWorkingDirectory( project, null, null );
     }
 
     public File getWorkingDirectory( Project project, boolean shouldSet )
@@ -65,10 +64,9 @@ public class DefaultWorkingDirectoryServ
     }
 
     /**
-     * 
      * @param project
      * @param projectScmRoot
-     * @param projects projects under the same projectScmRoot
+     * @param projects       projects under the same projectScmRoot
      * @return
      */
     public File getWorkingDirectory( Project project, String projectScmRoot, List<Project> projects )
@@ -77,10 +75,9 @@ public class DefaultWorkingDirectoryServ
     }
 
     /**
-     * 
      * @param project
      * @param projectScmRoot
-     * @param projects projects under the same projectScmRoot
+     * @param projects       projects under the same projectScmRoot
      * @param shouldSet
      * @return
      */
@@ -93,49 +90,49 @@ public class DefaultWorkingDirectoryServ
 //                         project.getPath() );
 
         String workingDirectory = project.getWorkingDirectory();
-    	
+
         if ( project.getWorkingDirectory() == null || "".equals( project.getWorkingDirectory() ) )
-        {   
+        {
             if ( project.isCheckedOutInSingleDirectory() && projectScmRoot != null && !"".equals( projectScmRoot ) )
-            {                
+            {
                 Project rootProject = project;
-                if( projects != null )
+                if ( projects != null )
                 {
                     // the root project should have the lowest id since it's always added first                    
-                    for( Project projectUnderScmRoot : projects )
+                    for ( Project projectUnderScmRoot : projects )
                     {
-                        if( projectUnderScmRoot.getId() < rootProject.getId() )
+                        if ( projectUnderScmRoot.getId() < rootProject.getId() )
                         {
                             rootProject = projectUnderScmRoot;
                         }
                     }
-                }                
-                
-             // determine the path
+                }
+
+                // determine the path
                 String projectScmUrl = project.getScmUrl();
                 int indexDiff = StringUtils.differenceAt( projectScmUrl, projectScmRoot );
-                                
+
                 String pathToProject = "";
-                if( indexDiff != -1 )
+                if ( indexDiff != -1 )
                 {
                     pathToProject = projectScmUrl.substring( indexDiff );
                 }
-                
-                if( pathToProject.startsWith( "\\" ) || pathToProject.startsWith( "/" ) )
+
+                if ( pathToProject.startsWith( "\\" ) || pathToProject.startsWith( "/" ) )
                 {
                     workingDirectory = Integer.toString( rootProject.getId() ) + pathToProject;
                 }
                 else
                 {
                     workingDirectory = Integer.toString( rootProject.getId() ) + File.separatorChar + pathToProject;
-                }                
+                }
             }
             else
             {
                 workingDirectory = Integer.toString( project.getId() );
             }
         }
-    	
+
         if ( shouldSet )
         {
             project.setWorkingDirectory( workingDirectory );
@@ -143,7 +140,7 @@ public class DefaultWorkingDirectoryServ
 
         File workDir;
         File projectWorkingDirectory = new File( workingDirectory );
-        
+
         if ( projectWorkingDirectory.isAbsolute() )
         {
             // clean the project working directory path if it's a subdirectory of the global working directory
@@ -156,7 +153,7 @@ public class DefaultWorkingDirectoryServ
                 {
                     pwd = pwd.substring( 1 );
                 }
-               
+
                 if ( shouldSet )
                 {
                     project.setWorkingDirectory( pwd );
@@ -167,11 +164,11 @@ public class DefaultWorkingDirectoryServ
         }
         else
         {
-            File baseWorkingDir = getConfigurationService().getWorkingDirectory();            
-        	            
+            File baseWorkingDir = getConfigurationService().getWorkingDirectory();
+
             workDir = new File( baseWorkingDir, workingDirectory );
         }
-        
+
         return workDir;
     }
 }

Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/URLUserInfo.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/URLUserInfo.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/URLUserInfo.java (original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/utils/URLUserInfo.java Mon Aug 13 04:29:09 2012
@@ -28,11 +28,11 @@ public class URLUserInfo
 {
 
     private String username;
-    
+
     private String password;
-    
+
     /**
-     * 
+     *
      */
     public URLUserInfo()
     {

Modified: continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml (original)
+++ continuum/trunk/continuum-commons/src/main/resources/META-INF/spring-context.xml Mon Aug 13 04:29:09 2012
@@ -26,14 +26,14 @@
            http://www.springframework.org/schema/context 
            http://www.springframework.org/schema/context/spring-context-2.5.xsd">
 
-  <context:annotation-config />
-  <context:component-scan 
-    base-package="org.apache.continuum.installation,org.apache.continuum.profile,
+  <context:annotation-config/>
+  <context:component-scan
+      base-package="org.apache.continuum.installation,org.apache.continuum.profile,
                   org.apache.maven.continuum.configuration,org.apache.maven.continuum.utils"/>
 
   <bean id="configurationService" class="org.apache.maven.continuum.configuration.DefaultConfigurationService"
         init-method="initialize">
     <property name="applicationHome" value="data"/>
-  </bean> 
+  </bean>
   <bean id="buildQueueService" class="org.apache.continuum.buildqueue.DefaultBuildQueueService"/>
 </beans>
\ No newline at end of file

Modified: continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java (original)
+++ continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java Mon Aug 13 04:29:09 2012
@@ -1,7 +1,5 @@
 package org.apache.continuum.profile;
 
-import java.util.List;
-
 import org.apache.continuum.dao.DaoUtils;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.installation.InstallationService;
@@ -10,6 +8,8 @@ import org.apache.maven.continuum.model.
 import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
 import org.apache.maven.continuum.profile.ProfileService;
 
+import java.util.List;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -224,7 +224,7 @@ public class DefaultProfileServiceTest
         try
         {
             getProfileService().updateProfile( profile );
-            
+
             fail( "no AlreadyExistsProfileException with duplicate name" );
         }
         catch ( AlreadyExistsProfileException e )

Modified: continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java (original)
+++ continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java Mon Aug 13 04:29:09 2012
@@ -19,8 +19,6 @@ package org.apache.maven.continuum.confi
  * under the License.
  */
 
-import java.io.File;
-
 import org.apache.continuum.configuration.BuildAgentConfiguration;
 import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
@@ -28,6 +26,8 @@ import org.codehaus.plexus.util.FileUtil
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.File;
+
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
@@ -143,8 +143,8 @@ public class ConfigurationServiceTest
         assertEquals( "check # build agent groups", 2, service.getBuildAgentGroups().get( 0 ).getBuildAgents().size() );
         assertEquals( "group-1", service.getBuildAgentGroups().get( 0 ).getName() );
         assertEquals( "windows", service.getBuildAgentGroups().get( 0 ).getBuildAgents().get( 0 ).getDescription() );
-        assertEquals( "http://machine-1/xmlrpc",
-                      service.getBuildAgentGroups().get( 0 ).getBuildAgents().get( 1 ).getUrl() );
+        assertEquals( "http://machine-1/xmlrpc", service.getBuildAgentGroups().get( 0 ).getBuildAgents().get(
+            1 ).getUrl() );
         assertEquals( "node-1", service.getBuildAgentGroups().get( 0 ).getBuildAgents().get( 1 ).getDescription() );
         assertEquals( true, service.getBuildAgentGroups().get( 0 ).getBuildAgents().get( 1 ).isEnabled() );
 

Modified: continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/utils/ContinuumUrlValidatorTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/utils/ContinuumUrlValidatorTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/utils/ContinuumUrlValidatorTest.java (original)
+++ continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/utils/ContinuumUrlValidatorTest.java Mon Aug 13 04:29:09 2012
@@ -1,9 +1,9 @@
 package org.apache.maven.continuum.utils;
 
-import java.io.File;
-
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 
+import java.io.File;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -30,7 +30,7 @@ import org.codehaus.plexus.spring.Plexus
 public class ContinuumUrlValidatorTest
     extends PlexusInSpringTestCase
 {
-    
+
     protected ContinuumUrlValidator getContinuumUrlValidator()
         throws Exception
     {
@@ -41,7 +41,7 @@ public class ContinuumUrlValidatorTest
         throws Exception
     {
         return (ContinuumUrlValidator) lookup( ContinuumUrlValidator.class, roleHint );
-    }    
+    }
 
     public void testSuccessHttp()
         throws Exception
@@ -58,15 +58,15 @@ public class ContinuumUrlValidatorTest
     public void testSuccessHttpWithAuth()
         throws Exception
     {
-        assertTrue( getContinuumUrlValidator()
-            .validate( "https://username:password@svn.apache.org/repos/asf/continuum/trunk/pom.xml" ) );
+        assertTrue( getContinuumUrlValidator().validate(
+            "https://username:password@svn.apache.org/repos/asf/continuum/trunk/pom.xml" ) );
     }
 
     public void testFailureHttpWithAuth()
         throws Exception
     {
-        assertTrue( getContinuumUrlValidator()
-            .validate( "http://username:passwordsvn.apache.org/repos/asf/continuum/trunk/pom.xml" ) );
+        assertTrue( getContinuumUrlValidator().validate(
+            "http://username:passwordsvn.apache.org/repos/asf/continuum/trunk/pom.xml" ) );
     }
 
     public void testFailureHttpWithFile()
@@ -84,53 +84,50 @@ public class ContinuumUrlValidatorTest
     public void testSuccessHttpsWithAuth()
         throws Exception
     {
-        assertTrue( getContinuumUrlValidator()
-            .validate( "https://username:password@svn.apache.org/repos/asf/continuum/trunk/pom.xml" ) );
+        assertTrue( getContinuumUrlValidator().validate(
+            "https://username:password@svn.apache.org/repos/asf/continuum/trunk/pom.xml" ) );
     }
 
     public void testSuccessHttpviewvc()
         throws Exception
     {
-        assertTrue( getContinuumUrlValidator()
-            .validate( "http://svn.apache.org/viewvc/continuum/trunk/pom.xml?revision=681492&content-type=text%2Fplain" ) );
+        assertTrue( getContinuumUrlValidator().validate(
+            "http://svn.apache.org/viewvc/continuum/trunk/pom.xml?revision=681492&content-type=text%2Fplain" ) );
     }
 
     public void testSuccessHttpviewvcWithAuth()
         throws Exception
     {
-        assertTrue( getContinuumUrlValidator()
-            .validate(
-                       "http://username:password@svn.apache.org/viewvc/continuum/trunk/pom.xml?revision=681492&content-type=text%2Fplain" ) );
+        assertTrue( getContinuumUrlValidator().validate(
+            "http://username:password@svn.apache.org/viewvc/continuum/trunk/pom.xml?revision=681492&content-type=text%2Fplain" ) );
     }
 
     public void testSuccessHttpsviewvc()
         throws Exception
     {
-        assertTrue( getContinuumUrlValidator()
-            .validate(
-                       "https://svn.apache.org/viewvc/continuum/trunk/pom.xml?revision=681492&content-type=text%2Fplain" ) );
+        assertTrue( getContinuumUrlValidator().validate(
+            "https://svn.apache.org/viewvc/continuum/trunk/pom.xml?revision=681492&content-type=text%2Fplain" ) );
     }
 
     public void testSuccessHttpsviewvcWithAuth()
         throws Exception
     {
-        assertTrue( getContinuumUrlValidator()
-            .validate(
-                       "https://username:password@svn.apache.org/viewvc/continuum/trunk/pom.xml?revision=681492&content-type=text%2Fplain" ) );
+        assertTrue( getContinuumUrlValidator().validate(
+            "https://username:password@svn.apache.org/viewvc/continuum/trunk/pom.xml?revision=681492&content-type=text%2Fplain" ) );
     }
 
     public void testSuccessHttpfisheye()
         throws Exception
     {
-        assertTrue( getContinuumUrlValidator()
-            .validate( "http://fisheye6.atlassian.com/browse/~raw,r=680040/continuum/trunk/pom.xml" ) );
+        assertTrue( getContinuumUrlValidator().validate(
+            "http://fisheye6.atlassian.com/browse/~raw,r=680040/continuum/trunk/pom.xml" ) );
     }
 
     public void testSuccessHttpsfisheye()
         throws Exception
     {
-        assertTrue( getContinuumUrlValidator()
-            .validate( "https://fisheye6.atlassian.com/browse/~raw,r=680040/continuum/trunk/pom.xml" ) );
+        assertTrue( getContinuumUrlValidator().validate(
+            "https://fisheye6.atlassian.com/browse/~raw,r=680040/continuum/trunk/pom.xml" ) );
     }
 
     public void testValidateFile()
@@ -140,35 +137,35 @@ public class ContinuumUrlValidatorTest
         assertTrue( rootPom.exists() );
         assertTrue( getContinuumUrlValidator().validate( rootPom.toURL().toExternalForm() ) );
     }
-   
-    
+
+
     public void testExtractUserNamePwd()
         throws Exception
     {
         ContinuumUrlValidator continuumUrlValidator = new ContinuumUrlValidator();
-        URLUserInfo usrInfo = continuumUrlValidator
-            .extractURLUserInfo( "https://username:password@svn.apache.org/repos/asf/continuum/trunk/pom.xml" );
+        URLUserInfo usrInfo = continuumUrlValidator.extractURLUserInfo(
+            "https://username:password@svn.apache.org/repos/asf/continuum/trunk/pom.xml" );
         assertEquals( "username", usrInfo.getUsername() );
         assertEquals( "password", usrInfo.getPassword() );
     }
-    
+
     public void testExtractUserNameEmptyPwd()
         throws Exception
     {
         ContinuumUrlValidator continuumUrlValidator = new ContinuumUrlValidator();
-        URLUserInfo usrInfo = continuumUrlValidator
-            .extractURLUserInfo( "https://username@svn.apache.org/repos/asf/continuum/trunk/pom.xml" );
+        URLUserInfo usrInfo = continuumUrlValidator.extractURLUserInfo(
+            "https://username@svn.apache.org/repos/asf/continuum/trunk/pom.xml" );
         assertEquals( "username", usrInfo.getUsername() );
         assertNull( usrInfo.getPassword() );
     }
-    
+
     public void testExtractEmptyUserNameEmptyPwd()
         throws Exception
     {
         ContinuumUrlValidator continuumUrlValidator = new ContinuumUrlValidator();
-        URLUserInfo usrInfo = continuumUrlValidator
-            .extractURLUserInfo( "https://svn.apache.org/repos/asf/continuum/trunk/pom.xml" );
+        URLUserInfo usrInfo = continuumUrlValidator.extractURLUserInfo(
+            "https://svn.apache.org/repos/asf/continuum/trunk/pom.xml" );
         assertNull( usrInfo.getUsername() );
         assertNull( usrInfo.getPassword() );
-    }     
+    }
 }

Modified: continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryServiceTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryServiceTest.java (original)
+++ continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryServiceTest.java Mon Aug 13 04:29:09 2012
@@ -19,156 +19,159 @@ package org.apache.maven.continuum.utils
  * under the License.
  */
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.shared.release.util.ReleaseUtil;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.jmock.integration.junit3.JUnit3Mockery;
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
- * @version 
  */
 public class DefaultWorkingDirectoryServiceTest
     extends PlexusInSpringTestCase
 {
     private DefaultWorkingDirectoryService workingDirectoryService;
-    
+
     private Mockery context;
-    
+
     private ConfigurationService configurationService;
-    
+
     public void setUp()
         throws Exception
     {
         super.setUp();
-        
+
         context = new JUnit3Mockery();
-        
+
         configurationService = context.mock( ConfigurationService.class );
-        
-        workingDirectoryService = ( DefaultWorkingDirectoryService ) lookup( WorkingDirectoryService.class );
-        
+
+        workingDirectoryService = (DefaultWorkingDirectoryService) lookup( WorkingDirectoryService.class );
+
         workingDirectoryService.setConfigurationService( configurationService );
     }
-    
+
     private Project createProject( int id, String groupId, String artifactId, String version, String scmUrl,
                                    boolean checkedOutInSingleDirectory )
     {
-        Project project = new Project();        
+        Project project = new Project();
         project.setId( id );
         project.setGroupId( groupId );
         project.setArtifactId( artifactId );
         project.setVersion( version );
         project.setScmUrl( scmUrl );
         project.setCheckedOutInSingleDirectory( checkedOutInSingleDirectory );
-        
+
         return project;
     }
-    
+
     public void testGetWorkingDirectoryOfSingleCheckoutFlatMultiModules()
         throws Exception
-    {        
+    {
         List<Project> projects = new ArrayList<Project>();
-        
+
         Project project = createProject( 7, "org.apache.continuum", "module-a", "1.0-SNAPSHOT",
                                          "scm:local:src/test-projects:flat-multi-module/module-a", true );
-        
+
         projects.add( project );
-        
+
         projects.add( createProject( 8, "org.apache.continuum", "module-b", "1.0-SNAPSHOT",
                                      "scm:local:src/test-projects:flat-multi-module/module-b", true ) );
-                
+
         projects.add( createProject( 6, "org.apache.continuum", "parent-project", "1.0-SNAPSHOT",
                                      "scm:local:src/test-projects:flat-multi-module/parent-project", true ) );
-         
+
         final File baseWorkingDirectory = new File( getBasedir(), "target" + File.separatorChar + "working-directory" );
-           
+
         context.checking( new Expectations()
         {
             {
                 exactly( 2 ).of( configurationService ).getWorkingDirectory();
-                will( returnValue( baseWorkingDirectory ) );                
-            }} );
-        
-        File projectWorkingDirectory =
-            workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:flat-multi-module",
-                                                         projects );
-        
+                will( returnValue( baseWorkingDirectory ) );
+            }
+        } );
+
+        File projectWorkingDirectory = workingDirectoryService.getWorkingDirectory( project,
+                                                                                    "scm:local:src/test-projects:flat-multi-module",
+                                                                                    projects );
+
         assertEquals( "Incorrect working directory for flat multi-module project", baseWorkingDirectory +
-		              File.separator + "6" + File.separator + "module-a", projectWorkingDirectory.getPath() );
-        
+            File.separator + "6" + File.separator + "module-a", projectWorkingDirectory.getPath() );
+
         // test if separator is appended at the end of the scm root url
-        projectWorkingDirectory =
-            workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:flat-multi-module/",
-                                                         projects );
-        
+        projectWorkingDirectory = workingDirectoryService.getWorkingDirectory( project,
+                                                                               "scm:local:src/test-projects:flat-multi-module/",
+                                                                               projects );
+
         assertEquals( "Incorrect working directory for flat multi-module project", baseWorkingDirectory +
-                      File.separator + "6" + File.separator + "module-a", projectWorkingDirectory.getPath() );            
+            File.separator + "6" + File.separator + "module-a", projectWorkingDirectory.getPath() );
     }
 
     public void testGetWorkingDirectoryOfSingleCheckoutRegularMultiModules()
         throws Exception
-    {       
+    {
         List<Project> projects = new ArrayList<Project>();
-        
+
         Project project = createProject( 10, "org.apache.continuum", "module-a", "1.0-SNAPSHOT",
                                          "scm:local:src/test-projects:regular-multi-module/module-a", true );
-        
+
         projects.add( project );
-        
+
         projects.add( createProject( 11, "org.apache.continuum", "module-b", "1.0-SNAPSHOT",
                                      "scm:local:src/test-projects:regular-multi-module/module-b", true ) );
-                
+
         projects.add( createProject( 9, "org.apache.continuum", "parent-project", "1.0-SNAPSHOT",
                                      "scm:local:src/test-projects:regular-multi-module/", true ) );
-        
+
         final File baseWorkingDirectory = new File( getBasedir(), "target" + File.separator + "working-directory" );
-        
+
         context.checking( new Expectations()
         {
             {
                 exactly( 2 ).of( configurationService ).getWorkingDirectory();
-                will( returnValue( baseWorkingDirectory ) );                
-            }} );
-        
-        File projectWorkingDirectory =
-            workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:regular-multi-module",
-                                                         projects );
-        
-        assertEquals( "Incorrect working directory for regular multi-module project", baseWorkingDirectory + File.separator + 
-        			"9" + File.separator + "module-a", projectWorkingDirectory.getPath() );
-        
+                will( returnValue( baseWorkingDirectory ) );
+            }
+        } );
+
+        File projectWorkingDirectory = workingDirectoryService.getWorkingDirectory( project,
+                                                                                    "scm:local:src/test-projects:regular-multi-module",
+                                                                                    projects );
+
+        assertEquals( "Incorrect working directory for regular multi-module project",
+                      baseWorkingDirectory + File.separator +
+                          "9" + File.separator + "module-a", projectWorkingDirectory.getPath() );
+
         // test if separator is appended at the end of the scm root url
-        projectWorkingDirectory =
-            workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:regular-multi-module/",
-                                                         projects );
-        
-        assertEquals( "Incorrect working directory for regular multi-module project", baseWorkingDirectory + File.separator + 
-        		    "9" + File.separator + "module-a", projectWorkingDirectory.getPath() );
-        
-     // test generated path of parent project
+        projectWorkingDirectory = workingDirectoryService.getWorkingDirectory( project,
+                                                                               "scm:local:src/test-projects:regular-multi-module/",
+                                                                               projects );
+
+        assertEquals( "Incorrect working directory for regular multi-module project",
+                      baseWorkingDirectory + File.separator +
+                          "9" + File.separator + "module-a", projectWorkingDirectory.getPath() );
+
+        // test generated path of parent project
         project = createProject( 9, "org.apache.continuum", "parent-project", "1.0-SNAPSHOT",
-                       "scm:local:src/test-projects:regular-multi-module", true );
-        
+                                 "scm:local:src/test-projects:regular-multi-module", true );
+
         context.checking( new Expectations()
         {
             {
                 one( configurationService ).getWorkingDirectory();
-                will( returnValue( baseWorkingDirectory ) );                
-            }} );
-        
-        projectWorkingDirectory =
-            workingDirectoryService.getWorkingDirectory( project, "scm:local:src/test-projects:regular-multi-module",
-                                                         projects );
-        
+                will( returnValue( baseWorkingDirectory ) );
+            }
+        } );
+
+        projectWorkingDirectory = workingDirectoryService.getWorkingDirectory( project,
+                                                                               "scm:local:src/test-projects:regular-multi-module",
+                                                                               projects );
+
         assertEquals( "Incorrect working directory for regular multi-module project", baseWorkingDirectory +
-		            File.separator + "9", projectWorkingDirectory.getPath() );
-    }    
+            File.separator + "9", projectWorkingDirectory.getPath() );
+    }
 }
\ No newline at end of file

Modified: continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml (original)
+++ continuum/trunk/continuum-commons/src/test/resources/META-INF/continuum/continuum-configuration.xml Mon Aug 13 04:29:09 2012
@@ -21,9 +21,9 @@
 
 <configuration>
   <system/>
-  <jndi prefix="java:comp/env" config-optional="true"/>  
+  <jndi prefix="java:comp/env" config-optional="true"/>
   <xml fileName="${appserver.base}/conf/continuum.xml" config-optional="true"
        config-forceCreate="true" config-name="org.apache.continuum"/>
   <xml fileName="${user.home}/.m2/continuum.xml" config-optional="true"
-       config-forceCreate="true" config-name="org.apache.continuum.user"/>  
+       config-forceCreate="true" config-name="org.apache.continuum.user"/>
 </configuration>

Modified: continuum/trunk/continuum-commons/src/test/resources/org/apache/maven/continuum/utils/ContinuumUrlValidatorTest.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/resources/org/apache/maven/continuum/utils/ContinuumUrlValidatorTest.xml?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/resources/org/apache/maven/continuum/utils/ContinuumUrlValidatorTest.xml (original)
+++ continuum/trunk/continuum-commons/src/test/resources/org/apache/maven/continuum/utils/ContinuumUrlValidatorTest.xml Mon Aug 13 04:29:09 2012
@@ -43,7 +43,7 @@
         </allowedSchemes>
       </configuration>
     </component>
-    
-    
+
+
   </components>
 </plexus>

Modified: continuum/trunk/continuum-core/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/pom.xml?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/pom.xml (original)
+++ continuum/trunk/continuum-core/pom.xml Mon Aug 13 04:29:09 2012
@@ -17,8 +17,9 @@ KIND, either express or implied.  See th
 specific language governing permissions and limitations
 under the License.
 -->
-<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">
-  <parent>  
+<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">
+  <parent>
     <artifactId>continuum</artifactId>
     <groupId>org.apache.continuum</groupId>
     <version>1.4.1-SNAPSHOT</version>
@@ -59,7 +60,7 @@ under the License.
     <dependency>
       <groupId>org.apache.continuum</groupId>
       <artifactId>continuum-reports</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-model</artifactId>
@@ -67,7 +68,7 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>file-management</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-velocity</artifactId>
@@ -87,7 +88,7 @@ under the License.
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-component-api</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
@@ -98,16 +99,16 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId> 
+      <artifactId>maven-project</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpcore</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-action</artifactId>
@@ -163,11 +164,11 @@ under the License.
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context-support</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-beans</artifactId>
@@ -175,14 +176,14 @@ under the License.
     <dependency>
       <groupId>org.apache.continuum</groupId>
       <artifactId>continuum-builder</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.apache.continuum</groupId>
       <artifactId>continuum-distributed-slave-client</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>velocity</groupId>
-      <artifactId>velocity</artifactId>      
+      <artifactId>velocity</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.release</groupId>
@@ -191,7 +192,7 @@ under the License.
     <dependency>
       <groupId>javax.mail</groupId>
       <artifactId>mail</artifactId>
-    </dependency>    
+    </dependency>
     <!-- contains redback-core.xml that is needed to instantiate some test classes -->
     <dependency>
       <groupId>org.codehaus.redback</groupId>
@@ -245,7 +246,7 @@ under the License.
       <groupId>org.codehaus.redback</groupId>
       <artifactId>plexus-spring</artifactId>
       <scope>test</scope>
-    </dependency>  
+    </dependency>
     <dependency>
       <groupId>org.jmock</groupId>
       <artifactId>jmock-junit3</artifactId>
@@ -260,7 +261,7 @@ under the License.
     <!-- dependency of jmock3 -->
     <dependency>
       <groupId>org.objenesis</groupId>
-      <artifactId>objenesis</artifactId>  
+      <artifactId>objenesis</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -319,7 +320,7 @@ under the License.
             <!-- CONTINUUM-2559 -->
             <exclude>**/MailContinuumNotifierTest.*</exclude>
           </excludes>
-        </configuration>        
+        </configuration>
       </plugin>
     </plugins>
   </build>

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/DefaultDistributedBuildService.java Mon Aug 13 04:29:09 2012
@@ -1,16 +1,5 @@
 package org.apache.continuum.builder.distributed;
 
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
 import org.apache.continuum.builder.distributed.util.DistributedBuildUtil;
 import org.apache.continuum.builder.utils.ContinuumBuildConstant;
@@ -41,6 +30,17 @@ import org.codehaus.plexus.util.StringUt
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @plexus.component role="org.apache.continuum.builder.distributed.DistributedBuildService"
  */
@@ -101,17 +101,17 @@ public class DefaultDistributedBuildServ
         {
             int projectId = ContinuumBuildConstant.getProjectId( context );
             int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( context );
-    
+
             log.info( "update build result of project '" + projectId + "'" );
-    
+
             Project project = projectDao.getProjectWithAllDetails( projectId );
             BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
-    
-            BuildResult oldBuildResult =
-                buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
-    
+
+            BuildResult oldBuildResult = buildResultDao.getLatestBuildResultForBuildDefinition( projectId,
+                                                                                                buildDefinitionId );
+
             int buildNumber;
-    
+
             if ( ContinuumBuildConstant.getBuildState( context ) == ContinuumProjectState.OK )
             {
                 buildNumber = project.getBuildNumber() + 1;
@@ -120,20 +120,21 @@ public class DefaultDistributedBuildServ
             {
                 buildNumber = project.getBuildNumber();
             }
-    
+
             // ----------------------------------------------------------------------
             // Make the buildResult
             // ----------------------------------------------------------------------
-    
+
             BuildResult buildResult = distributedBuildUtil.convertMapToBuildResult( context );
-    
+
             if ( buildResult.getState() != ContinuumProjectState.CANCELLED )
             {
                 buildResult.setBuildDefinition( buildDefinition );
                 buildResult.setBuildNumber( buildNumber );
-                buildResult.setModifiedDependencies( distributedBuildUtil.getModifiedDependencies( oldBuildResult, context ) );
+                buildResult.setModifiedDependencies( distributedBuildUtil.getModifiedDependencies( oldBuildResult,
+                                                                                                   context ) );
                 buildResult.setScmResult( distributedBuildUtil.getScmResult( context ) );
-    
+
                 Date date = ContinuumBuildConstant.getLatestUpdateDate( context );
                 if ( date != null )
                 {
@@ -143,7 +144,7 @@ public class DefaultDistributedBuildServ
                 {
                     buildResult.setLastChangedDate( oldBuildResult.getLastChangedDate() );
                 }
-    
+
                 buildResultDao.addBuildResult( project, buildResult );
 
                 buildResult = buildResultDao.getBuildResult( buildResult.getId() );
@@ -158,17 +159,18 @@ public class DefaultDistributedBuildServ
                 project.setState( project.getOldState() );
                 project.setOldState( 0 );
             }
-    
+
             projectDao.updateProject( project );
-    
+
             File buildOutputFile = configurationService.getBuildOutputFile( buildResult.getId(), project.getId() );
-    
+
             FileWriter fstream = new FileWriter( buildOutputFile );
             BufferedWriter out = new BufferedWriter( fstream );
-            out.write( ContinuumBuildConstant.getBuildOutput( context ) == null ? ""
-                : ContinuumBuildConstant.getBuildOutput( context ) );
+            out.write( ContinuumBuildConstant.getBuildOutput( context ) == null
+                           ? ""
+                           : ContinuumBuildConstant.getBuildOutput( context ) );
             out.close();
-    
+
             if ( buildResult.getState() != ContinuumProjectState.CANCELLED )
             {
                 notifierDispatcher.buildComplete( project, buildDefinition, buildResult );
@@ -189,20 +191,20 @@ public class DefaultDistributedBuildServ
             throw new ContinuumException( "Error while writing build output to file", e );
         }
     }
-    
+
     public void prepareBuildFinished( Map<String, Object> context )
         throws ContinuumException
     {
         int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
         String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
-    
+
         try
         {
-            ProjectScmRoot scmRoot =
-                projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId, scmRootAddress );
-    
+            ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId,
+                                                                                                         scmRootAddress );
+
             String error = ContinuumBuildConstant.getScmError( context );
-    
+
             if ( StringUtils.isEmpty( error ) )
             {
                 scmRoot.setState( ContinuumProjectState.UPDATED );
@@ -212,9 +214,9 @@ public class DefaultDistributedBuildServ
                 scmRoot.setState( ContinuumProjectState.ERROR );
                 scmRoot.setError( error );
             }
-    
+
             projectScmRootDao.updateProjectScmRoot( scmRoot );
-    
+
             notifierDispatcher.prepareBuildComplete( scmRoot );
         }
         catch ( ContinuumStoreException e )
@@ -222,7 +224,7 @@ public class DefaultDistributedBuildServ
             throw new ContinuumException( "Error while updating project scm root '" + scmRootAddress + "'", e );
         }
     }
-    
+
     public void startProjectBuild( int projectId )
         throws ContinuumException
     {
@@ -239,18 +241,18 @@ public class DefaultDistributedBuildServ
             throw new ContinuumException( "Error while updating project's state (projectId=" + projectId + ")", e );
         }
     }
-    
+
     public void startPrepareBuild( Map<String, Object> context )
         throws ContinuumException
     {
         int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
-    	
+
         try
         {
             String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
-    
-            ProjectScmRoot scmRoot =
-                projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId, scmRootAddress );
+
+            ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroupId,
+                                                                                                         scmRootAddress );
             scmRoot.setOldState( scmRoot.getState() );
             scmRoot.setState( ContinuumProjectState.UPDATING );
             projectScmRootDao.updateProjectScmRoot( scmRoot );
@@ -258,15 +260,16 @@ public class DefaultDistributedBuildServ
         catch ( ContinuumStoreException e )
         {
             log.error( "Error while updating project group'" + projectGroupId + "' scm root's state", e );
-            throw new ContinuumException( "Error while updating project group'" + projectGroupId + "' scm root's state", e );
+            throw new ContinuumException( "Error while updating project group'" + projectGroupId + "' scm root's state",
+                                          e );
         }
     }
-    
+
     public Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
         throws ContinuumException
     {
         BuildDefinition buildDefinition;
-    
+
         try
         {
             buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
@@ -275,7 +278,7 @@ public class DefaultDistributedBuildServ
         {
             throw new ContinuumException( "Failed to retrieve build definition: " + buildDefinitionId, e );
         }
-    
+
         Profile profile = buildDefinition.getProfile();
         if ( profile == null )
         {
@@ -295,14 +298,14 @@ public class DefaultDistributedBuildServ
         envVars.putAll( getEnvironmentVariables( buildDefinition ) );
         return envVars;
     }
-    
+
     public void updateProject( Map<String, Object> context )
         throws ContinuumException
     {
         try
         {
             Project project = projectDao.getProjectWithAllDetails( ContinuumBuildConstant.getProjectId( context ) );
-    
+
             if ( StringUtils.isNotBlank( ContinuumBuildConstant.getGroupId( context ) ) )
             {
                 project.setGroupId( ContinuumBuildConstant.getGroupId( context ) );
@@ -380,37 +383,39 @@ public class DefaultDistributedBuildServ
             {
                 project.addNotifier( userNotifier );
             }
-    
+
             projectDao.updateProject( project );
         }
         catch ( ContinuumStoreException e )
         {
-            throw new ContinuumException( "Unable to update project '" + ContinuumBuildConstant.getProjectId( context ) +
-        	                              "' from working copy", e );
+            throw new ContinuumException( "Unable to update project '" + ContinuumBuildConstant.getProjectId(
+                context ) +
+                                              "' from working copy", e );
         }
     }
 
     public boolean shouldBuild( Map<String, Object> context )
     {
         int projectId = ContinuumBuildConstant.getProjectId( context );
-        
+
         try
         {
             int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( context );
-    
+
             int trigger = ContinuumBuildConstant.getTrigger( context );
-    
+
             Project project = projectDao.getProjectWithAllDetails( projectId );
-    
+
             BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
-    
-            BuildResult oldBuildResult =
-                buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
-    
-            List<ProjectDependency> modifiedDependencies = distributedBuildUtil.getModifiedDependencies( oldBuildResult, context );
-    
+
+            BuildResult oldBuildResult = buildResultDao.getLatestBuildResultForBuildDefinition( projectId,
+                                                                                                buildDefinitionId );
+
+            List<ProjectDependency> modifiedDependencies = distributedBuildUtil.getModifiedDependencies( oldBuildResult,
+                                                                                                         context );
+
             List<ChangeSet> changes = distributedBuildUtil.getScmChanges( context );
-    
+
             if ( buildDefinition.isAlwaysBuild() )
             {
                 log.info( "AlwaysBuild configured, building (projectId=" + projectId + ")" );
@@ -418,10 +423,11 @@ public class DefaultDistributedBuildServ
             }
             if ( oldBuildResult == null )
             {
-                log.info( "The project '" +  projectId + "' was never built with the current build definition, building" );
+                log.info(
+                    "The project '" + projectId + "' was never built with the current build definition, building" );
                 return true;
             }
-    
+
             //CONTINUUM-1428
             if ( project.getOldState() == ContinuumProjectState.ERROR ||
                 oldBuildResult.getState() == ContinuumProjectState.ERROR )
@@ -429,13 +435,13 @@ public class DefaultDistributedBuildServ
                 log.info( "Latest state was 'ERROR', building (projectId=" + projectId + ")" );
                 return true;
             }
-    
+
             if ( trigger == ContinuumProjectState.TRIGGER_FORCED )
             {
                 log.info( "The project '" + projectId + "' build is forced, building" );
                 return true;
             }
-    
+
             Date date = ContinuumBuildConstant.getLatestUpdateDate( context );
             if ( date != null && oldBuildResult.getLastChangedDate() >= date.getTime() )
             {
@@ -448,11 +454,11 @@ public class DefaultDistributedBuildServ
                 log.info( "Changes found in the current project, building (projectId=" + projectId + ")" );
                 return true;
             }
-    
+
             boolean shouldBuild = false;
-    
+
             boolean allChangesUnknown = true;
-    
+
             if ( project.getOldState() != ContinuumProjectState.NEW &&
                 project.getOldState() != ContinuumProjectState.CHECKEDOUT &&
                 project.getState() != ContinuumProjectState.NEW &&
@@ -460,21 +466,21 @@ public class DefaultDistributedBuildServ
             {
                 // Check SCM changes
                 allChangesUnknown = checkAllChangesUnknown( changes );
-    
+
                 if ( allChangesUnknown )
                 {
                     if ( !changes.isEmpty() )
                     {
                         log.info( "The project '" + projectId +
-                            "' was not built because all changes are unknown (maybe local modifications or ignored files not defined in your SCM tool." );
+                                      "' was not built because all changes are unknown (maybe local modifications or ignored files not defined in your SCM tool." );
                     }
                     else
                     {
                         log.info( "The project '" + projectId +
-                            "' was not built because no changes were detected in sources since the last build." );
+                                      "' was not built because no changes were detected in sources since the last build." );
                     }
                 }
-    
+
                 // Check dependencies changes
                 if ( modifiedDependencies != null && !modifiedDependencies.isEmpty() )
                 {
@@ -482,15 +488,15 @@ public class DefaultDistributedBuildServ
                     shouldBuild = true;
                 }
             }
-    
+
             // Check changes
-            if ( !shouldBuild && ( ( !allChangesUnknown && !changes.isEmpty() ) ||
-                project.getExecutorId().equals( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR ) ) )
+            if ( !shouldBuild && ( ( !allChangesUnknown && !changes.isEmpty() ) || project.getExecutorId().equals(
+                ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR ) ) )
             {
                 shouldBuild = shouldBuild( changes, buildDefinition, project, getMavenProjectVersion( context ),
                                            getMavenProjectModules( context ) );
             }
-    
+
             if ( shouldBuild )
             {
                 log.info( "Changes found in the current project, building (projectId=" + projectId + ")" );
@@ -499,7 +505,7 @@ public class DefaultDistributedBuildServ
             {
                 log.info( "No changes in the current project, not building (projectId=" + projectId + ")" );
             }
-    
+
             return shouldBuild;
         }
         catch ( ContinuumStoreException e )
@@ -510,10 +516,10 @@ public class DefaultDistributedBuildServ
         {
             log.error( "Failed to determine if project '" + projectId + "' should build", e );
         }
-    
+
         return false;
     }
-    
+
     private boolean shouldBuild( List<ChangeSet> changes, BuildDefinition buildDefinition, Project project,
                                  String mavenProjectVersion, List<String> mavenProjectModules )
     {
@@ -521,10 +527,10 @@ public class DefaultDistributedBuildServ
         boolean isRecursive = false;
         if ( StringUtils.isNotEmpty( buildDefinition.getArguments() ) )
         {
-            isRecursive = buildDefinition.getArguments().indexOf( "-N" ) < 0 &&
-                buildDefinition.getArguments().indexOf( "--non-recursive" ) < 0;
+            isRecursive = buildDefinition.getArguments().indexOf( "-N" ) < 0 && buildDefinition.getArguments().indexOf(
+                "--non-recursive" ) < 0;
         }
-    
+
         if ( isRecursive && changes != null && !changes.isEmpty() )
         {
             if ( log.isInfoEnabled() )
@@ -533,14 +539,14 @@ public class DefaultDistributedBuildServ
             }
             return true;
         }
-    
+
         if ( !project.getVersion().equals( mavenProjectVersion ) )
         {
             log.info( "Found changes in project's version ( maybe project '" + project.getId() +
-            		  "' was recently released ), building" );
+                          "' was recently released ), building" );
             return true;
         }
-    
+
         if ( changes == null || changes.isEmpty() )
         {
             if ( log.isInfoEnabled() )
@@ -549,14 +555,14 @@ public class DefaultDistributedBuildServ
             }
             return false;
         }
-    
+
         //check if changes are only in sub-modules or not
         List<ChangeFile> files = new ArrayList<ChangeFile>();
         for ( ChangeSet changeSet : changes )
         {
             files.addAll( changeSet.getFiles() );
         }
-    
+
         int i = 0;
         while ( i <= files.size() - 1 )
         {
@@ -592,28 +598,28 @@ public class DefaultDistributedBuildServ
                 i++;
             }
         }
-    
+
         boolean shouldBuild = !files.isEmpty();
-    
+
         if ( !shouldBuild )
         {
             log.info( "Changes are only in sub-modules (projectId=" + project.getId() + ")." );
         }
-    
+
         if ( log.isDebugEnabled() )
         {
             log.debug( "shoulbuild = " + shouldBuild );
         }
-    
+
         return shouldBuild;
     }
-    
+
     private boolean checkAllChangesUnknown( List<ChangeSet> changes )
     {
         for ( ChangeSet changeSet : changes )
         {
             List<ChangeFile> changeFiles = changeSet.getFiles();
-    
+
             for ( ChangeFile changeFile : changeFiles )
             {
                 if ( !"unknown".equalsIgnoreCase( changeFile.getStatus() ) )
@@ -622,10 +628,10 @@ public class DefaultDistributedBuildServ
                 }
             }
         }
-    
+
         return true;
     }
-    
+
 
     private String getJavaHomeValue( BuildDefinition buildDefinition )
     {
@@ -641,7 +647,7 @@ public class DefaultDistributedBuildServ
         }
         return jdk.getVarValue();
     }
-    
+
     private Map<String, String> getEnvironmentVariables( BuildDefinition buildDefinition )
     {
         Profile profile = buildDefinition.getProfile();
@@ -665,26 +671,26 @@ public class DefaultDistributedBuildServ
     private ProjectDependency getProjectParent( Map<String, Object> context )
     {
         Map<String, Object> map = ContinuumBuildConstant.getProjectParent( context );
-    
+
         if ( map != null && map.size() > 0 )
         {
             ProjectDependency parent = new ProjectDependency();
             parent.setGroupId( ContinuumBuildConstant.getGroupId( map ) );
             parent.setArtifactId( ContinuumBuildConstant.getArtifactId( map ) );
             parent.setVersion( ContinuumBuildConstant.getVersion( map ) );
-    
+
             return parent;
         }
-    
+
         return null;
     }
-    
+
     private List<ProjectDependency> getProjectDependencies( Map<String, Object> context )
     {
         List<ProjectDependency> projectDependencies = new ArrayList<ProjectDependency>();
-    
+
         List<Map<String, Object>> dependencies = ContinuumBuildConstant.getProjectDependencies( context );
-    
+
         if ( dependencies != null )
         {
             for ( Map<String, Object> map : dependencies )
@@ -693,19 +699,19 @@ public class DefaultDistributedBuildServ
                 dependency.setGroupId( ContinuumBuildConstant.getGroupId( map ) );
                 dependency.setArtifactId( ContinuumBuildConstant.getArtifactId( map ) );
                 dependency.setVersion( ContinuumBuildConstant.getVersion( map ) );
-    
+
                 projectDependencies.add( dependency );
             }
         }
         return projectDependencies;
     }
-    
+
     private List<ProjectDeveloper> getProjectDevelopers( Map<String, Object> context )
     {
         List<ProjectDeveloper> projectDevelopers = new ArrayList<ProjectDeveloper>();
-    
+
         List<Map<String, Object>> developers = ContinuumBuildConstant.getProjectDevelopers( context );
-    
+
         if ( developers != null )
         {
             for ( Map<String, Object> map : developers )
@@ -714,19 +720,19 @@ public class DefaultDistributedBuildServ
                 developer.setName( ContinuumBuildConstant.getDeveloperName( map ) );
                 developer.setEmail( ContinuumBuildConstant.getDeveloperEmail( map ) );
                 developer.setScmId( ContinuumBuildConstant.getDeveloperScmId( map ) );
-    
+
                 projectDevelopers.add( developer );
             }
         }
         return projectDevelopers;
     }
-    
+
     private List<ProjectNotifier> getProjectNotifiers( Map<String, Object> context )
     {
         List<ProjectNotifier> projectNotifiers = new ArrayList<ProjectNotifier>();
-    
+
         List<Map<String, Object>> notifiers = ContinuumBuildConstant.getProjectNotifiers( context );
-    
+
         if ( notifiers != null )
         {
             for ( Map<String, Object> map : notifiers )
@@ -742,7 +748,7 @@ public class DefaultDistributedBuildServ
                 notifier.setSendOnSuccess( ContinuumBuildConstant.isNotifierSendOnSuccess( map ) );
                 notifier.setSendOnWarning( ContinuumBuildConstant.isNotifierSendOnWarning( map ) );
                 notifier.setType( ContinuumBuildConstant.getNotifierType( map ) );
-    
+
                 projectNotifiers.add( notifier );
             }
         }
@@ -752,24 +758,24 @@ public class DefaultDistributedBuildServ
     private String getMavenProjectVersion( Map<String, Object> context )
     {
         Map<String, Object> map = ContinuumBuildConstant.getMavenProject( context );
-    
+
         if ( !map.isEmpty() )
         {
             return ContinuumBuildConstant.getVersion( map );
         }
-    
+
         return null;
     }
-    
+
     private List<String> getMavenProjectModules( Map<String, Object> context )
     {
         Map<String, Object> map = ContinuumBuildConstant.getMavenProject( context );
-    
+
         if ( !map.isEmpty() )
         {
             return ContinuumBuildConstant.getProjectModules( map );
         }
-    
+
         return null;
     }
 }



Mime
View raw message