continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r732595 - in /continuum/branches/continuum-distributed-builds: continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/ continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ continuum-builde...
Date Thu, 08 Jan 2009 03:14:04 GMT
Author: ctan
Date: Wed Jan  7 19:14:03 2009
New Revision: 732595

URL: http://svn.apache.org/viewvc?rev=732595&view=rev
Log:
-added notification
-use build environments when building
-refactored DefaultDistributedBuildManager

Added:
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/builder/
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/builder/distributed/
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
      - copied, changed from r731857, continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
Removed:
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/
    continuum/branches/continuum-distributed-builds/continuum-builder/src/test/java/org/
Modified:
    continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ContinuumAgentBuildExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ant/AntBuildExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/MavenOneBuildExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/MavenTwoBuildExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/shell/ShellBuildExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java

Modified: continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java Wed Jan  7 19:14:03 2009
@@ -44,4 +44,7 @@
 
     Map<String, Object> getBuildResult( int projectId )
         throws ContinuumException;
+
+    Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
+        throws ContinuumException;
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java Wed Jan  7 19:14:03 2009
@@ -14,6 +14,7 @@
 import org.apache.continuum.dao.ProjectScmRootDao;
 import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportClient;
 import org.apache.continuum.model.project.ProjectScmRoot;
+import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
 import org.apache.continuum.utils.ContinuumUtils;
 import org.apache.continuum.utils.ProjectSorter;
@@ -143,6 +144,17 @@
                 context.put( ContinuumBuildConstant.KEY_SCM_URL, project.getScmUrl() );
                 context.put( ContinuumBuildConstant.KEY_PROJECT_STATE, new Integer( project.getState() ) );
 
