continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r941625 [4/24] - in /continuum/branches/continuum-flat-multi-module: ./ continuum-api/ continuum-api/src/main/java/org/apache/continuum/builder/distributed/ continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/ conti...
Date Thu, 06 May 2010 09:23:34 GMT
Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java Thu May  6 09:23:13 2010
@@ -35,6 +35,7 @@ import org.apache.continuum.buildagent.b
 import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
 import org.apache.continuum.buildagent.installation.BuildAgentInstallationService;
 import org.apache.continuum.buildagent.manager.BuildAgentManager;
+import org.apache.continuum.buildagent.model.LocalRepository;
 import org.apache.continuum.buildagent.utils.BuildContextToBuildDefinition;
 import org.apache.continuum.buildagent.utils.BuildContextToProject;
 import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
@@ -103,7 +104,7 @@ public class BuildProjectTaskExecutor
 
         int projectId = buildProjectTask.getProjectId();
 
-        log.info( "Initializing build" );
+        log.info( "Initializing build (projectId=" + projectId + ")" );
         BuildContext context = buildContextManager.getBuildContext( projectId );
         initializeBuildContext( context );
 
@@ -164,10 +165,25 @@ public class BuildProjectTaskExecutor
                            BuildContextToBuildDefinition.getBuildDefinition( buildContext ) );
         actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_ENVIRONMENTS,
                            getEnvironments( buildContext.getBuildDefinitionId(),
                                             getInstallationType( buildContext ) ) );
-        actionContext.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY, buildContext.getLocalRepository() );
+        
+        // CONTINUUM-2391        
+        if( buildContext.getLocalRepository() != null )
+        {
+            List<LocalRepository> localRepos = buildAgentConfigurationService.getLocalRepositories();        
+            for( LocalRepository local : localRepos )
+            {
+                if( local.getName().equalsIgnoreCase( buildContext.getLocalRepository() ) )
+                {
+                    actionContext.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY, local.getLocation() );
+                    break;
+                }
+            }
+        }        
+        
         actionContext.put( ContinuumBuildAgentUtil.KEY_SCM_RESULT, buildContext.getScmResult() );
         buildContext.setActionContext( actionContext );
 
@@ -205,6 +221,7 @@ public class BuildProjectTaskExecutor
         result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, buildContext.getProjectId() );
         result.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
         result.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+        result.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
         result.put( ContinuumBuildAgentUtil.KEY_BUILD_STATE, buildResult.getState() );
         result.put( ContinuumBuildAgentUtil.KEY_START_TIME, Long.toString( buildResult.getStartTime() ) );
         result.put( ContinuumBuildAgentUtil.KEY_END_TIME, Long.toString( buildResult.getEndTime() ) );
@@ -239,6 +256,7 @@ public class BuildProjectTaskExecutor
         try
         {
             buildAgentManager.returnBuildResult( result );
+            buildContextManager.removeBuildContext( buildContext.getProjectId() );
         }
         catch ( ContinuumException e )
         {
@@ -299,6 +317,8 @@ public class BuildProjectTaskExecutor
             build.setState( ContinuumProjectState.ERROR );
 
             build.setTrigger( context.getTrigger() );
+            
+            build.setUsername( context.getUsername() );
 
             build.setStartTime( context.getBuildStartTime() );
 
@@ -400,6 +420,7 @@ public class BuildProjectTaskExecutor
         map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, context.getProjectId() );
         map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, context.getBuildDefinitionId() );
         map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, context.getTrigger() );
+        map.put( ContinuumBuildAgentUtil.KEY_USERNAME, context.getUsername() );
         map.put( ContinuumBuildAgentUtil.KEY_SCM_CHANGES, getScmChanges( context.getScmResult() ) );
         map.put( ContinuumBuildAgentUtil.KEY_MAVEN_PROJECT, getMavenProject( context ) );
         if ( context.getLatestUpdateDate() != null )
@@ -531,4 +552,29 @@ public class BuildProjectTaskExecutor
 
         return mavenProject;
     }
+    
+    public void setBuildContextManager( BuildContextManager buildContextManager )
+    {
+        this.buildContextManager = buildContextManager;
+    }
+
+    public void setActionManager( ActionManager actionManager )
+    {
+        this.actionManager = actionManager;
+    }
+
+    public void setBuildAgentConfigurationService( BuildAgentConfigurationService buildAgentConfigurationService )
+    {
+        this.buildAgentConfigurationService = buildAgentConfigurationService;
+    }
+
+    public void setBuildAgentManager( BuildAgentManager buildAgentManager )
+    {
+        this.buildAgentManager = buildAgentManager;
+    }
+
+    public void setBuildAgentBuildExecutorManager( BuildAgentBuildExecutorManager buildAgentBuildExecutorManager )
+    {
+        this.buildAgentBuildExecutorManager = buildAgentBuildExecutorManager;
+    }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java Thu May  6 09:23:13 2010
@@ -31,6 +31,7 @@ import org.apache.continuum.buildagent.t
 import org.apache.continuum.buildagent.utils.BuildContextToBuildDefinition;
 import org.apache.continuum.buildagent.utils.BuildContextToProject;
 import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
@@ -174,6 +175,8 @@ public class PrepareBuildProjectsTaskExe
         actionContext.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, buildContext.getScmRootAddress() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_OLD_SCM_RESULT, buildContext.getOldScmResult() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, buildContext.getLatestUpdateDate() );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
 
         buildContext.setActionContext( actionContext );
     }

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java Thu May  6 09:23:13 2010
@@ -19,7 +19,12 @@ package org.apache.continuum.buildagent.
  * under the License.
  */
 
+import java.util.List;
+
+import org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask;
+import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 
 public interface BuildAgentTaskQueueManager
@@ -33,15 +38,39 @@ public interface BuildAgentTaskQueueMana
     void cancelBuild()
         throws TaskQueueManagerException;
 
-    int getCurrentProjectInBuilding()
+    int getIdOfProjectCurrentlyBuilding()
+        throws TaskQueueManagerException;
+
+    BuildProjectTask getCurrentProjectInBuilding()
         throws TaskQueueManagerException;
 
+    PrepareBuildProjectsTask getCurrentProjectInPrepareBuild()
+        throws TaskQueueManagerException;
+    
     boolean hasBuildTaskInQueue()
         throws TaskQueueManagerException;
 
     boolean isProjectInBuildQueue( int projectId )
         throws TaskQueueManagerException;
 
