continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r941625 [3/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/ContinuumBuildAgentServiceImpl.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/ContinuumBuildAgentServiceImpl.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/ContinuumBuildAgentServiceImpl.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java Thu May  6 09:23:13 2010
@@ -30,6 +30,7 @@ import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.buildagent.buildcontext.BuildContext;
 import org.apache.continuum.buildagent.buildcontext.manager.BuildContextManager;
@@ -40,7 +41,9 @@ import org.apache.continuum.buildagent.t
 import org.apache.continuum.buildagent.taskqueue.manager.BuildAgentTaskQueueManager;
 import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
 import org.apache.continuum.buildagent.utils.WorkingCopyContentGenerator;
+import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.scm.ChangeFile;
@@ -175,13 +178,25 @@ public class ContinuumBuildAgentServiceI
     {
         Map<String, Object> result = new HashMap<String, Object>();
 
-        if ( projectId == getProjectCurrentlyBuilding() )
+        int currentBuildId = 0;
+
+        try
+        {
+            currentBuildId = buildAgentTaskQueueManager.getIdOfProjectCurrentlyBuilding();
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            throw new ContinuumBuildAgentException( e.getMessage(), e );
+        }
+
+        if ( projectId == currentBuildId )
         {
             BuildContext buildContext = buildContextManager.getBuildContext( projectId );
 
             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() );
 
             BuildResult buildResult = buildContext.getBuildResult();
 
@@ -235,19 +250,6 @@ public class ContinuumBuildAgentServiceI
         return result;
     }
 
-    public int getProjectCurrentlyBuilding()
-        throws ContinuumBuildAgentException
-    {
-        try
-        {
-            return buildAgentTaskQueueManager.getCurrentProjectInBuilding();
-        }
-        catch ( TaskQueueManagerException e )
-        {
-            throw new ContinuumBuildAgentException( e.getMessage(), e );
-        }
-    }
-
     public void cancelBuild()
         throws ContinuumBuildAgentException
     {
@@ -476,13 +478,13 @@ public class ContinuumBuildAgentServiceI
     }
 
     public String releasePrepare( Map project, Map properties, Map releaseVersion, Map developmentVersion,
-                                  Map<String, String> environments )
+                                  Map<String, String> environments, String username )
         throws ContinuumBuildAgentException
     {
         try
         {
             return buildAgentReleaseManager.releasePrepare( project, properties, releaseVersion, developmentVersion,
-                                                            environments );
+                                                            environments, username );
         }
         catch ( ContinuumReleaseException e )
         {
@@ -521,12 +523,12 @@ public class ContinuumBuildAgentServiceI
     }
 
     public void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile,
-                                Map repository )
+                                Map repository, String username )
         throws ContinuumBuildAgentException
     {
         try
         {
-            buildAgentReleaseManager.releasePerform( releaseId, goals, arguments, useReleaseProfile, repository );
+            buildAgentReleaseManager.releasePerform( releaseId, goals, arguments, useReleaseProfile, repository, username );
         }
         catch ( ContinuumReleaseException e )
         {
@@ -536,14 +538,14 @@ public class ContinuumBuildAgentServiceI
 
     public String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
                                          String scmUrl, String scmUsername, String scmPassword, String scmTag,
-                                         String scmTagBase, Map<String, String> environments )
+                                         String scmTagBase, Map<String, String> environments, String username )
         throws ContinuumBuildAgentException
     {
         try
         {
             return buildAgentReleaseManager.releasePerformFromScm( goals, arguments, useReleaseProfile, repository,
                                                                    scmUrl, scmUsername, scmPassword, scmTag, scmTagBase,
-                                                                   environments );
+                                                                   environments, username );
         }
         catch ( ContinuumReleaseException e )
         {
@@ -570,6 +572,409 @@ public class ContinuumBuildAgentServiceI
         }
     }
 