+                LocalRepository localRepo = project.getProjectGroup().getLocalRepository();
+
+                if ( localRepo != null )
+                {
+                    context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, localRepo.getLocation() );
+                }
+                else
+                {
+                    context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, "" );
+                }
+
                 if ( project.getScmUsername() == null )
                 {
                     context.put( ContinuumBuildConstant.KEY_SCM_USERNAME, "" );

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java Wed Jan  7 19:14:03 2009
@@ -70,6 +70,8 @@
 
     public static final String KEY_INSTALLATION_VAR_VALUE = "installation-var-value";
 
+    public static final String KEY_LOCAL_REPOSITORY = "local-repository";
+
     public static int getProjectId( Map context )
     {
         return getInteger( context, KEY_PROJECT_ID );

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml (original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml Wed Jan  7 19:14:03 2009
@@ -19,29 +19,6 @@
 
 <component-set>
   <components>
-    
-    <component>
-      <role>org.apache.continuum.builder.distributed.manager.DistributedBuildManager</role>
-      <role-hint>default</role-hint>
-      <implementation>org.apache.continuum.builder.distributed.manager.DefaultDistributedBuildManager</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.continuum.dao.ProjectDao</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.continuum.dao.ProjectScmRootDao</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.continuum.dao.BuildResultDao</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.continuum.dao.BuildDefinitionDao</role>
-        </requirement>
-      </requirements>
-    </component>
   
     <!--
      |

Copied: continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java (from r731857, continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java)
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?p2=continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java&p1=continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java&r1=731857&r2=732595&rev=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java Wed Jan  7 19:14:03 2009
@@ -7,6 +7,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -26,12 +27,15 @@
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectDependency;
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
+import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
@@ -51,6 +55,7 @@
 
 /**
  * @author Maria Catherine Tan
+ * @plexus.component role="org.apache.continuum.builder.distributed.manager.DistributedBuildManager"
  */
 public class DefaultDistributedBuildManager
     implements DistributedBuildManager, Contextualizable, Initializable
@@ -65,6 +70,11 @@
     /**
      * @plexus.requirement
      */
+    private InstallationService installationService;
+
+    /**
+     * @plexus.requirement
+     */
     private ProjectDao projectDao;
 
     /**
@@ -82,6 +92,11 @@
      */
     private BuildResultDao buildResultDao;
 
+    /**
+     * @plexus.requirement
+     */
+    private ContinuumNotificationDispatcher notifierDispatcher;
+
     private PlexusContainer container;
 
     private Map<String, ThreadedDistributedBuildTaskQueueExecutor> taskQueueExecutors;
@@ -381,10 +396,10 @@
             out.write( ContinuumBuildConstant.getBuildOutput( context ) == null ? "" : ContinuumBuildConstant.getBuildOutput( context ) );
             out.close();
 
-            //if ( buildResult.getState() != ContinuumProjectState.CANCELLED )
-            //{
-            //    notifierDispatcher.buildComplete( project, buildDefinition, buildResult );
-            //}
+            if ( buildResult.getState() != ContinuumProjectState.CANCELLED )
+            {
+                notifierDispatcher.buildComplete( project, buildDefinition, buildResult );
+            }
         }
         catch ( ContinuumStoreException e )
         {
@@ -424,7 +439,7 @@
 
             projectScmRootDao.updateProjectScmRoot( scmRoot );
 
-            //notifierDispatcher.prepareBuildComplete( scmRoot );
+            notifierDispatcher.prepareBuildComplete( scmRoot );
         }
         catch ( ContinuumStoreException e )
         {
@@ -635,6 +650,40 @@
         return map;
     }
 
+    public Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
+        throws ContinuumException
+    {
+        BuildDefinition buildDefinition;
+
+        try
+        {
+            buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ContinuumException( "Failed to retrieve build definition: " + buildDefinitionId, e );
+        }
+
+        Profile profile = buildDefinition.getProfile();
+        if ( profile == null )
+        {
+            return Collections.EMPTY_MAP;
+        }
+        Map<String, String> envVars = new HashMap<String, String>();
+        String javaHome = getJavaHomeValue( buildDefinition );
+        if ( !StringUtils.isEmpty( javaHome ) )
+        {
+            envVars.put( installationService.getEnvVar( InstallationService.JDK_TYPE ), javaHome );
+        }
+        Installation builder = profile.getBuilder();
+        if ( builder != null )
+        {
+            envVars.put( installationService.getEnvVar( installationType ), builder.getVarValue() );
+        }
+        envVars.putAll( getEnvironmentVariables( buildDefinition ) );
+        return envVars;
+    }
+
     private String getBuildAgent( int projectId )
         throws ContinuumException
     {
@@ -669,4 +718,40 @@
 
         return buildResult;
     }
+
+    private String getJavaHomeValue( BuildDefinition buildDefinition )
+    {
+        Profile profile = buildDefinition.getProfile();
+        if ( profile == null )
+        {
+            return null;
+        }
+        Installation jdk = profile.getJdk();
+        if ( jdk == null )
+        {
+            return null;
+        }
+        return jdk.getVarValue();
+    }
+
+    private Map<String, String> getEnvironmentVariables( BuildDefinition buildDefinition )
+    {
+        Profile profile = buildDefinition.getProfile();
+        Map<String, String> envVars = new HashMap<String, String>();
+        if ( profile == null )
+        {
+            return envVars;
+        }
+        List<Installation> environmentVariables = profile.getEnvironmentVariables();
+        if ( environmentVariables.isEmpty() )
+        {
+            return envVars;
+        }
+        for ( Installation installation : environmentVariables )
+        {
+            envVars.put( installation.getVarName(), installation.getVarValue() );
+        }
+        return envVars;
+    }
+
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java Wed Jan  7 19:14:03 2009
@@ -164,7 +164,7 @@
         LocalRepository repository = project.getProjectGroup().getLocalRepository();
         if ( repository != null )
         {
-            arguments.append( "\"-Dmaven.repo.local=" ).append( StringUtils.clean(repository.getLocation() ) ).append( "\" " );
+            arguments.append( "\"-Dmaven.repo.local=" ).append( StringUtils.clean( repository.getLocation() ) ).append( "\" " );
         }
         
         arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );

Modified: continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java Wed Jan  7 19:14:03 2009
@@ -772,7 +772,10 @@
 
             message.setSentDate( new Date() );
 
-            javaMailSender.send( message );
+            if ( message.getAllRecipients() != null && ( (Address[]) message.getAllRecipients() ).length > 0 )
+            {
+                javaMailSender.send( message );
+            }
         }
         catch ( AddressException ex )
         {
@@ -873,7 +876,10 @@
 
             message.setSentDate( new Date() );
 
-            javaMailSender.send( message );
+            if ( message.getAllRecipients() != null && ( (Address[]) message.getAllRecipients() ).length > 0 )
+            {
+                javaMailSender.send( message );
+            }
         }
         catch ( AddressException ex )
         {

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java Wed Jan  7 19:14:03 2009
@@ -228,6 +228,7 @@
             context.setProjectName( ContinuumBuildAgentUtil.getProjectName( map ) );
             context.setProjectState( ContinuumBuildAgentUtil.getProjectState( map ) );
             context.setTrigger( ContinuumBuildAgentUtil.getTrigger( map ) );
+            context.setLocalRepository( ContinuumBuildAgentUtil.getLocalRepository( map ) );
 
             buildContext.add( context );
         }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java Wed Jan  7 19:14:03 2009
