org.apache.maven.continuum.execution
Class AbstractBuildExecutor

java.lang.Object
  extended by org.apache.maven.continuum.execution.AbstractBuildExecutor
All Implemented Interfaces:
ContinuumBuildExecutor, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Direct Known Subclasses:
AntBuildExecutor, MavenOneBuildExecutor, MavenTwoBuildExecutor, ShellBuildExecutor

public abstract class AbstractBuildExecutor
extends Object
implements ContinuumBuildExecutor, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

Version:
$Id: AbstractBuildExecutor.java 1372260 2012-08-13 04:29:09Z brett $
Author:
Trygve Laugstøl

Field Summary
protected  org.slf4j.Logger log
           
 
Fields inherited from interface org.apache.maven.continuum.execution.ContinuumBuildExecutor
ROLE
 
Constructor Summary
protected AbstractBuildExecutor(String id, boolean resolveExecutable)
           
 
Method Summary
 void backupTestFiles(Project project, int buildId, String projectScmRootUrl, List<Project> projectsWithCommonScmRoot)
           
protected  ContinuumBuildExecutionResult executeShellCommand(Project project, String executable, String arguments, File output, Map<String,String> environments, List<Project> projectsWithCommonScmRoot, String projectScmRootUrl)
           
protected  String findExecutable(String executable, String defaultExecutable, boolean resolveExecutable, File workingDirectory)
          Find the actual executable path to be used
protected  String getBuildFileForProject(Project project, BuildDefinition buildDefinition)
           
 File getChrootJailDirectory()
           
protected  Properties getContinuumSystemProperties(Project project)
           
 String getDefaultExecutable()
           
 List<org.apache.maven.artifact.Artifact> getDeployableArtifacts(Project project, File workingDirectory, BuildDefinition buildDefinition)
           
protected abstract  Map<String,String> getEnvironments(BuildDefinition buildDefinition)
           
protected  Map<String,String> getEnvironmentVariables(BuildDefinition buildDefinition)
           
 org.codehaus.plexus.commandline.ExecutableResolver getExecutableResolver()
           
 InstallationService getInstallationService()
           
protected  String getJavaHomeValue(BuildDefinition buildDefinition)
           
 ShellCommandHelper getShellCommandHelper()
           
 File getWorkingDirectory(Project project, String projectScmRootUrl, List<Project> projectsWithCommonScmRoot)
           
 WorkingDirectoryService getWorkingDirectoryService()
           
 void initialize()
           
 boolean isBuilding(Project project)
           
protected  boolean isDescriptionUpdated(BuildDefinition buildDefinition, ScmResult scmResult, Project project)
           
 boolean isResolveExecutable()
           
 void killProcess(Project project)
           
 void setChrootJailDirectory(File chrootJailDirectory)
           
 void setDefaultExecutable(String defaultExecutable)
           
 void setExecutableResolver(org.codehaus.plexus.commandline.ExecutableResolver executableResolver)
           
 void setInstallationService(InstallationService installationService)
           
 void setResolveExecutable(boolean resolveExecutable)
           
 void setShellCommandHelper(ShellCommandHelper shellCommandHelper)
           
 void setWorkingDirectoryService(WorkingDirectoryService workingDirectoryService)
           
 boolean shouldBuild(List<ChangeSet> changes, Project continuumProject, File workingDirectory, BuildDefinition buildDefinition)
          By default, we return true because with a change, the project must be rebuilt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.continuum.execution.ContinuumBuildExecutor
build, updateProjectFromCheckOut
 

Field Detail

log

protected final org.slf4j.Logger log
Constructor Detail

AbstractBuildExecutor

protected AbstractBuildExecutor(String id,
                                boolean resolveExecutable)
Method Detail

setShellCommandHelper

public void setShellCommandHelper(ShellCommandHelper shellCommandHelper)

getShellCommandHelper

public ShellCommandHelper getShellCommandHelper()

setWorkingDirectoryService

public void setWorkingDirectoryService(WorkingDirectoryService workingDirectoryService)

getWorkingDirectoryService

public WorkingDirectoryService getWorkingDirectoryService()

setDefaultExecutable

public void setDefaultExecutable(String defaultExecutable)

getDefaultExecutable

public String getDefaultExecutable()

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException

findExecutable

protected String findExecutable(String executable,
                                String defaultExecutable,
                                boolean resolveExecutable,
                                File workingDirectory)
Find the actual executable path to be used

Parameters:
defaultExecutable -
Returns:
The executable path

executeShellCommand

protected ContinuumBuildExecutionResult executeShellCommand(Project project,
                                                            String executable,
                                                            String arguments,
                                                            File output,
                                                            Map<String,String> environments,
                                                            List<Project> projectsWithCommonScmRoot,
                                                            String projectScmRootUrl)
                                                     throws ContinuumBuildExecutorException
Throws:
ContinuumBuildExecutorException

getEnvironments

protected abstract Map<String,String> getEnvironments(BuildDefinition buildDefinition)

getJavaHomeValue

protected String getJavaHomeValue(BuildDefinition buildDefinition)

backupTestFiles

public void backupTestFiles(Project project,
                            int buildId,
                            String projectScmRootUrl,
                            List<Project> projectsWithCommonScmRoot)
Specified by:
backupTestFiles in interface ContinuumBuildExecutor

shouldBuild

public boolean shouldBuild(List<ChangeSet> changes,
                           Project continuumProject,
                           File workingDirectory,
                           BuildDefinition buildDefinition)
                    throws ContinuumBuildExecutorException
By default, we return true because with a change, the project must be rebuilt.

Specified by:
shouldBuild in interface ContinuumBuildExecutor
Throws:
ContinuumBuildExecutorException

getEnvironmentVariables

protected Map<String,String> getEnvironmentVariables(BuildDefinition buildDefinition)

getContinuumSystemProperties

protected Properties getContinuumSystemProperties(Project project)

getBuildFileForProject

protected String getBuildFileForProject(Project project,
                                        BuildDefinition buildDefinition)

isDescriptionUpdated

protected boolean isDescriptionUpdated(BuildDefinition buildDefinition,
                                       ScmResult scmResult,
                                       Project project)

isBuilding

public boolean isBuilding(Project project)
Specified by:
isBuilding in interface ContinuumBuildExecutor

killProcess

public void killProcess(Project project)
Specified by:
killProcess in interface ContinuumBuildExecutor

getDeployableArtifacts

public List<org.apache.maven.artifact.Artifact> getDeployableArtifacts(Project project,
                                                                       File workingDirectory,
                                                                       BuildDefinition buildDefinition)
                                                                throws ContinuumBuildExecutorException
Specified by:
getDeployableArtifacts in interface ContinuumBuildExecutor
Throws:
ContinuumBuildExecutorException

getWorkingDirectory

public File getWorkingDirectory(Project project,
                                String projectScmRootUrl,
                                List<Project> projectsWithCommonScmRoot)

getInstallationService

public InstallationService getInstallationService()

setInstallationService

public void setInstallationService(InstallationService installationService)

isResolveExecutable

public boolean isResolveExecutable()

setResolveExecutable

public void setResolveExecutable(boolean resolveExecutable)

setExecutableResolver

public void setExecutableResolver(org.codehaus.plexus.commandline.ExecutableResolver executableResolver)

getExecutableResolver

public org.codehaus.plexus.commandline.ExecutableResolver getExecutableResolver()

setChrootJailDirectory

public void setChrootJailDirectory(File chrootJailDirectory)

getChrootJailDirectory

public File getChrootJailDirectory()


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.