+    public int getBuildSizeOfAgent()
+    {
+        int size = 0;
+        
+        try
+        {
+            if ( buildAgentTaskQueueManager.getCurrentProjectInBuilding() != null )
+            {
+                size++;
+            }
+
+            if ( buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild() != null )
+            {
+                size++;
+            }
+
+            size = size + buildAgentTaskQueueManager.getProjectsInBuildQueue().size();
+
+            size = size + buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue().size();
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while getting build size of agent" );
+        }
+
+        return size;
+    }
+
+    public List<Map<String, Object>> getProjectsInPrepareBuildQueue()
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
+
+            for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
+            {
+                Map<String, Object> map = new HashMap<String, Object>();
+                map.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
+                map.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ID, new Integer( task.getScmRootId() ) );
+                map.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, task.getScmRootAddress() );
+                map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+                map.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
+
+                projects.add( map );
+            }
+
+            return projects;
+        }
+        catch( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while retrieving projects in prepare build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while retrieving projects in prepare build queue", e );
+        }
+    }
+
+    public List<Map<String, Object>> getProjectsAndBuildDefinitionsInPrepareBuildQueue()
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
+
+            for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
+            {
+                for ( BuildContext context : task.getBuildContexts() )
+                {
+                    Map<String, Object> map = new HashMap<String, Object>();
+
+                    map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, context.getProjectId() );
+                    map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, context.getBuildDefinitionId() );
+
+                    projects.add( map );
+                }
+            }
+
+            return projects;
+        }
+        catch( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while retrieving projects in prepare build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while retrieving projects in prepare build queue", e );
+        }
+    }
+
+    public List<Map<String, Object>> getProjectsInBuildQueue()
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
+
+            for ( BuildProjectTask task : buildAgentTaskQueueManager.getProjectsInBuildQueue() )
+            {
+                Map<String, Object> map = new HashMap<String, Object>();
+                map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( task.getProjectId() ) );
+                map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( task.getBuildDefinitionId() ) );
+                map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+                map.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
+                map.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
+                map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_LABEL, task.getBuildDefinitionLabel() );
+
+                projects.add( map );
+            }
+
+            return projects;
+        }
+        catch( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while retrieving projects in build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while retrieving projects in build queue", e );
+        }
+    }
+
+    public Map<String, Object> getProjectCurrentlyPreparingBuild()
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            Map<String, Object> project = new HashMap<String, Object>();
+
+            PrepareBuildProjectsTask task = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
+
+            if ( task != null )
+            {
+                project.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
+                project.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ID, new Integer( task.getScmRootId() ) );
+                project.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, task.getScmRootAddress() );
+                project.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+                project.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
+            }
+
+            return project;
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while retrieving current project in prepare build", e );
+            throw new ContinuumBuildAgentException( "Error occurred while retrieving current project in prepare build", e );
+        }
+    }
+
+    public List<Map<String, Object>> getProjectsAndBuildDefinitionsCurrentlyPreparingBuild()
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            List<Map<String, Object>> projects = new ArrayList<Map<String, Object>>();
+
+            PrepareBuildProjectsTask task = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
+
+            if ( task != null )
+            {
+                for ( BuildContext context : task.getBuildContexts() )
+                {
+                    Map<String, Object> map = new HashMap<String, Object>();
+
+                    map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, context.getProjectId() );
+                    map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, context.getBuildDefinitionId() );
+
+                    projects.add( map );
+                }
+            }
+
+            return projects;
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while retrieving current projects in prepare build", e );
+            throw new ContinuumBuildAgentException( "Error occurred while retrieving current projects in prepare build", e );
+        }
+    }
+    public Map<String, Object> getProjectCurrentlyBuilding()
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            Map<String, Object> project = new HashMap<String, Object>();
+
+            BuildProjectTask task = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
+
+            if ( task != null )
+            {
+                project.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( task.getProjectId() ) );
+                project.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( task.getBuildDefinitionId() ) );
+                project.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+                project.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
+                project.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
+                project.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_LABEL, task.getBuildDefinitionLabel() );
+            }
+
+            return project;
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while retrieving current project in building", e );
+            throw new ContinuumBuildAgentException( "Error occurred while retrieving current project in building", e );
+        }
+    }
+
+    public boolean isProjectGroupInQueue( int projectGroupId )
+    {
+        try
+        {
+            PrepareBuildProjectsTask currentPrepareBuildTask = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
+
+            if ( currentPrepareBuildTask != null && currentPrepareBuildTask.getProjectGroupId() == projectGroupId )
+            {
+                return true;
+            }
+
+            BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
+
+            if ( currentBuildTask != null && currentBuildTask.getProjectGroupId() == projectGroupId )
+            {
+                return true;
+            }
+
+            for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
+            {
+                if ( task.getProjectGroupId() == projectGroupId )
+                {
+                    return true;
+                }
+            }
+
+            for ( BuildProjectTask task : buildAgentTaskQueueManager.getProjectsInBuildQueue() )
+            {
+                if ( task.getProjectGroupId() == projectGroupId )
+                {
+                    return true;
+                }
+            }
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error while checking if project group " + projectGroupId + " is queued in agent", e);
+        }
+
+        return false;
+    }
+
+    public boolean isProjectScmRootInQueue( int projectScmRootId, List<Integer> projectIds )
+    {
+        try
+        {
+            PrepareBuildProjectsTask currentPrepareBuildTask = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
+
+            if ( currentPrepareBuildTask != null && currentPrepareBuildTask.getScmRootId() == projectScmRootId )
+            {
+                return true;
+            }
+
+            BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
+            
+            if ( currentBuildTask != null )
+            {
+                int projectId = currentBuildTask.getProjectId();
+
+                for ( Integer pid : projectIds )
+                {
+                    if ( pid == projectId )
+                    {
+                        return true;
+                    }
+                }
+            }
+
+            for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
+            {
+                if ( task.getScmRootId() == projectScmRootId )
+                {
+                    return true;
+                }
+            }
+
+            for ( BuildProjectTask task : buildAgentTaskQueueManager.getProjectsInBuildQueue() )
+            {
+                int projectId = task.getProjectId();
+
+                for ( Integer pid : projectIds )
+                {
+                    if ( pid == projectId )
+                    {
+                        return true;
+                    }
+                }
+            }
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error while checking if project scm root " + projectScmRootId + " is queued in agent", e);
+        }
+
+        return false;
+    }
+
+    public boolean isProjectCurrentlyBuilding( int projectId )
+    {
+        try
+        {
+            BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
+
+            if ( currentBuildTask != null && currentBuildTask.getProjectId() == projectId )
+            {
+                return true;
+            }
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while checking if project " + projectId + " is currently building in agent", e );
+        }
+
+        return false;
+    }
+
+    public boolean isProjectInBuildQueue( int projectId )
+    {
+        try
+        {
+            List<BuildProjectTask> buildTasks = buildAgentTaskQueueManager.getProjectsInBuildQueue();
+
+            if ( buildTasks != null )
+            {
+                for ( BuildProjectTask task : buildTasks )
+                {
+                    if ( task.getProjectId() == projectId )
+                    {
+                        return true;
+                    }
+                }
+            }
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while checking if project " + projectId + " is in build queue of agent", e );
+        }
+
+        return false;
+    }
+
+    public boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            return buildAgentTaskQueueManager.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while removing projects from prepare build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while removing projects from prepare build queue", e );
+        }
+    }
+
+    public void removeFromPrepareBuildQueue( List<String> hashCodes )
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            buildAgentTaskQueueManager.removeFromPrepareBuildQueue( listToIntArray( hashCodes ) );
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while removing projects from prepare build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while removing projects from prepare build queue", e );
+        }
+    }
+
+    public boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            return buildAgentTaskQueueManager.removeFromBuildQueue( projectId, buildDefinitionId );
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while removing project from build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while removing project from build queue ", e );
+        }
+    }
+
+    public void removeFromBuildQueue( List<String> hashCodes )
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            buildAgentTaskQueueManager.removeFromBuildQueue( listToIntArray( hashCodes ) );
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error occurred while removing projects from build queue", e );
+            throw new ContinuumBuildAgentException( "Error occurred while removing project from build queue ", e );
+        }
+    }
+
+    public boolean ping()
+    {
+        log.info( "Ping Ok" );
+
+        return Boolean.TRUE;
+    }
+
     private void processProject( String workingDirectory, String pomFilename, boolean autoVersionSubmodules,
                                  List<Map<String, String>> projects )
         throws Exception