@@ -43,6 +43,10 @@
 
         BuildDefinition buildDefinition = ContinuumBuildAgentUtil.getBuildDefinition( context );
 
+        Map<String, String> environments = ContinuumBuildAgentUtil.getEnvironments( context );
+
+        String localRepository = ContinuumBuildAgentUtil.getLocalRepository( context );
+
         int trigger = ContinuumBuildAgentUtil.getTrigger( context );
 
         ContinuumAgentBuildExecutor buildExecutor = buildAgentBuildExecutorManager.getBuildExecutor( project.getExecutorId() );
@@ -67,7 +71,8 @@
         {
             File buildOutputFile = buildAgentConfigurationService.getBuildOutputFile( project.getId() );
 
-            ContinuumAgentBuildExecutionResult result = buildExecutor.build( project, buildDefinition, buildOutputFile );
+            ContinuumAgentBuildExecutionResult result = buildExecutor.build( project, buildDefinition, buildOutputFile,
+                                                                             environments, localRepository );
 
             buildResult.setState( result.getExitCode() == 0 ? ContinuumProjectState.OK : ContinuumProjectState.FAILED );
 

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ContinuumAgentBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ContinuumAgentBuildExecutor.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ContinuumAgentBuildExecutor.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ContinuumAgentBuildExecutor.java Wed Jan  7 19:14:03 2009
@@ -2,6 +2,7 @@
 
 import java.io.File;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -11,7 +12,8 @@
 {
     String ROLE = ContinuumAgentBuildExecutor.class.getName();
 
-    ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput )
+    ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput,
+                                              Map<String, String> environments, String localRepository )
         throws ContinuumAgentBuildExecutorException, ContinuumAgentBuildCancelledException;
     
     boolean isBuilding( Project project );

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ant/AntBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ant/AntBuildExecutor.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ant/AntBuildExecutor.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/ant/AntBuildExecutor.java Wed Jan  7 19:14:03 2009
@@ -2,6 +2,7 @@
 
 import java.io.File;
 import java.util.Enumeration;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.continuum.buildagent.build.execution.AbstractBuildExecutor;
@@ -30,7 +31,9 @@
         super( ID, true );
     }
 
-    public ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput )
+    public ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, 
+                                                     File buildOutput, Map<String, String> environments,
+                                                     String localRepository )
         throws ContinuumAgentBuildExecutorException, ContinuumAgentBuildCancelledException
     {
         String executable = getBuildAgentInstallationService().getExecutorConfigurator( BuildAgentInstallationService.ANT_TYPE )
@@ -54,9 +57,22 @@
             String value = props.getProperty( name );
             arguments.append( "\"-D" ).append( name ).append( "=" ).append( value ).append( "\" " );
         }
-    
+
         arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
 