-    boolean isInPrepareBuildQueue( int projectGroupId, int trigger, String scmRootAddress )
+    boolean isInPrepareBuildQueue( int projectGroupId, BuildTrigger trigger, String scmRootAddress )
+        throws TaskQueueManagerException;
+
+    List<PrepareBuildProjectsTask> getProjectsInPrepareBuildQueue()
+        throws TaskQueueManagerException;
+
+    List<BuildProjectTask> getProjectsInBuildQueue()
+        throws TaskQueueManagerException;
+
+    boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws TaskQueueManagerException;
+
+    void removeFromPrepareBuildQueue( int[] hashCodes )
+        throws TaskQueueManagerException;
+
+    boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+        throws TaskQueueManagerException;
+
+    void removeFromBuildQueue( int[] hashCodes )
         throws TaskQueueManagerException;
 }

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May  6 09:23:13 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/TaskQueueManager.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java:760767-900271,915354,915760,915848-915864,916073-916074
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/TaskQueueManager.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java Thu May  6 09:23:13 2010
@@ -21,9 +21,11 @@ package org.apache.continuum.buildagent.
 
 import java.util.List;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -60,8 +62,24 @@ public class DefaultBuildAgentTaskQueueM
     public void cancelBuild()
         throws TaskQueueManagerException
     {
-        removeProjectsFromBuildQueue();
-        cancelCurrentBuild();
+        Task task = getBuildTaskQueueExecutor().getCurrentTask();
+
+        if ( task != null )
+        {
+            if ( task instanceof BuildProjectTask )
+            {
+                log.info( "Cancelling current build task of project " + ( (BuildProjectTask) task ).getProjectId() );
+                getBuildTaskQueueExecutor().cancelTask( task );
+            }
+            else
+            {
+                log.warn( "Current task not a BuildProjectTask - not cancelling" );
+            }
+        }
+        else
+        {
+            log.warn( "No task running - not cancelling" );
+        }
     }
 
     public TaskQueue getBuildQueue()
@@ -69,7 +87,7 @@ public class DefaultBuildAgentTaskQueueM
         return buildAgentBuildQueue;
     }
 
-    public int getCurrentProjectInBuilding()
+    public int getIdOfProjectCurrentlyBuilding()
         throws TaskQueueManagerException
     {
         Task task = getBuildTaskQueueExecutor().getCurrentTask();
@@ -99,8 +117,11 @@ public class DefaultBuildAgentTaskQueueM
             {
                 for ( BuildProjectTask task : queues )
                 {
-                    log.info( "remove project '" + task.getProjectName() + "' from build queue" );
-                    buildAgentBuildQueue.remove( task );
+                    if ( task != null )
+                    {
+                        log.info( "remove project '" + task.getProjectName() + "' from build queue" );
+                        buildAgentBuildQueue.remove( task );
+                    }
                 }
             }
             else
@@ -114,36 +135,25 @@ public class DefaultBuildAgentTaskQueueM
         }
     }
 
-    private boolean cancelCurrentBuild()
+    public TaskQueueExecutor getBuildTaskQueueExecutor()
         throws TaskQueueManagerException
     {
-        Task task = getBuildTaskQueueExecutor().getCurrentTask();
-
-        if ( task != null )
+        try
         {
-            if ( task instanceof BuildProjectTask )
-            {
-                log.info( "Cancelling current build task" );
-                return getBuildTaskQueueExecutor().cancelTask( task );
-            }
-            else
-            {
-                log.warn( "Current task not a BuildProjectTask - not cancelling" );
-            }
+            return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, "build-agent" );
         }
-        else
+        catch ( ComponentLookupException e )
         {
-            log.warn( "No task running - not cancelling" );
+            throw new TaskQueueManagerException( e.getMessage(), e );
         }
-        return false;
     }
 