@@ -641,20 +1046,24 @@ public class ContinuumBuildAgentServiceI
             context.setProjectGroupId( ContinuumBuildAgentUtil.getProjectGroupId( map ) );
             context.setProjectGroupName( ContinuumBuildAgentUtil.getProjectGroupName( map ) );
             context.setScmRootAddress( ContinuumBuildAgentUtil.getScmRootAddress( map ) );
+            context.setScmRootId( ContinuumBuildAgentUtil.getScmRootId( map ) );
             context.setProjectName( ContinuumBuildAgentUtil.getProjectName( map ) );
             context.setProjectState( ContinuumBuildAgentUtil.getProjectState( map ) );
             context.setTrigger( ContinuumBuildAgentUtil.getTrigger( map ) );
+            context.setUsername( ContinuumBuildAgentUtil.getUsername( map ) );
             context.setLocalRepository( ContinuumBuildAgentUtil.getLocalRepository( map ) );
             context.setBuildNumber( ContinuumBuildAgentUtil.getBuildNumber( map ) );
             context.setOldScmResult( getScmResult( ContinuumBuildAgentUtil.getOldScmChanges( map ) ) );
             context.setLatestUpdateDate( ContinuumBuildAgentUtil.getLatestUpdateDate( map ) );
             context.setBuildAgentUrl( ContinuumBuildAgentUtil.getBuildAgentUrl( map ) );
             context.setMaxExecutionTime( ContinuumBuildAgentUtil.getMaxExecutionTime( map ) );
+            context.setBuildDefinitionLabel( ContinuumBuildAgentUtil.getBuildDefinitionLabel( map ) );
+            context.setScmTag( ContinuumBuildAgentUtil.getScmTag( map ) );
 
             buildContext.add( context );
         }
 
-        buildContextManager.setBuildContextList( buildContext );
+        buildContextManager.addBuildContexts( buildContext );
 
         return buildContext;
     }
@@ -725,8 +1134,8 @@ public class ContinuumBuildAgentServiceI
         if ( buildContexts != null && buildContexts.size() > 0 )
         {
             BuildContext context = buildContexts.get( 0 );
-            return new PrepareBuildProjectsTask( buildContexts, context.getTrigger(), context.getProjectGroupId(),
-                                                 context.getScmRootAddress() );
+            return new PrepareBuildProjectsTask( buildContexts, new BuildTrigger( context.getTrigger(), context.getUsername() ),
+            		                             context.getProjectGroupId(), context.getScmRootAddress(), context.getScmRootId() );
         }
         else
         {
@@ -734,4 +1143,18 @@ public class ContinuumBuildAgentServiceI
             return null;
         }
     }
+
+    private int[] listToIntArray( List<String> strings )
+    {
+        if ( strings == null || strings.isEmpty() )
+        {
+            return new int[0];
+        }
+        int[] array = new int[0];
+        for ( String intString : strings )
+        {
+            array = ArrayUtils.add( array, Integer.parseInt( intString ) );
+        }
+        return array;
+    }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ChangeLogProjectAction.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/action/ChangeLogProjectAction.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/action/ChangeLogProjectAction.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ChangeLogProjectAction.java Thu May  6 09:23:13 2010
@@ -1,5 +1,24 @@
 package org.apache.continuum.buildagent.action;
 