-        return executeShellCommand( project, executable, arguments.toString(), buildOutput, null );
+        String antHome = null;
+
+        if ( environments != null )
+        {
+            antHome = environments.get( getBuildAgentInstallationService().getEnvVar( BuildAgentInstallationService.ANT_TYPE ) );
+        }
+
+        if ( StringUtils.isNotEmpty( antHome ) )
+        {
+            executable = antHome + File.separator + "bin" + File.separator + executable;
+            setResolveExecutable( false );
+        }
+
+        return executeShellCommand( project, executable, arguments.toString(), buildOutput, environments );
     }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/MavenOneBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/MavenOneBuildExecutor.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/MavenOneBuildExecutor.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/MavenOneBuildExecutor.java Wed Jan  7 19:14:03 2009
@@ -2,6 +2,7 @@
 
 import java.io.File;
 import java.util.Enumeration;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.continuum.buildagent.build.execution.AbstractBuildExecutor;
@@ -28,7 +29,9 @@
         super( ID, true );
     }
 
-    public ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput )
+    public ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, 
+                                                     File buildOutput, Map<String, String> environments,
+                                                     String localRepository )
         throws ContinuumAgentBuildExecutorException, ContinuumAgentBuildCancelledException
     {
         String executable = getBuildAgentInstallationService().getExecutorConfigurator( BuildAgentInstallationService.MAVEN1_TYPE )
@@ -52,10 +55,28 @@
             String value = props.getProperty( name );
             arguments.append( "\"-D" ).append( name ).append( "=" ).append( value ).append( "\" " );
         }
-        
+
+        if ( StringUtils.isNotEmpty( localRepository ) )
+        {
+            arguments.append( "\"-Dmaven.repo.local=" ).append( StringUtils.clean( localRepository ) ).append( "\" " );
+        }
+
         arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
-    
-        return executeShellCommand( project, executable, arguments.toString(), buildOutput, null );
+
+        String m1Home = null;
+
+        if ( environments != null )
+        {
+            m1Home = environments.get( getBuildAgentInstallationService().getEnvVar( BuildAgentInstallationService.MAVEN1_TYPE ) );
+        }
+
+        if ( StringUtils.isNotEmpty( m1Home ) )
+        {
+            executable = m1Home + File.separator + "bin" + File.separator + executable;
+                setResolveExecutable( false );
+        }
+
+        return executeShellCommand( project, executable, arguments.toString(), buildOutput, environments );
     }
 
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/MavenTwoBuildExecutor.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/MavenTwoBuildExecutor.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/MavenTwoBuildExecutor.java Wed Jan  7 19:14:03 2009
@@ -4,6 +4,7 @@
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.continuum.buildagent.build.execution.AbstractBuildExecutor;
@@ -66,7 +67,9 @@
         this.builderHelper = builderHelper;
     }
 
-    public ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput )
+    public ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, 
+                                                     File buildOutput, Map<String, String> environments,
+                                                     String localRepository )
         throws ContinuumAgentBuildExecutorException, ContinuumAgentBuildCancelledException
     {
         String executable = getBuildAgentInstallationService().getExecutorConfigurator( BuildAgentInstallationService.MAVEN2_TYPE )
@@ -93,9 +96,27 @@
         }
         */
 
+        if ( StringUtils.isNotEmpty( localRepository ) )
+        {
+            arguments.append( "\"-Dmaven.repo.local=" ).append( StringUtils.clean( localRepository ) ).append( "\" " );
+        }
+
         arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
 
-        return executeShellCommand( project, executable, arguments.toString(), buildOutput, null );
+        String m2Home = null;
+
+        if ( environments != null )
+        {
+            m2Home = environments.get( getBuildAgentInstallationService().getEnvVar( BuildAgentInstallationService.MAVEN2_TYPE ) );
+        }
+
+        if ( StringUtils.isNotEmpty( m2Home ) )
+        {
+            executable = m2Home + File.separator + "bin" + File.separator + executable;
+            setResolveExecutable( false );
+        }
+
+        return executeShellCommand( project, executable, arguments.toString(), buildOutput, environments );
     }
 
     @Override

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/shell/ShellBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/shell/ShellBuildExecutor.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/shell/ShellBuildExecutor.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/shell/ShellBuildExecutor.java Wed Jan  7 19:14:03 2009
@@ -1,6 +1,7 @@
 package org.apache.continuum.buildagent.build.execution.shell;
 
 import java.io.File;