-    public TaskQueueExecutor getBuildTaskQueueExecutor()
+    public TaskQueueExecutor getPrepareBuildTaskQueueExecutor()
         throws TaskQueueManagerException
     {
         try
         {
-            return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, "build-agent" );
+            return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, "prepare-build-agent" );
         }
         catch ( ComponentLookupException e )
         {
@@ -179,7 +189,7 @@ public class DefaultBuildAgentTaskQueueM
             {
                 for ( BuildProjectTask task : queues )
                 {
-                    if ( task.getProjectId() == projectId )
+                    if ( task != null && task.getProjectId() == projectId )
                     {
                         log.info( "project already in build queue" );
                         return true;
@@ -199,7 +209,7 @@ public class DefaultBuildAgentTaskQueueM
         return false;
     }
 
-    public boolean isInPrepareBuildQueue( int projectGroupId, int trigger, String scmRootAddress )
+    public boolean isInPrepareBuildQueue( int projectGroupId, BuildTrigger buildTrigger, String scmRootAddress )
         throws TaskQueueManagerException
     {
         try
@@ -210,8 +220,9 @@ public class DefaultBuildAgentTaskQueueM
             {
                 for ( PrepareBuildProjectsTask task : queues )
                 {
-                    if ( task.getProjectGroupId() == projectGroupId && task.getTrigger() == trigger &&
-                        task.getScmRootAddress().equals( scmRootAddress ) )
+                	if ( task != null && task.getProjectGroupId() == projectGroupId && 
+                             task.getBuildTrigger().getTrigger() == buildTrigger.getTrigger() &&
+                             task.getScmRootAddress().equals( scmRootAddress ) )
                     {
                         log.info( "projects already in build queue" );
                         return true;
@@ -231,9 +242,135 @@ public class DefaultBuildAgentTaskQueueM
         return false;
     }
 
+    public List<PrepareBuildProjectsTask> getProjectsInPrepareBuildQueue()
+        throws TaskQueueManagerException
+    {
+        try
+        {
+            return buildAgentPrepareBuildQueue.getQueueSnapshot();
+        }
+        catch ( TaskQueueException e )
+        {
+            log.error( "Error occurred while retrieving projects in prepare build queue", e );
+            throw new TaskQueueManagerException( "Error occurred while retrieving projects in prepare build queue", e );
+        }
+    }
+
+    public List<BuildProjectTask> getProjectsInBuildQueue()
+        throws TaskQueueManagerException
+    {
+        try
+        {
+            return buildAgentBuildQueue.getQueueSnapshot();
+        }
+        catch ( TaskQueueException e )
+        {
+            log.error( "Error occurred while retrieving projects in build queue", e );
+            throw new TaskQueueManagerException( "Error occurred while retrieving projects in build queue", e );
+        }
+    }
+
+    public PrepareBuildProjectsTask getCurrentProjectInPrepareBuild()
+        throws TaskQueueManagerException
+    {
+        Task task = getPrepareBuildTaskQueueExecutor().getCurrentTask();
+
+        if ( task != null )
+        {
+            return (PrepareBuildProjectsTask) task;
+        }
+        return null;
+    }
+
+    public BuildProjectTask getCurrentProjectInBuilding()
+        throws TaskQueueManagerException
+    {
+        Task task = getBuildTaskQueueExecutor().getCurrentTask();
+
+        if ( task != null )
+        {
+            return (BuildProjectTask) task;
+        }
+
+        return null;
+    }
+
+    public boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws TaskQueueManagerException
+    {
+        List<PrepareBuildProjectsTask> tasks = getProjectsInPrepareBuildQueue();
+
+        if ( tasks != null )
+        {
+            for ( PrepareBuildProjectsTask task : tasks )
+            {
+                if ( task != null && task.getProjectGroupId() == projectGroupId && task.getScmRootId() == scmRootId )
+                {
+                    return getPrepareBuildQueue().remove( task );
+                }
+            }
+        }
+
+        return false;
+    }
+
+    public void removeFromPrepareBuildQueue( int[] hashCodes )
+        throws TaskQueueManagerException
+    {
+        List<PrepareBuildProjectsTask> tasks = getProjectsInPrepareBuildQueue();
+
+        if ( tasks != null )
+        {
+            for ( PrepareBuildProjectsTask task : tasks )
+            {
+                if ( task != null && ArrayUtils.contains( hashCodes, task.getHashCode() ) )
+                {
+                    getPrepareBuildQueue().remove( task );
+                }
+            }
+        }
+    }
+
+    public boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+        throws TaskQueueManagerException
+    {
+        List<BuildProjectTask> tasks = getProjectsInBuildQueue();
+
+        if ( tasks != null )
+        {
+            for ( BuildProjectTask task : tasks )
+            {
+                if ( task != null && task.getProjectId() == projectId && task.getBuildDefinitionId() == buildDefinitionId )
+                {
+                    return getBuildQueue().remove( task );
+                }
+            }
+        }
+
+        return false;
+    }
+
+    public void removeFromBuildQueue( int[] hashCodes )
+        throws TaskQueueManagerException
+    {
+        List<BuildProjectTask> tasks = getProjectsInBuildQueue();
+
+        if ( tasks != null )
+        {
+            for ( BuildProjectTask task : tasks )
+            {
+                if ( task != null && ArrayUtils.contains( hashCodes, task.getHashCode() ) )
+                {
+                    getBuildQueue().remove( task );
+                }
+            }
+        }
+    }
+
     public void contextualize( Context context )
         throws ContextException
     {
         container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
     }
+
 }

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May  6 09:23:13 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultTaskQueueManager.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java:760767-900271,915354,915760,915848-915864,916073-916074
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultTaskQueueManager.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java Thu May  6 09:23:13 2010
@@ -43,6 +43,8 @@ public class BuildContextToProject
 
         project.setScmPassword( buildContext.getScmPassword() );
 
+        project.setScmTag( buildContext.getScmTag() );
+
         project.setExecutorId( buildContext.getExecutorId() );
 
         project.setState( buildContext.getProjectState() );

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java Thu May  6 09:23:13 2010
@@ -30,6 +30,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.continuum.buildagent.buildcontext.BuildContext;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -51,7 +52,11 @@ public class ContinuumBuildAgentUtil
 
     public static final String KEY_BUILD_DEFINITION_ID = "builddefinition-id";
 
+    public static final String KEY_BUILD_DEFINITION_LABEL = "builddefinition-label";
+
     public static final String KEY_TRIGGER = "trigger";
+    
+    public static final String KEY_USERNAME = "username";
 
     public static final String KEY_EXECUTOR_ID = "executor-id";
 
@@ -95,6 +100,8 @@ public class ContinuumBuildAgentUtil
 
     public static final String KEY_SCM_ROOT_ADDRESS = "scm-root-address";
 
+    public static final String KEY_SCM_ROOT_ID = "scm-root-id";
+
     public static final String KEY_SCM_ROOT_STATE = "scm-root-state";
 
     public static final String KEY_CHECKOUT_SCM_RESULT = "checkout-scm-result";
@@ -351,6 +358,16 @@ public class ContinuumBuildAgentUtil
     {
         return getInteger( context, KEY_TRIGGER );
     }
+    
+    public static String getUsername( Map<String, Object> context )
+    {
+         return getString( context, KEY_USERNAME, "" );
+    }
+    
+    public static BuildTrigger getBuildTrigger( Map<String, Object> context )
+    {
+         return new BuildTrigger( getTrigger( context ), getUsername( context ) );
+    }
 
     public static BuildResult getBuildResult( Map<String, Object> context, Object defaultValue )
     {
@@ -526,6 +543,16 @@ public class ContinuumBuildAgentUtil
         return getString( context, KEY_LOCAL_REPOSITORY_LAYOUT, "" );
     }
 
+    public static int getScmRootId( Map<String, Object> context )
+    {
+        return getInteger( context, KEY_SCM_ROOT_ID );
+    }
+
+    public static String getBuildDefinitionLabel( Map<String, Object> context )
+    {
+        return getString( context, KEY_BUILD_DEFINITION_LABEL, "" );
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/WorkingCopyContentGenerator.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/WorkingCopyContentGenerator.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/WorkingCopyContentGenerator.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/WorkingCopyContentGenerator.java Thu May  6 09:23:13 2010
@@ -1,5 +1,24 @@
 package org.apache.continuum.buildagent.utils;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import java.io.File;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/spring-context.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/spring-context.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/resources/META-INF/spring-context.xml Thu May  6 09:23:13 2010
@@ -36,7 +36,7 @@
   
   <bean id="buildAgentConfiguration" class="org.apache.continuum.buildagent.configuration.DefaultBuildAgentConfiguration"
      init-method="initialize">
-    <property name="configurationFile" value="file:${CONTINUUM_BUILDAGENT_HOME}/conf/continuum-buildagent.xml" />
+    <property name="configurationFile" value="file:${appserver.base}/conf/continuum-buildagent.xml" />
   </bean>
 </beans>
 	
\ No newline at end of file

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-jetty/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu May  6 09:23:13 2010
@@ -4,3 +4,4 @@ target
 .project
 *.iml
 .settings
+build

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-jetty/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-jetty/pom.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-jetty/pom.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-jetty/pom.xml Thu May  6 09:23:13 2010
@@ -22,7 +22,7 @@ under the License.
   <parent>
     <artifactId>continuum-buildagent</artifactId>
     <groupId>org.apache.continuum</groupId>
-    <version>1.4.0-SNAPSHOT</version>
+    <version>1.4.1-SNAPSHOT</version>
   </parent>
   <artifactId>continuum-buildagent-jetty</artifactId>
   <packaging>pom</packaging>
@@ -49,12 +49,7 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.mortbay.jetty</groupId>
-      <artifactId>servlet-api-2.5</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.mortbay.jetty</groupId>
-      <artifactId>jsp-api-2.0</artifactId>
+      <artifactId>jsp-2.1-jetty</artifactId>
       <scope>runtime</scope>
     </dependency>    
     <dependency>
@@ -62,43 +57,6 @@ under the License.
       <artifactId>jetty-plus</artifactId>
       <scope>runtime</scope>
     </dependency>
-    <dependency>
-      <groupId>ant</groupId>
-      <artifactId>ant</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>commons-el</groupId>
-      <artifactId>commons-el</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>tomcat</groupId>
-      <artifactId>jasper-compiler</artifactId>
-      <scope>runtime</scope>
-    </dependency>    
-    <dependency>
-      <groupId>tomcat</groupId>
-      <artifactId>jasper-runtime</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>tomcat</groupId>
-      <artifactId>jasper-compiler-jdt</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>      
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>jcl-over-slf4j</artifactId>
-    </dependency>
   </dependencies>
   <build>
     <plugins>
@@ -112,7 +70,6 @@ under the License.
               <mainClass>org.mortbay.start.Main</mainClass>
               <commandLineArguments>
                 <commandLineArgument>conf/jetty.xml</commandLineArgument>
-                <commandLineArgument>conf/jetty-logging.xml</commandLineArgument> 
               </commandLineArguments>
               <platforms>
                 <platform>jsw</platform>
@@ -142,10 +99,6 @@ under the License.
                       <value>%CONTINUUM_BUILDAGENT_BASE%/conf/jetty.xml</value>
                     </property>
                     <property>
-                      <name>wrapper.app.parameter.3</name>
-                      <value>%CONTINUUM_BUILDAGENT_BASE%/conf/jetty-logging.xml</value>
-                    </property>
-                    <property>
                       <name>app.base.envvar</name>
                       <value>CONTINUUM_BUILDAGENT_BASE</value>
                     </property>
@@ -176,7 +129,7 @@ under the License.
               <jvmSettings>
                 <systemProperties>
                   <systemProperty>appserver.home=.</systemProperty>
-                  <systemProperty>CONTINUUM_BUILDAGENT_HOME=%CONTINUUM_BUILDAGENT_BASE%</systemProperty>
+                  <systemProperty>appserver.base=%CONTINUUM_BUILDAGENT_BASE%</systemProperty>
                   <systemProperty>jetty.logs=%CONTINUUM_BUILDAGENT_BASE%/logs</systemProperty>
                   <systemProperty>java.io.tmpdir=%CONTINUUM_BUILDAGENT_BASE%/tmp</systemProperty>
                 </systemProperties>
@@ -234,7 +187,4 @@ under the License.
       </plugin>
     </plugins>
   </build>
-  <properties>
-    <jetty.version>6.1.11</jetty.version>
-  </properties>
 </project>

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/continuum-buildagent.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/continuum-buildagent.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/continuum-buildagent.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-jetty/src/main/conf/continuum-buildagent.xml Thu May  6 09:23:13 2010
@@ -18,4 +18,8 @@ specific language governing permissions 
 under the License.
 -->
 
-<continuum-buildagent-configuration />
+<continuum-buildagent-configuration>
+  <continuumServerUrl>http://localhost:8080/continuum/master-xmlrpc</continuumServerUrl>
+  <buildOutputDirectory>data/build-output-directory</buildOutputDirectory>
+  <workingDirectory>data/working-directory</workingDirectory>
+</continuum-buildagent-configuration>

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/pom.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/pom.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/pom.xml Thu May  6 09:23:13 2010
@@ -21,7 +21,7 @@
   <parent>
     <artifactId>continuum-buildagent</artifactId>
     <groupId>org.apache.continuum</groupId>
-    <version>1.4.0-SNAPSHOT</version>
+    <version>1.4.1-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>continuum-buildagent-webapp</artifactId>
@@ -80,6 +80,51 @@
       <artifactId>atlassian-xmlrpc-binder-server-spring</artifactId>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-file</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-http-lightweight</artifactId>
+      <scope>runtime</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>xml-apis</groupId>
+          <artifactId>xml-apis</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-ssh</artifactId>
+      <scope>runtime</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-container-default</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>classworlds</groupId>
+          <artifactId>classworlds</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>plexus</groupId>
+          <artifactId>plexus-utils</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-ssh-external</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-webdav</artifactId>
+      <scope>runtime</scope>
+    </dependency>
   </dependencies>
   
   <build>
@@ -91,7 +136,7 @@
           <scanIntervalSeconds>10</scanIntervalSeconds>
           <contextPath>/</contextPath>
           <stopKey>stopkey</stopKey>
-          <stopPort>9192</stopPort>
+          <stopPort>9292</stopPort>
           <jettyEnvXml>${basedir}/src/jetty-env.xml</jettyEnvXml>
           <connectors>
             <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
@@ -101,12 +146,42 @@
           </connectors>
           <systemProperties>
             <systemProperty>
-              <name>CONTINUUM_BUILDAGENT_HOME</name>
+              <name>appserver.base</name>
               <value>${project.build.directory}/appserver-base</value>
             </systemProperty>
           </systemProperties>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>tomcat-maven-plugin</artifactId>
+        <configuration>
+          <path>/continuum-buildagent</path>
+          <port>9191</port>
+          <contextFile>${basedir}/src/test/tomcat/tomcat-context-continuum.xml</contextFile>
+          <systemProperties>
+            <appserver.base>${project.build.directory}/appserver-base</appserver.base>
+          </systemProperties>          
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <tasks>
+                <copy todir="${project.build.directory}/appserver-base">
+                  <fileset dir="src/appserver-base" />
+                </copy>
+              </tasks>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 </project>

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java Thu May  6 09:23:13 2010
@@ -1,5 +1,24 @@
 package org.apache.continuum.web.startup;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 
@@ -21,7 +40,6 @@ public class BuildAgentStartup
     public void contextDestroyed( ServletContextEvent sce )
     {
         // nothing to do here
-
     }
 
     /**

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml Thu May  6 09:23:13 2010
@@ -3,7 +3,7 @@
 
 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
   <appender name="rolling" class="org.apache.log4j.DailyRollingFileAppender">
-    <param name="file" value="${CONTINUUM_BUILDAGENT_HOME}/logs/continuum-buildagent.log" />
+    <param name="file" value="${appserver.base}/logs/continuum-buildagent.log" />
     <param name="append" value="true" />
     <param name="datePattern" value="'.'yyyy-MM-dd" />
     <layout class="org.apache.log4j.PatternLayout">
@@ -11,6 +11,7 @@
     </layout>
   </appender>
 
+<!--
   <logger name="org.apache.continuum.buildagent">
     <level value="info"/>
   </logger>
@@ -22,6 +23,7 @@
   <logger name="org.apache.continuum.distributed">
     <level value="info"/>
   </logger>
+-->
 
   <logger name="org.springframework">
     <level value="error"/>

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu May  6 09:23:13 2010
@@ -0,0 +1 @@
+lib

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml Thu May  6 09:23:13 2010
@@ -1,8 +1,27 @@
-<!DOCTYPE web-app PUBLIC
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd" >
+<?xml version="1.0"?>
 
-<web-app>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
   <display-name>Continuum Distributed Build Transport Tests</display-name>
   
   <context-param>

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp Thu May  6 09:23:13 2010
@@ -1,5 +1,20 @@
-<html>
-<body>
-<h2>Hello World!</h2>
-</body>
-</html>
+<%--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  --%>
+
+<% response.sendRedirect(  request.getContextPath() + "/xmlrpc" ); %>

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-buildagent/pom.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-buildagent/pom.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/pom.xml Thu May  6 09:23:13 2010
@@ -22,7 +22,7 @@ under the License.
   <parent>
     <groupId>org.apache.continuum</groupId>
     <artifactId>continuum</artifactId>
-    <version>1.4.0-SNAPSHOT</version>
+    <version>1.4.1-SNAPSHOT</version>
   </parent>
 
   <artifactId>continuum-buildagent</artifactId>
@@ -35,4 +35,34 @@ under the License.
     <module>continuum-buildagent-webapp</module>
     <module>continuum-buildagent-jetty</module>
   </modules>
+  
+  <profiles>
+    <profile>
+      <id>release</id>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <inherited>false</inherited>
+            <configuration>
+              <descriptors>
+                <descriptor>src/main/assembly/src.xml</descriptor>
+              </descriptors>
+              <tarLongFileMode>gnu</tarLongFileMode>
+              <finalName>continuum-buildagent-${version}-src</finalName>
+            </configuration>
+            <executions>
+              <execution>
+               <id>make-assembly</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>

Modified: continuum/branches/continuum-flat-multi-module/continuum-builder/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-builder/pom.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-builder/pom.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-builder/pom.xml Thu May  6 09:23:13 2010
@@ -23,7 +23,7 @@ under the License.
   <parent>
     <artifactId>continuum</artifactId>
     <groupId>org.apache.continuum</groupId>
-    <version>1.4.0-SNAPSHOT</version>
+    <version>1.4.1-SNAPSHOT</version>
   </parent>
   <artifactId>continuum-builder</artifactId>
   <name>Continuum :: Builder</name>
@@ -71,6 +71,10 @@ under the License.
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+    <dependency>
       <groupId>backport-util-concurrent</groupId>
       <artifactId>backport-util-concurrent</artifactId>
     </dependency>

Modified: continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java Thu May  6 09:23:13 2010
@@ -38,6 +38,7 @@ import org.apache.continuum.model.reposi
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
 import org.apache.continuum.utils.ContinuumUtils;
 import org.apache.continuum.utils.ProjectSorter;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -103,10 +104,11 @@ public class DistributedBuildProjectTask
         {
             SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
 
-            log.info( "initializing buildContext" );
+            log.info( "initializing buildContext for projectGroupId=" + prepareBuildTask.getProjectGroupId() );
             List<Map<String, Object>> buildContext =
                 initializeBuildContext( prepareBuildTask.getProjectsBuildDefinitionsMap(),
-                                        prepareBuildTask.getTrigger(), prepareBuildTask.getScmRootAddress() );
+                		                prepareBuildTask.getBuildTrigger(), prepareBuildTask.getScmRootAddress(),
+                                        prepareBuildTask.getProjectScmRootId() );
 
             startTime = System.currentTimeMillis();
             client.buildProjects( buildContext );
@@ -126,24 +128,25 @@ public class DistributedBuildProjectTask
     }
 
     private List<Map<String, Object>> initializeBuildContext( Map<Integer, Integer> projectsAndBuildDefinitions,
-                                                              int trigger, String scmRootAddress )
+    		                                     BuildTrigger buildTrigger, String scmRootAddress, int scmRootId )
         throws ContinuumException
     {
         List<Map<String, Object>> buildContext = new ArrayList<Map<String, Object>>();
-        List<Project> projects = new ArrayList<Project>();
 
         try
         {
-            for ( Integer projectId : projectsAndBuildDefinitions.keySet() )
-            {
-                Project project = projectDao.getProjectWithDependencies( projectId );
-                projects.add( project );
-            }
+            ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( scmRootId );
 
-            projects = ProjectSorter.getSortedProjects( projects, null );
+            List<Project> projects = projectDao.getProjectsWithDependenciesByGroupId( scmRoot.getProjectGroup().getId() );
+            List<Project> sortedProjects = ProjectSorter.getSortedProjects( projects, null );
 
-            for ( Project project : projects )
+            for ( Project project : sortedProjects )
             {
+                if ( !projectsAndBuildDefinitions.containsKey( project.getId() ) )
+                {
+                    continue;
+                }
+
                 int buildDefinitionId = projectsAndBuildDefinitions.get( project.getId() );
                 BuildDefinition buildDef = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
                 BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( project.getId() );
@@ -152,6 +155,7 @@ public class DistributedBuildProjectTask
 
                 context.put( ContinuumBuildConstant.KEY_PROJECT_GROUP_ID, project.getProjectGroup().getId() );
                 context.put( ContinuumBuildConstant.KEY_PROJECT_GROUP_NAME, project.getProjectGroup().getName() );
+                context.put( ContinuumBuildConstant.KEY_SCM_ROOT_ID, scmRootId );
                 context.put( ContinuumBuildConstant.KEY_SCM_ROOT_ADDRESS, scmRootAddress );
                 context.put( ContinuumBuildConstant.KEY_PROJECT_ID, project.getId() );
                 context.put( ContinuumBuildConstant.KEY_PROJECT_NAME, project.getName() );
@@ -166,11 +170,12 @@ public class DistributedBuildProjectTask
                                  new Date( buildResult.getStartTime() ) );
                 }
 
-                LocalRepository localRepo = project.getProjectGroup().getLocalRepository();
+                LocalRepository localRepo = project.getProjectGroup().getLocalRepository();                
 
                 if ( localRepo != null )
                 {
-                    context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, localRepo.getLocation() );
+                    // CONTINUUM-2391
+                	context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, localRepo.getName() );                	
                 }
                 else
                 {
@@ -195,7 +200,23 @@ public class DistributedBuildProjectTask
                     context.put( ContinuumBuildConstant.KEY_SCM_PASSWORD, project.getScmPassword() );
                 }
 
+                if ( project.getScmTag() != null )
+                {
+                    context.put( ContinuumBuildConstant.KEY_SCM_TAG, project.getScmTag() );
+                }
+                else
+                {
+                    context.put( ContinuumBuildConstant.KEY_SCM_TAG, "" );
+                }
+
                 context.put( ContinuumBuildConstant.KEY_BUILD_DEFINITION_ID, buildDefinitionId );
+                String buildDefinitionLabel = buildDef.getDescription();
+                if ( StringUtils.isEmpty( buildDefinitionLabel ) )
+                {
+                    buildDefinitionLabel = buildDef.getGoals();
+                }
+                context.put( ContinuumBuildConstant.KEY_BUILD_DEFINITION_LABEL, buildDefinitionLabel );
+                
                 context.put( ContinuumBuildConstant.KEY_BUILD_FILE, buildDef.getBuildFile() );
                 context.put( ContinuumBuildConstant.KEY_GOALS, buildDef.getGoals() );
 
@@ -207,7 +228,8 @@ public class DistributedBuildProjectTask
                 {
                     context.put( ContinuumBuildConstant.KEY_ARGUMENTS, buildDef.getArguments() );
                 }
-                context.put( ContinuumBuildConstant.KEY_TRIGGER, trigger );
+                context.put( ContinuumBuildConstant.KEY_TRIGGER, buildTrigger.getTrigger() );
+                context.put( ContinuumBuildConstant.KEY_USERNAME, buildTrigger.getUsername() );
                 context.put( ContinuumBuildConstant.KEY_BUILD_FRESH, buildDef.isBuildFresh() );
                 context.put( ContinuumBuildConstant.KEY_ALWAYS_BUILD, buildDef.isAlwaysBuild() );
                 context.put( ContinuumBuildConstant.KEY_OLD_SCM_CHANGES,
@@ -260,7 +282,8 @@ public class DistributedBuildProjectTask
                         buildResult.setBuildDefinition( buildDef );
                         buildResult.setError( error );
                         buildResult.setState( ContinuumProjectState.ERROR );
-                        buildResult.setTrigger( task.getTrigger() );
+                        buildResult.setTrigger( task.getBuildTrigger().getTrigger() );
+                        buildResult.setUsername( task.getBuildTrigger().getUsername() );
                         buildResult.setStartTime( startTime );
                         buildResult.setEndTime( endTime );
 

Propchange: continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May  6 09:23:13 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskExecutor.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222
+/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java:760767-900271,915354,915760,915848-915864,916073-916074
 /continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskExecutor.java:713270-724659

Propchange: continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May  6 09:23:13 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskQueueExecutor.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222
+/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java:760767-900271,915354,915760,915848-915864,916073-916074
 /continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskQueueExecutor.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java Thu May  6 09:23:13 2010
@@ -25,6 +25,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.model.project.BuildResult;
 
 public class ContinuumBuildConstant
@@ -37,7 +38,13 @@ public class ContinuumBuildConstant
 
     public static final String KEY_BUILD_DEFINITION_ID = "builddefinition-id";
 
+    public static final String KEY_BUILD_DEFINITION_LABEL = "builddefinition-label";
+
     public static final String KEY_TRIGGER = "trigger";
+    
+    public static final String KEY_USERNAME = "username";
+        
+    public static final String KEY_BUILD_TRIGGER = "buildTrigger";
 
     public static final String KEY_EXECUTOR_ID = "executor-id";
 
@@ -83,6 +90,8 @@ public class ContinuumBuildConstant
 
     public static final String KEY_SCM_ROOT_ADDRESS = "scm-root-address";
 
+    public static final String KEY_SCM_ROOT_ID = "scm-root-id";
+
     public static final String KEY_SCM_ERROR = "scm-error";
 
     public static final String KEY_PROJECT_NAME = "project-name";
@@ -198,6 +207,17 @@ public class ContinuumBuildConstant
     {
         return getInteger( context, KEY_TRIGGER );
     }
+    
+    public static String getUsername( Map<String, Object> context )
+    {
+        return getString( context, KEY_USERNAME, "" );
+    }
+    
+    public static BuildTrigger getBuildTrigger( Map<String, Object> context )
+    {
+        BuildTrigger defaultValue = new BuildTrigger( 0, "" );
+        return (BuildTrigger) getObject( context, KEY_BUILD_TRIGGER, defaultValue );
+    }
 
     public static long getStartTime( Map<String, Object> context )
     {
@@ -289,7 +309,7 @@ public class ContinuumBuildConstant
         return getString( context, KEY_INSTALLATION_VAR_NAME );
     }
 
-    public static List<Map> getScmChanges( Map<String, Object> context )
+    public static List<Map<String, Object>> getScmChanges( Map<String, Object> context )
     {
         return getList( context, KEY_SCM_CHANGES );
     }
@@ -318,7 +338,7 @@ public class ContinuumBuildConstant
         }
     }
 
-    public static List<Map> getChangeSetFiles( Map<String, Object> context )
+    public static List<Map<String, Object>> getChangeSetFiles( Map<String, Object> context )
     {
         return getList( context, KEY_CHANGESET_FILES );
     }
@@ -379,12 +399,12 @@ public class ContinuumBuildConstant
         return getString( context, KEY_SCM_TAG );
     }
 
-    public static Map getProjectParent( Map<String, Object> context )
+    public static Map<String, Object> getProjectParent( Map<String, Object> context )
     {
         return getMap( context, KEY_PROJECT_PARENT );
     }
 
-    public static List<Map> getProjectDevelopers( Map<String, Object> context )
+    public static List<Map<String, Object>> getProjectDevelopers( Map<String, Object> context )
     {
         return getList( context, KEY_PROJECT_DEVELOPERS );
     }
@@ -404,12 +424,12 @@ public class ContinuumBuildConstant
         return getString( context, KEY_PROJECT_DEVELOPER_SCMID );
     }
 
-    public static List<Map> getProjectDependencies( Map<String, Object> context )
+    public static List<Map<String, Object>> getProjectDependencies( Map<String, Object> context )
     {
         return getList( context, KEY_PROJECT_DEPENDENCIES );
     }
 
-    public static List<Map> getProjectNotifiers( Map<String, Object> context )
+    public static List<Map<String, Object>> getProjectNotifiers( Map<String, Object> context )
     {
         return getList( context, KEY_PROJECT_NOTIFIERS );
     }
@@ -464,12 +484,12 @@ public class ContinuumBuildConstant
         return getBoolean( context, KEY_NOTIFIER_SEND_ON_WARNING );
     }
 
-    public static Map getScmResult( Map<String, Object> context )
+    public static Map<String, Object> getScmResult( Map<String, Object> context )
     {
         return getMap( context, KEY_SCM_RESULT );
     }
 
-    public static Map getMavenProject( Map<String, Object> context )
+    public static Map<String, Object> getMavenProject( Map<String, Object> context )
     {
         return getMap( context, KEY_MAVEN_PROJECT );
     }
@@ -489,6 +509,16 @@ public class ContinuumBuildConstant
         return getString( context, KEY_BUILD_AGENT_URL );
     }
 
+    public static int getScmRootId( Map<String, Object> context )
+    {
+        return getInteger( context, KEY_SCM_ROOT_ID );
+    }
+
+    public static String getBuildDefinitionLabel( Map<String, Object> context )
+    {
+        return getString( context, KEY_BUILD_DEFINITION_LABEL, "" );
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/resources/META-INF/plexus/components.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/resources/META-INF/plexus/components.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-builder/src/main/resources/META-INF/plexus/components.xml Thu May  6 09:23:13 2010
@@ -31,102 +31,10 @@
       <role-hint>distributed-build-project</role-hint>
       <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
       <lifecycle-handler>plexus-configurable</lifecycle-handler>
-    </component>
-
-    <component>
-      <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-      <role-hint>distributed-build-project-deferred</role-hint>
-      <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
-      <lifecycle-handler>plexus-configurable</lifecycle-handler>
-    </component>
-
-    <component>
-      <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-      <role-hint>distributed-build-project-per-agent</role-hint>
-      <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
-      <lifecycle-handler>plexus-configurable</lifecycle-handler>
       <instantiation-strategy>per-lookup</instantiation-strategy>
     </component>
 
     <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
-      <role-hint>distributed-build-project-overall</role-hint>
-      <implementation>org.apache.continuum.builder.distributed.executor.overall.DistributedBuildProjectTaskExecutorOverall</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
-          <role-hint>default</role-hint>
-        </requirement>
-        <requirement>
-          <role>org.apache.continuum.dao.ProjectDao</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.continuum.dao.BuildDefinitionDao</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.continuum.builder.distributed.manager.DistributedBuildManager</role>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-          <role-hint>distributed-build-project-deferred</role-hint>
-          <field-name>deferredTaskQueue</field-name>
-        </requirement>
-      </requirements>
-    </component>
-
-    <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
-      <role-hint>distributed-build-project-overall</role-hint>
-      <implementation>org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor</implementation>
-      <instantiation-strategy>singleton</instantiation-strategy>
-      <requirements>
-        <requirement>
-          <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
-          <role-hint>distributed-build-project-overall</role-hint>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-          <role-hint>distributed-build-project</role-hint>
-        </requirement>
-      </requirements>
-      <configuration>
-        <name>distributed-build-project-overall</name>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
-      <role-hint>distributed-build-project-deferred</role-hint>
-      <implementation>org.apache.continuum.builder.distributed.executor.deferred.DistributedBuildProjectTaskExecutorDeferred</implementation>
-      <requirements>
-        <requirement>
-          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-          <role-hint>distributed-build-project</role-hint>
-        </requirement>
-      </requirements>
-    </component>
-
-    <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
-      <role-hint>distributed-build-project-deferred</role-hint>
-      <implementation>org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor</implementation>
-      <instantiation-strategy>singleton</instantiation-strategy>
-      <requirements>
-        <requirement>
-          <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
-          <role-hint>distributed-build-project-deferred</role-hint>
-        </requirement>
-        <requirement>
-          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-          <role-hint>distributed-build-project-deferred</role-hint>
-        </requirement>
-      </requirements>
-      <configuration>
-        <name>distributed-build-project-deferred</name>
-      </configuration>
-    </component>    
-
-    <component>
       <role>org.apache.continuum.builder.distributed.executor.DistributedBuildTaskExecutor</role>
       <role-hint>distributed-build-project</role-hint>
       <implementation>org.apache.continuum.builder.distributed.executor.DistributedBuildProjectTaskExecutor</implementation>
@@ -155,7 +63,7 @@
 	  <requirements>
         <requirement>
           <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-          <role-hint>distributed-build-project-per-agent</role-hint>
+          <role-hint>distributed-build-project</role-hint>
         </requirement>
         <requirement>
           <role>org.apache.continuum.builder.distributed.executor.DistributedBuildTaskExecutor</role>

Modified: continuum/branches/continuum-flat-multi-module/continuum-commons/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-commons/pom.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-commons/pom.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-commons/pom.xml Thu May  6 09:23:13 2010
@@ -22,7 +22,7 @@ under the License.
   <parent>
     <artifactId>continuum</artifactId>
     <groupId>org.apache.continuum</groupId>
-    <version>1.4.0-SNAPSHOT</version>
+    <version>1.4.1-SNAPSHOT</version>
   </parent>
   <artifactId>continuum-commons</artifactId>
   <name>Continuum :: Commons</name>
@@ -97,32 +97,5 @@ under the License.
       <artifactId>continuum-test</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.jmock</groupId>
-      <artifactId>jmock-junit3</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <!-- dependency of jmock3 -->
-    <dependency>
-      <groupId>cglib</groupId>
-      <artifactId>cglib-nodep</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <!-- dependency of jmock3 -->
-    <dependency>
-      <groupId>org.objenesis</groupId>
-      <artifactId>objenesis</artifactId>  
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.jmock</groupId>
-      <artifactId>jmock</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>jmock</groupId>
-      <artifactId>jmock</artifactId>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 </project>

Modified: continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/continuum/profile/DefaultProfileService.java Thu May  6 09:23:13 2010
@@ -55,14 +55,12 @@ public class DefaultProfileService
     public void updateProfile( Profile profile )
         throws ProfileException, AlreadyExistsProfileException
     {
-
         // already exists check should be done in the same transaction
         // but we assume we don't have a huge load and a lot of concurrent access ;-)
-        /*if ( alreadyExistsProfileName( profile ) )
+        if ( alreadyExistsProfileName( profile ) )
         {
             throw new AlreadyExistsProfileException( "profile with name " + profile.getName() + " already exists" );
         }
-        */
 
         try
         {
@@ -314,7 +312,8 @@ public class DefaultProfileService
     public boolean alreadyExistsProfileName( Profile profile )
         throws ProfileException
     {
-        return getProfileWithName( profile.getName() ) != null;
+        Profile storedProfile = getProfileWithName( profile.getName() );
+        return ( storedProfile != null && storedProfile.getId() != profile.getId() );
     }
 
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java Thu May  6 09:23:13 2010
@@ -20,8 +20,6 @@ package org.apache.maven.continuum.utils
  */
 
 import java.io.File;
-import java.util.List;
-
 import javax.annotation.Resource;
 
 import org.apache.maven.continuum.configuration.ConfigurationService;
@@ -73,9 +71,4 @@ public class ChrootJailWorkingDirectoryS
         f = new File( f, getConfigurationService().getWorkingDirectory().getPath() );
         return new File( f, Integer.toString( project.getId() ) );
     }
-    
-    public File getWorkingDirectory( Project project, String projectScmRoot, List<Project> projects )
-    {
-        return getWorkingDirectory( project );
-    }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/DefaultWorkingDirectoryService.java Thu May  6 09:23:13 2010
@@ -21,13 +21,9 @@ package org.apache.maven.continuum.utils
 
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.Project;
-import org.codehaus.plexus.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import java.io.File;
-import java.util.List;
 
 import javax.annotation.Resource;
 
@@ -41,8 +37,6 @@ public class DefaultWorkingDirectoryServ
 {
     @Resource
     private ConfigurationService configurationService;
-    
-    private static final Logger log = LoggerFactory.getLogger( DefaultWorkingDirectoryService.class );
 
     public void setConfigurationService( ConfigurationService configurationService )
     {
@@ -60,69 +54,19 @@ public class DefaultWorkingDirectoryServ
 
     public File getWorkingDirectory( Project project )
     {
-        return getWorkingDirectory( project, null, null );
-    }
-    
-    /**
-     * 
-     * @param project
-     * @param projectScmRoot
-     * @param projects projects under the same projectScmRoot
-     * @return
-     */
-    public File getWorkingDirectory( Project project, String projectScmRoot, List<Project> projects )
-    {
 //        TODO: Enable, this is what we really want
 //        ContinuumProjectGroup projectGroup = project.getProjectGroup();
 //
 //        return new File( projectGroup.getWorkingDirectory(),
 //                         project.getPath() );
-        
-        if ( project.getWorkingDirectory() == null || "".equals( project.getWorkingDirectory() ) )
-        {   
-            if ( project.isCheckedOutInSingleDirectory() && projectScmRoot != null && !"".equals( projectScmRoot ) )
-            {                
-                Project rootProject = project;
-                if( projects != null )
-                {
-                    // the root project should have the lowest id since it's always added first                    
-                    for( Project projectUnderScmRoot : projects )
-                    {
-                        if( projectUnderScmRoot.getId() < rootProject.getId() )
-                        {
-                            rootProject = projectUnderScmRoot;
-                        }
-                    }
-                }                
-                
-             // determine the path
-                String projectScmUrl = project.getScmUrl();
-                int indexDiff = StringUtils.differenceAt( projectScmUrl, projectScmRoot );
-                                
-                String pathToProject = "";
-                if( indexDiff != -1 )
-                {
-                    pathToProject = projectScmUrl.substring( indexDiff );
-                }
-                
-                if( pathToProject.startsWith( "\\" ) || pathToProject.startsWith( "/" ) )
-                {
-                    project.setWorkingDirectory( Integer.toString( rootProject.getId() ) + pathToProject );
-                }
-                else
-                {
-                    project.setWorkingDirectory( Integer.toString( rootProject.getId() ) + "/" + pathToProject );
-                }                
-            }
-            else
-            {
-                project.setWorkingDirectory( Integer.toString( project.getId() ) );
-            }
+
+        if ( project.getWorkingDirectory() == null )
+        {
+            project.setWorkingDirectory( Integer.toString( project.getId() ) );
         }
 
         File workDir;
         File projectWorkingDirectory = new File( project.getWorkingDirectory() );
-        
         if ( projectWorkingDirectory.isAbsolute() )
         {
             // clean the project working directory path if it's a subdirectory of the global working directory
@@ -142,20 +86,8 @@ public class DefaultWorkingDirectoryServ
         }
         else
         {
-            File baseWorkingDir = getConfigurationService().getWorkingDirectory();            
-            
-            // windows path
-            if( baseWorkingDir.getPath().indexOf( '\\' ) != -1 )
-            {
-                project.setWorkingDirectory( project.getWorkingDirectory().replace( '/', '\\' ) );
-                workDir = new File( baseWorkingDir.getPath() + "\\" + project.getWorkingDirectory() );
-            }
-            else
-            {
-                workDir = new File( baseWorkingDir, project.getWorkingDirectory() );
-            }            
+            workDir = new File( getConfigurationService().getWorkingDirectory(), project.getWorkingDirectory() );
         }
-        
         return workDir;
     }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/resources/META-INF/spring-context.xml?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/resources/META-INF/spring-context.xml (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/resources/META-INF/spring-context.xml Thu May  6 09:23:13 2010
@@ -29,13 +29,11 @@
   <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,
-                  org.apache.continuum.utils.shell"/>
+                  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 id="shellCommandHelper" class="org.apache.continuum.utils.shell.DefaultShellCommandHelper"/>
   <bean id="buildQueueService" class="org.apache.continuum.buildqueue.DefaultBuildQueueService"/>
 </beans>
\ No newline at end of file

Modified: continuum/branches/continuum-flat-multi-module/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java?rev=941625&r1=941624&r2=941625&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java Thu May  6 09:23:13 2010
@@ -216,23 +216,24 @@ public class DefaultProfileServiceTest
     public void testupdateProfileDuplicateName()
         throws Exception
     {
-        Profile profile = getProfileService().getProfile( jdk1mvn205.getId() );
+        int profileId = jdk1mvn205.getId();
+        Profile profile = getProfileService().getProfile( profileId );
         assertEquals( jdk1mvn205Name, profile.getName() );
         profile.setName( jdk2mvn206Name );
 
         try
         {
             getProfileService().updateProfile( profile );
-            //commented
-            //fail( "no AlreadyExistsProfileException with duplicate name" );
+            
+            fail( "no AlreadyExistsProfileException with duplicate name" );
         }
         catch ( AlreadyExistsProfileException e )
         {
             // we must be here
         }
-        Profile getted = getProfileService().getProfile( jdk1mvn205.getId() );
+        Profile getted = getProfileService().getProfile( profileId );
         assertNotNull( getted );
-        assertEquals( jdk2mvn206Name, getted.getName() );
+        assertEquals( jdk1mvn205Name, getted.getName() );
     }
 
     public void testsetJdkInProfile()



Mime
View raw message