+/*
+ * 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.util.Date;
 import java.util.List;

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.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/action/CreateBuildProjectTaskAction.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/action/CreateBuildProjectTaskAction.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java Thu May  6 09:23:13 2010
@@ -27,6 +27,7 @@ import org.apache.continuum.buildagent.t
 import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.codehaus.plexus.action.AbstractAction;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
@@ -53,10 +54,12 @@ public class CreateBuildProjectTaskActio
 
         for ( BuildContext buildContext : buildContexts )
         {
-            BuildProjectTask buildProjectTask =
+        	BuildTrigger buildTrigger = new BuildTrigger( buildContext.getTrigger(), buildContext.getUsername() );
+        	
+        	BuildProjectTask buildProjectTask =
                 new BuildProjectTask( buildContext.getProjectId(), buildContext.getBuildDefinitionId(),
-                                      buildContext.getTrigger(), buildContext.getProjectName(), "",
-                                      buildContext.getScmResult() );
+                		              buildTrigger, buildContext.getProjectName(), buildContext.getBuildDefinitionLabel(),
+                                      buildContext.getScmResult(), buildContext.getProjectGroupId() );
             buildProjectTask.setMaxExecutionTime( buildContext.getMaxExecutionTime() * 1000 );
 
             try
@@ -79,23 +82,6 @@ public class CreateBuildProjectTaskActio
                     "Error while checking if project " + buildContext.getProjectId() + " is in build queue", e );
             }
         }
-
-        try
-        {
-            boolean stop = false;
-            while ( !stop )
-            {
-                if ( buildAgentTaskQueueManager.getCurrentProjectInBuilding() <= 0 &&
-                    !buildAgentTaskQueueManager.hasBuildTaskInQueue() )
-                {
-                    stop = true;
-                }
-            }
-        }
-        catch ( TaskQueueManagerException e )
-        {
-            throw new ContinuumException( e.getMessage(), e );
-        }
     }
 
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.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/action/ExecuteBuilderAction.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/action/ExecuteBuilderAction.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java Thu May  6 09:23:13 2010
@@ -67,6 +67,8 @@ public class ExecuteBuilderAction
         String localRepository = ContinuumBuildAgentUtil.getLocalRepository( context );
 
         int trigger = ContinuumBuildAgentUtil.getTrigger( context );
+        
+        String username = ContinuumBuildAgentUtil.getUsername( context );
 
         ContinuumAgentBuildExecutor buildExecutor = buildAgentBuildExecutorManager.getBuildExecutor( project.getExecutorId() );
         
@@ -81,6 +83,8 @@ public class ExecuteBuilderAction
         buildResult.setState( ContinuumProjectState.BUILDING );
 
         buildResult.setTrigger( trigger );
+        
+        buildResult.setUsername( username );
 
         buildResult.setBuildDefinition( buildDefinition );
 

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateProjectFromWorkingDirectoryAction.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/action/UpdateProjectFromWorkingDirectoryAction.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/action/UpdateProjectFromWorkingDirectoryAction.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateProjectFromWorkingDirectoryAction.java Thu May  6 09:23:13 2010
@@ -1,5 +1,24 @@
 package org.apache.continuum.buildagent.action;
 
+/*
+ * 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.util.Map;
 

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/BuildAgentBuildExecutorManager.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/build/execution/manager/BuildExecutorManager.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/build/execution/manager/BuildAgentBuildExecutorManager.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/build/execution/manager/BuildAgentBuildExecutorManager.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/build/execution/manager/BuildExecutorManager.java:713270-724659

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.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/build/execution/manager/DefaultBuildExecutorManager.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/build/execution/manager/DefaultBuildAgentBuildExecutorManager.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/build/execution/manager/DefaultBuildAgentBuildExecutorManager.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/build/execution/manager/DefaultBuildExecutorManager.java:713270-724659

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May  6 09:23:13 2010
@@ -1,3 +1,3 @@
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222
-/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1:713270-734307
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1:760767-900271,915354,915760,915848-915864,916073-916074
+/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1:713270-726726
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1:724671-733412

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/BuildAgentMavenBuilderHelper.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/build/execution/maven/m2/MavenBuilderHelper.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/build/execution/maven/m2/BuildAgentMavenBuilderHelper.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/build/execution/maven/m2/BuildAgentMavenBuilderHelper.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/build/execution/maven/m2/MavenBuilderHelper.java:713270-724659

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.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/build/execution/maven/m2/DefaultMavenBuilderHelper.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/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.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/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.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/build/execution/maven/m2/DefaultMavenBuilderHelper.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.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/buildcontext/BuildContext.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/buildcontext/BuildContext.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java Thu May  6 09:23:13 2010
@@ -22,6 +22,7 @@ package org.apache.continuum.buildagent.
 import java.util.Date;
 import java.util.Map;
 
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.scm.ScmResult;
 
@@ -39,6 +40,8 @@ public class BuildContext
 
     private int buildDefinitionId;
 
+    private String buildDefinitionLabel;
+
     private String buildFile;
 
     private String goals;
@@ -53,7 +56,11 @@ public class BuildContext
 
     private String scmPassword;
 
+    private String scmTag;
+
     private int trigger;
+    
+    private String username;
 
     private boolean buildFresh;
 
@@ -63,6 +70,8 @@ public class BuildContext
 
     private String scmRootAddress;
 
+    private int scmRootId;
+
     private Map<String, Object> actionContext;
 
     private ScmResult scmResult;
@@ -211,6 +220,16 @@ public class BuildContext
         this.scmPassword = scmPassword;
     }
 
+    public String getScmTag()
+    {
+        return scmTag;
+    }
+
+    public void setScmTag( String scmTag )
+    {
+        this.scmTag = scmTag;
+    }
+
     public int getTrigger()
     {
         return trigger;
@@ -350,4 +369,34 @@ public class BuildContext
     {
         return maxExecutionTime;
     }
+
+    public void setScmRootId( int scmRootId )
+    {
+        this.scmRootId = scmRootId;
+    }
+
+    public int getScmRootId()
+    {
+        return scmRootId;
+    }
+
+    public void setBuildDefinitionLabel( String buildDefinitionLabel )
+    {
+        this.buildDefinitionLabel = buildDefinitionLabel;
+    }
+
+    public String getBuildDefinitionLabel()
+    {
+        return buildDefinitionLabel;
+    }
+    
+    public void setUsername( String username )
+    {
+         this.username = username;
+    }
+    
+    public String getUsername()
+    {
+         return username;
+    }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.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/buildcontext/manager/BuildContextManager.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/buildcontext/manager/BuildContextManager.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java Thu May  6 09:23:13 2010
@@ -30,9 +30,11 @@ public interface BuildContextManager
 {
     String ROLE = BuildContextManager.class.getName();
 
-    public void setBuildContextList( List<BuildContext> buildContext );
+    public void addBuildContexts( List<BuildContext> buildContextList );
 
-    public List<BuildContext> getBuildContextList();
+    public List<BuildContext> getBuildContexts();
 
     public BuildContext getBuildContext( int projectId );
+
+    public void removeBuildContext( int projectId );
 }
\ No newline at end of file

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.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/buildcontext/manager/DefaultBuildContextManager.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/buildcontext/manager/DefaultBuildContextManager.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java Thu May  6 09:23:13 2010
@@ -19,7 +19,10 @@ package org.apache.continuum.buildagent.
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.continuum.buildagent.buildcontext.BuildContext;
 
@@ -30,34 +33,50 @@ import org.apache.continuum.buildagent.b
 public class DefaultBuildContextManager
     implements BuildContextManager
 {
-    public List<BuildContext> buildContexts;
+    public Map<Integer, BuildContext> buildContexts;
 
     public BuildContext getBuildContext( int projectId )
     {
-        BuildContext context = null;
+        if ( buildContexts != null )
+        {
+            return buildContexts.get( projectId );
+        }
+
+        return null;
+    }
+
+    public List<BuildContext> getBuildContexts()
+    {
+        List<BuildContext> bContexts = new ArrayList<BuildContext>();
 
         if ( buildContexts != null )
         {
-            for ( BuildContext item : buildContexts )
-            {
-                if (item.getProjectId() == projectId)
-                {
-                    context = item;
-                    break;
-                }
-            }
+            bContexts.addAll( buildContexts.values() );
         }
 
-        return context;
+        return bContexts;
     }
 
-    public List<BuildContext> getBuildContextList()
+    public void addBuildContexts( List<BuildContext> buildContextList )
     {
-        return buildContexts;
+        if ( buildContexts == null )
+        {
+            buildContexts = new HashMap<Integer, BuildContext>();
+        }
+
+        for ( BuildContext buildContext : buildContextList )
+        {
+            buildContexts.put( buildContext.getProjectId(), buildContext );
+        }
     }
 
-    public void setBuildContextList( List<BuildContext> buildContexts )
+    public void removeBuildContext( int projectId )
     {
-        this.buildContexts = buildContexts;
+        BuildContext buildContext = getBuildContext( projectId );
+
+        if ( buildContext != null )
+        {
+            buildContexts.remove( buildContext );
+        }
     }
 }
\ No newline at end of file

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.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/configuration/BuildAgentConfiguration.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/configuration/BuildAgentConfiguration.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java Thu May  6 09:23:13 2010
@@ -1,7 +1,5 @@
 package org.apache.continuum.buildagent.configuration;
 
-import java.io.File;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -21,6 +19,8 @@ import java.io.File;
  * under the License.
  */
 