+import java.util.Map;
 
 import org.apache.continuum.buildagent.build.execution.AbstractBuildExecutor;
 import org.apache.continuum.buildagent.build.execution.ContinuumAgentBuildCancelledException;
@@ -24,11 +25,13 @@
         super( ID, false );
     }
 
-    public ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput )
+    public ContinuumAgentBuildExecutionResult build( Project project, BuildDefinition buildDefinition, 
+                                                     File buildOutput, Map<String, String> environments,
+                                                     String localRepository )
         throws ContinuumAgentBuildExecutorException, ContinuumAgentBuildCancelledException
     {
         String executable = getBuildFileForProject( project, buildDefinition );
 
-        return executeShellCommand( project, executable, buildDefinition.getArguments(), buildOutput, null );
+        return executeShellCommand( project, executable, buildDefinition.getArguments(), buildOutput, environments );
     }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java Wed Jan  7 19:14:03 2009
@@ -45,6 +45,8 @@
 
     private long buildStartTime;
 
+    private String localRepository;
+
     public int getProjectGroupId()
     {
         return projectGroupId;
@@ -234,4 +236,14 @@
     {
         this.buildStartTime = buildStartTime;
     }
+
+    public String getLocalRepository()
+    {
+        return localRepository;
+    }
+
+    public void setLocalRepository( String localRepository )
+    {
+        this.localRepository = localRepository;
+    }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.java Wed Jan  7 19:14:03 2009
@@ -21,4 +21,6 @@
      * @return ExecutorConfigurator or null if unknown type
      */
     public ExecutorConfigurator getExecutorConfigurator( String type );
+
+    public String getEnvVar( String type );
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.java Wed Jan  7 19:14:03 2009
@@ -35,4 +35,10 @@
         this.typesValues
             .put( BuildAgentInstallationService.MAVEN2_TYPE, new ExecutorConfigurator( "mvn", "bin", "M2_HOME", "-v" ) );
     }
+
+    public String getEnvVar( String type )
+    {
+        ExecutorConfigurator executorConfigurator = this.typesValues.get( type );
+        return executorConfigurator == null ? null : executorConfigurator.getEnvVar();
+    }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.java Wed Jan  7 19:14:03 2009
@@ -18,4 +18,7 @@
     
     void startProjectBuild( int projectId )
         throws ContinuumException;
+
+    Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
+        throws ContinuumException;
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java Wed Jan  7 19:14:03 2009
@@ -147,6 +147,27 @@
         }
     }
 
+    public Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
+        throws ContinuumException
+    {
+        try
+        {
+            MasterBuildAgentTransportClient client = new MasterBuildAgentTransportClient(
+                new URL( buildAgentConfigurationService.getContinuumServerUrl() ) );
+            return client.getEnvironments( buildDefinitionId, installationType );
+        }
+        catch ( MalformedURLException e )
+        {
+            log.error( "Invalid continuum server URL '" + buildAgentConfigurationService.getContinuumServerUrl() + "'" );
+            throw new ContinuumException( "Invalid continuum server URL '" + buildAgentConfigurationService.getContinuumServerUrl() + "'" );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Error while retrieving environments for build definition " + buildDefinitionId, e );
+            throw new ContinuumException( e.getMessage(), e );
+        }
+    }
+
     private void startPrepareBuild( BuildContext buildContext )
         throws ContinuumException
     {

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/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-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java Wed Jan  7 19:14:03 2009
@@ -10,12 +10,15 @@
 import org.apache.continuum.buildagent.buildcontext.BuildContext;
 import org.apache.continuum.buildagent.buildcontext.manager.BuildContextManager;
 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.utils.BuildContextToBuildDefinition;
 import org.apache.continuum.buildagent.utils.BuildContextToProject;
 import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.scm.ScmException;
@@ -93,6 +96,7 @@
     }
 
     private void initializeBuildContext( BuildContext buildContext )