+import java.io.File;
+
 public interface BuildAgentConfiguration
 {
     String ROLE = BuildAgentConfiguration.class.getName();
@@ -33,13 +33,13 @@ public interface BuildAgentConfiguration
 
     void save()
         throws BuildAgentConfigurationException;
-    
+
     void save( File file )
         throws BuildAgentConfigurationException;
-    
-    void reload( )
-        throws BuildAgentConfigurationException;    
-    
+
+    void reload()
+        throws BuildAgentConfigurationException;
+
     void reload( File file )
         throws BuildAgentConfigurationException;
 }

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.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/configuration/ContinuumConfiguration.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/configuration/BuildAgentConfiguration.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/configuration/BuildAgentConfiguration.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/configuration/ContinuumConfiguration.java:713270-724659

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.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/configuration/ContinuumConfigurationException.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/configuration/BuildAgentConfigurationException.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/configuration/BuildAgentConfigurationException.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/configuration/ContinuumConfigurationException.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.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/configuration/BuildAgentConfigurationService.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/configuration/BuildAgentConfigurationService.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java Thu May  6 09:23:13 2010
@@ -23,6 +23,7 @@ import java.io.File;
 import java.util.List;
 
 import org.apache.continuum.buildagent.model.Installation;
+import org.apache.continuum.buildagent.model.LocalRepository;
 
 public interface BuildAgentConfigurationService
 {
@@ -45,4 +46,6 @@ public interface BuildAgentConfiguration
         throws BuildAgentConfigurationException;
 
     List<Installation> getAvailableInstallations();
+    
+    List<LocalRepository> getLocalRepositories();
 }

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.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/configuration/ConfigurationService.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/configuration/BuildAgentConfigurationService.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/configuration/BuildAgentConfigurationService.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/configuration/ConfigurationService.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.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/configuration/DefaultBuildAgentConfiguration.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/configuration/DefaultBuildAgentConfiguration.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java Thu May  6 09:23:13 2010
@@ -28,6 +28,7 @@ import java.io.InputStreamReader;
 import org.apache.continuum.buildagent.model.ContinuumBuildAgentConfigurationModel;
 import org.apache.continuum.buildagent.model.io.xpp3.ContinuumBuildAgentConfigurationModelXpp3Reader;
 import org.apache.continuum.buildagent.model.io.xpp3.ContinuumBuildAgentConfigurationModelXpp3Writer;
+import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.slf4j.Logger;
@@ -82,12 +83,14 @@ public class DefaultBuildAgentConfigurat
     public void reload( File file )
         throws BuildAgentConfigurationException
     {
+        FileInputStream fis = null;
         try
         {
+            fis = new FileInputStream( file );
             ContinuumBuildAgentConfigurationModelXpp3Reader configurationXpp3Reader =
                 new ContinuumBuildAgentConfigurationModelXpp3Reader();
             ContinuumBuildAgentConfigurationModel configuration =
-                configurationXpp3Reader.read( new InputStreamReader( new FileInputStream( file ) ) );
+                configurationXpp3Reader.read( new InputStreamReader( fis ) );
 
             this.generalBuildAgentConfiguration = new GeneralBuildAgentConfiguration();
             if ( StringUtils.isNotEmpty( configuration.getBuildOutputDirectory() ) )
@@ -102,6 +105,7 @@ public class DefaultBuildAgentConfigurat
             }
             this.generalBuildAgentConfiguration.setContinuumServerUrl( configuration.getContinuumServerUrl() );
             this.generalBuildAgentConfiguration.setInstallations( configuration.getInstallations() );
+            this.generalBuildAgentConfiguration.setLocalRepositories( configuration.getLocalRepositories() );
         }
         catch ( IOException e )
         {
@@ -113,6 +117,13 @@ public class DefaultBuildAgentConfigurat
             log.error( e.getMessage(), e );
             throw new BuildAgentConfigurationException( e.getMessage(), e );
         }
+        finally
+        {
+            if ( fis != null )
+            {
+                IOUtil.close( fis );
+            }
+        }
     }
 
     public void save()
@@ -143,11 +154,14 @@ public class DefaultBuildAgentConfigurat
             }
             configurationModel.setContinuumServerUrl( this.generalBuildAgentConfiguration.getContinuumServerUrl() );
             configurationModel.setInstallations( this.generalBuildAgentConfiguration.getInstallations() );
+            configurationModel.setLocalRepositories( this.generalBuildAgentConfiguration.getLocalRepositories() );
 
             ContinuumBuildAgentConfigurationModelXpp3Writer writer =
                 new ContinuumBuildAgentConfigurationModelXpp3Writer();
             FileWriter fileWriter = new FileWriter( file );
             writer.write( fileWriter, configurationModel );