+        throws TaskExecutionException
     {
         Map<String, Object> actionContext = buildContext.getActionContext();
 
@@ -100,6 +104,9 @@
         actionContext.put( ContinuumBuildAgentUtil.KEY_PROJECT, BuildContextToProject.getProject( buildContext ) );
         actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION, BuildContextToBuildDefinition.getBuildDefinition( buildContext ) );
         actionContext.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_ENVIRONMENTS, getEnvironments( buildContext.getBuildDefinitionId(), 
+                                                                                      getInstallationType( buildContext ) ) );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_LOCAL_REPOSITORY, buildContext.getLocalRepository() );
 
         buildContext.setBuildStartTime( System.currentTimeMillis() );
     }
@@ -281,4 +288,38 @@
 
         return null;
     }
+
+    private Map<String, String> getEnvironments( int buildDefinitionId, String installationType )
+        throws TaskExecutionException
+    {
+        try
+        {
+            return buildAgentManager.getEnvironments( buildDefinitionId, installationType );
+        }
+        catch ( ContinuumException e )
+        {
+            log.error( "Error while retrieving environments of build definition: " + buildDefinitionId, e );
+            throw new TaskExecutionException( "Error while retrieving environments of build definition: " + buildDefinitionId, e );
+        }
+    }
+
+    private String getInstallationType( BuildContext buildContext )
+    {
+        String executorId = buildContext.getExecutorId();
+        
+        if ( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR.equals( executorId ) )
+        {
+            return BuildAgentInstallationService.MAVEN2_TYPE;
+        }
+        else if ( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR.equals( executorId ) )
+        {
+            return BuildAgentInstallationService.MAVEN1_TYPE;
+        }
+        else if ( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR.equals( executorId ) )
+        {
+            return BuildAgentInstallationService.ANT_TYPE;
+        }
+
+        return null;
+    }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java Wed Jan  7 19:14:03 2009
@@ -95,6 +95,10 @@
 
     public static final String KEY_INSTALLATION_VAR_VALUE = "installation-var-value";
 
+    public static final String KEY_ENVIRONMENTS = "environments";
+
+    public static final String KEY_LOCAL_REPOSITORY = "local-repository";
+
     public static Integer getProjectId( Map context )
     {
         return getInteger( context, KEY_PROJECT_ID );
@@ -205,6 +209,16 @@
         return (BuildResult) getObject( context, KEY_BUILD_RESULT );
     }
 
+    public static Map<String, String> getEnvironments( Map context )
+    {
+        return (Map<String, String>) getObject( context, KEY_ENVIRONMENTS );
+    }
+
+    public static String getLocalRepository( Map context )
+    {
+        return (String) getObject( context, KEY_LOCAL_REPOSITORY );
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java Wed Jan  7 19:14:03 2009
@@ -39,5 +39,7 @@
 
     public Boolean startPrepareBuild( Map prepareBuildResult ) throws Exception;
 
+    public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType ) throws Exception;
+
     public Boolean ping() throws Exception;
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java Wed Jan  7 19:14:03 2009
@@ -176,4 +176,22 @@
 
         return result;
     }
+
+    public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType )
+        throws Exception
+    {
+        Map<String, String> result = null;
+        try
+        {
+            result = master.getEnvironments( buildDefinitionId, installationType );
+            log.info( "Retrieved environments" );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Failed to retrieve environments", e );
+            throw new Exception( "Failed to retrieve environments", e );
+        }
+
+        return result;
+    }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java?rev=732595&r1=732594&r2=732595&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java (original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-distributed-build-transport/continuum-distributed-build-transport-master/continuum-distributed-build-transport-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java Wed Jan  7 19:14:03 2009
@@ -88,4 +88,11 @@
         distributedBuildManager.startPrepareBuild( prepareBuildResult );
         return Boolean.TRUE;
     }
+
+    public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType )
+        throws Exception
+    {
+        log.info( "Retrieving environments" );
+        return distributedBuildManager.getEnvironments( buildDefinitionId, installationType );
+    }
 }



Mime
View raw message