+            fileWriter.flush();
+            fileWriter.close();
         }
         catch ( IOException e )
         {

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.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/configuration/DefaultContinuumConfiguration.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/configuration/DefaultBuildAgentConfiguration.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/configuration/DefaultBuildAgentConfiguration.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/configuration/DefaultContinuumConfiguration.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.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/configuration/DefaultBuildAgentConfigurationService.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/configuration/DefaultBuildAgentConfigurationService.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java Thu May  6 09:23:13 2010
@@ -1,5 +1,24 @@
 package org.apache.continuum.buildagent.configuration;
 
+/*
+ * 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.io.IOException;
 import java.util.List;
@@ -7,6 +26,7 @@ import java.util.List;
 import javax.annotation.Resource;
 
 import org.apache.continuum.buildagent.model.Installation;
+import org.apache.continuum.buildagent.model.LocalRepository;
 import org.codehaus.plexus.util.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -125,6 +145,11 @@ public class DefaultBuildAgentConfigurat
         return generalBuildAgentConfiguration.getInstallations();
     }
 
+    public List<LocalRepository> getLocalRepositories()
+    {
+        return generalBuildAgentConfiguration.getLocalRepositories();
+    }
+    
     private void loadData()
         throws BuildAgentConfigurationException
     {

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.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/configuration/DefaultConfigurationService.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/configuration/DefaultBuildAgentConfigurationService.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/configuration/DefaultBuildAgentConfigurationService.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/configuration/DefaultConfigurationService.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.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/configuration/GeneralBuildAgentConfiguration.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/configuration/GeneralBuildAgentConfiguration.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java Thu May  6 09:23:13 2010
@@ -23,6 +23,7 @@ import java.io.File;
 import java.util.List;
 
 import org.apache.continuum.buildagent.model.Installation;
+import org.apache.continuum.buildagent.model.LocalRepository;
 
 public class GeneralBuildAgentConfiguration
 {
@@ -33,6 +34,8 @@ public class GeneralBuildAgentConfigurat
     private String continuumServerUrl;
 
     private List<Installation> installations;
+    
+    private List<LocalRepository> localRepositories;
 
     public File getWorkingDirectory()
     {
@@ -73,4 +76,14 @@ public class GeneralBuildAgentConfigurat
     {
         this.installations = installations;
     }
+    
+    public List<LocalRepository> getLocalRepositories()
+    {
+        return localRepositories;
+    }
+
+    public void setLocalRepositories( List<LocalRepository> localRepositories )
+    {
+        this.localRepositories = localRepositories;
+    }
 }

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.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/configuration/ContinuumBuildAgentConfiguration.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/configuration/GeneralBuildAgentConfiguration.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/configuration/GeneralBuildAgentConfiguration.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/configuration/ContinuumBuildAgentConfiguration.java:713270-724659

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.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/installation/InstallationService.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/installation/BuildAgentInstallationService.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/installation/BuildAgentInstallationService.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/installation/InstallationService.java:713270-724659

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.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/installation/DefaultInstallationService.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/installation/DefaultBuildAgentInstallationService.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/installation/DefaultBuildAgentInstallationService.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/installation/DefaultInstallationService.java:713270-724659

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.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/Continuum.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/manager/BuildAgentManager.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/manager/BuildAgentManager.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/Continuum.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.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/manager/BuildAgentReleaseManager.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/manager/BuildAgentReleaseManager.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManager.java Thu May  6 09:23:13 2010
@@ -30,7 +30,7 @@ public interface BuildAgentReleaseManage
 
     String releasePrepare( Map<String, Object> project, Map<String, Object> properties,
                            Map<String, String> releaseVersion, Map<String, String> developmentVersion,
-                           Map<String, String> environments )
+                           Map<String, String> environments, String username )
         throws ContinuumReleaseException;
 
     ReleaseResult getReleaseResult( String releaseId );
@@ -41,12 +41,12 @@ public interface BuildAgentReleaseManage
 
     String getPreparedReleaseName( String releaseId );
 
-    void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile, Map repository )
+    void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile, Map repository, String username )
         throws ContinuumReleaseException;
 
     String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
                                   String scmUrl, String scmUsername, String scmPassword, String scmTag,
-                                  String scmTagBase, Map<String, String> environments )
+                                  String scmTagBase, Map<String, String> environments, String username )
         throws ContinuumReleaseException;
 
     String releaseCleanup( String releaseId );

Propchange: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.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/DefaultContinuum.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/manager/DefaultBuildAgentManager.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/manager/DefaultBuildAgentManager.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/DefaultContinuum.java:713270-724659

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.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/manager/DefaultBuildAgentReleaseManager.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/manager/DefaultBuildAgentReleaseManager.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java Thu May  6 09:23:13 2010
@@ -21,6 +21,7 @@ package org.apache.continuum.buildagent.
 
 import java.io.File;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
@@ -66,7 +67,7 @@ public class DefaultBuildAgentReleaseMan
 
     public String releasePrepare( Map<String, Object> projectMap, Map<String, Object> properties,
                                   Map<String, String> releaseVersion, Map<String, String> developmentVersion,
-                                  Map<String, String> environments )
+                                  Map<String, String> environments, String username )
         throws ContinuumReleaseException
     {
         Project project = getProject( projectMap );
@@ -74,6 +75,8 @@ public class DefaultBuildAgentReleaseMan
         Properties releaseProperties = getReleaseProperties( properties );
 
         ContinuumReleaseManagerListener listener = new DefaultReleaseManagerListener();
+        
+        listener.setUsername( username );
 
         String workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() ).getPath();
 
@@ -118,6 +121,9 @@ public class DefaultBuildAgentReleaseMan
         if ( listener != null )
         {
             map.put( ContinuumBuildAgentUtil.KEY_RELEASE_STATE, listener.getState() );
+            
+            map.put( ContinuumBuildAgentUtil.KEY_USERNAME, listener.getUsername() );
+            
             if ( listener.getPhases() != null )
             {
                 map.put( ContinuumBuildAgentUtil.KEY_RELEASE_PHASES, listener.getPhases() );
@@ -157,20 +163,32 @@ public class DefaultBuildAgentReleaseMan
         return "";
     }
 
+    @SuppressWarnings( "unchecked" )
     public void releasePerform( String releaseId, String goals, String arguments, boolean useReleaseProfile,
-                                Map repository )
+                                Map repository, String username )
         throws ContinuumReleaseException
     {
         ContinuumReleaseManagerListener listener = new DefaultReleaseManagerListener();
+        
+        listener.setUsername( username );
 
         LocalRepository repo = null;
 
         if ( !repository.isEmpty() )
         {
-            repo = new LocalRepository();
-            repo.setLayout( ContinuumBuildAgentUtil.getLocalRepositoryLayout( repository ) );
-            repo.setName( ContinuumBuildAgentUtil.getLocalRepositoryName( repository ) );
-            repo.setLocation( ContinuumBuildAgentUtil.getLocalRepository( repository ) );
+            List<org.apache.continuum.buildagent.model.LocalRepository>  localRepos = buildAgentConfigurationService.getLocalRepositories();
+            for( org.apache.continuum.buildagent.model.LocalRepository localRepo : localRepos )
+            {
+                if( localRepo.getName().equalsIgnoreCase( ContinuumBuildAgentUtil.getLocalRepositoryName( repository ) ) )
+                {
+                    repo = new LocalRepository();
+                    repo.setLayout( localRepo.getLayout() );
+                    repo.setName( localRepo.getName() );
+                    repo.setLocation( localRepo.getLocation() );
+                    
+                    break;
+                }   
+            }
         }
 
         File performDirectory =
@@ -182,7 +200,7 @@ public class DefaultBuildAgentReleaseMan
 
     public String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
                                          String scmUrl, String scmUsername, String scmPassword, String scmTag,
-                                         String scmTagBase, Map<String, String> environments )
+                                         String scmTagBase, Map<String, String> environments, String username )
         throws ContinuumReleaseException
     {
         ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
@@ -203,7 +221,7 @@ public class DefaultBuildAgentReleaseMan
 
         releaseManager.getPreparedReleases().put( releaseId, descriptor );
 
-        releasePerform( releaseId, goals, arguments, useReleaseProfile, repository );
+        releasePerform( releaseId, goals, arguments, useReleaseProfile, repository, username );
 
         return releaseId;
     }
@@ -260,7 +278,8 @@ public class DefaultBuildAgentReleaseMan
 
         ProjectGroup group = new ProjectGroup();
 
-        String localRepo = ContinuumBuildAgentUtil.getLocalRepository( context );
+        String localRepo = ContinuumBuildAgentUtil.getLocalRepositoryName( context );
+        
         if ( StringUtils.isBlank( localRepo ) )
         {
             group.setLocalRepository( null );
@@ -268,8 +287,16 @@ public class DefaultBuildAgentReleaseMan
         else
         {
             LocalRepository localRepository = new LocalRepository();
-            localRepository.setLocation( localRepo );
-            group.setLocalRepository( localRepository );
+            List<org.apache.continuum.buildagent.model.LocalRepository> localRepos = buildAgentConfigurationService.getLocalRepositories();
+            for( org.apache.continuum.buildagent.model.LocalRepository localRepoBA : localRepos )
+            {
+                if( localRepoBA.getName().equalsIgnoreCase( localRepo ) )
+                {
+                    localRepository.setLocation( localRepoBA.getLocation() );
+                    group.setLocalRepository( localRepository );
+                    break;
+                }
+            }
         }
 
         project.setProjectGroup( group );
@@ -343,5 +370,8 @@ public class DefaultBuildAgentReleaseMan
         return props;
     }
 
-
+    public void setBuildAgentConfigurationService( BuildAgentConfigurationService buildAgentConfigurationService )
+    {
+        this.buildAgentConfigurationService = buildAgentConfigurationService;
+    }    
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.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/PrepareBuildProjectsTask.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/PrepareBuildProjectsTask.java (original)
+++ continuum/branches/continuum-flat-multi-module/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java Thu May  6 09:23:13 2010
@@ -22,6 +22,7 @@ package org.apache.continuum.buildagent.
 import java.util.List;
 
 import org.apache.continuum.buildagent.buildcontext.BuildContext;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.codehaus.plexus.taskqueue.Task;
 
 public class PrepareBuildProjectsTask
@@ -29,19 +30,22 @@ public class PrepareBuildProjectsTask
 {
     private final List<BuildContext> buildContexts;
 
-    private final int trigger;
+    private BuildTrigger buildTrigger;
 
     private final int projectGroupId;
 
     private final String scmRootAddress;
 
-    public PrepareBuildProjectsTask( List<BuildContext> buildContexts, int trigger, int projectGroupId,
-                                     String scmRootAddress )
+    private final int scmRootId;
+
+    public PrepareBuildProjectsTask( List<BuildContext> buildContexts, BuildTrigger buildTrigger, int projectGroupId,
+                                     String scmRootAddress, int scmRootId )
     {
         this.buildContexts = buildContexts;
-        this.trigger = trigger;
+        this.buildTrigger = buildTrigger;
         this.projectGroupId = projectGroupId;
         this.scmRootAddress = scmRootAddress;
+        this.scmRootId = scmRootId;
     }
 
     public long getMaxExecutionTime()
@@ -55,9 +59,9 @@ public class PrepareBuildProjectsTask
         return buildContexts;
     }
 
-    public int getTrigger()
+    public BuildTrigger getBuildTrigger()
     {
-        return trigger;
+    	return buildTrigger;
     }
 
     public int getProjectGroupId()
@@ -69,4 +73,14 @@ public class PrepareBuildProjectsTask
     {
         return scmRootAddress;
     }
+
+    public int getScmRootId()
+    {
+        return scmRootId;
+    }
+
+    public int getHashCode()
+    {
+    	return projectGroupId + scmRootId + buildTrigger.getTrigger();
+    }
 }



Mime
View raw message