com.atlassian.bamboo.builder
Class AbstractMavenBuilder

java.lang.Object
  extended by com.atlassian.bamboo.command.Command
      extended by com.atlassian.bamboo.builder.AbstractBuilder
          extended by com.atlassian.bamboo.builder.AbstractMavenBuilder
All Implemented Interfaces:
Builder
Direct Known Subclasses:
Maven2Builder, MavenBuilder

public abstract class AbstractMavenBuilder
extends AbstractBuilder


Field Summary
static String CUSTOM_TEST_DIRECTORY_SELECTED
           
protected  String myGoal
           
protected  String myMavenHome
           
protected  String myTestDirectoryOption
           
static String PARAM_GOAL
           
static String PARAM_TEST_DIRECTORY_OPTION
           
static String STANDARD_TEST_DIRECTORY_SELECTED
           
 
Fields inherited from class com.atlassian.bamboo.builder.AbstractBuilder
builderManager, DEFAULT_TEST_REPORTS_XML, PARAM_BUILD_LABEL, PARAM_BUILDJDK, PARAM_ENV_VAR, PARAM_HASTESTS, PARAM_HOME, PARAM_TEST_RESULTS_DIRECTORY, PARAM_WORKING_SUB_DIR, pluginManager, templateRenderer, velocityManager
 
Constructor Summary
AbstractMavenBuilder()
           
 
Method Summary
 void addDefaultValues(BuildConfiguration configuration)
           
 Commandline getCommandLine()
          Get the maven command line to execute the build
protected abstract  String getDefaultTestReportsDirectory()
           
protected abstract  String getExecutableFileName()
          Gets the executable file name
 Map getFullParams()
          Subclasses should extend this method rather than Builder.getFilteredParams() since it calls back on this method (getFillParams)
 String getGoal()
          Which goal will maven use to build the build?
protected  String getMavenExecutablePath(String homePath)
           
protected  Map getTemplateContext()
           
 String getTestDirectory()
          Which test directory option are we using "standardTestDirectory:, or a "customTestDirectory"
 String getTestResultsDirectory()
          Return the default
protected  boolean hasPassed(int returnCode)
           
 boolean isPathValid(String homeDirectory)
          Does the home dir contain /bin/ant?
 void setGoal(String goal)
          Set the goal that the build will execute.
 void setParams(FilteredMap filteredBuilderParams)
           
 void setTestDirectory(String testDirectory)
          Let the UI specify which test directory option we're using - standard or custom.
 ErrorCollection validate(BuildConfiguration buildConfiguration)
           
 ErrorCollection validate(FilteredMap filteredParams)
          Validate that the goal has been defined
 
Methods inherited from class com.atlassian.bamboo.builder.AbstractBuilder
build, collateTestResults, customiseLabelPathMaps, filterParameters, getAdminConfig, getBuildJdk, getCompleteKey, getEditHtml, getEnvironmentVariables, getFilteredParams, getFreemarkerEditHtml, getLabel, getPath, getPathHelp, getTestChecked, getViewHtml, getWorkingDirectory, getWorkingSubDirectory, hasTests, init, isLabelPathMapConfigurable, outputEndsWith, setAdminConfig, setBuildDir, setBuilderManager, setBuildJdk, setEnvironmentVariables, setHasTests, setLabel, setPluginManager, setTemplateRenderer, setTestChecked, setTestResultsDirectory, setVelocityManager, setWorkingSubDirectory, toString, validate
 
Methods inherited from class com.atlassian.bamboo.command.Command
executeCommand, getEnvironmentSetting, getErrorOutput, getOutput, hasErrors, isExecutableExists, isWindowsPlatform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.builder.Builder
addDefaultLabelPathMaps, getKey, getName
 

Field Detail

myMavenHome

protected transient String myMavenHome

myGoal

protected String myGoal

myTestDirectoryOption

protected String myTestDirectoryOption

PARAM_GOAL

public static final String PARAM_GOAL
See Also:
Constant Field Values

PARAM_TEST_DIRECTORY_OPTION

public static final String PARAM_TEST_DIRECTORY_OPTION
See Also:
Constant Field Values

CUSTOM_TEST_DIRECTORY_SELECTED

public static final String CUSTOM_TEST_DIRECTORY_SELECTED
See Also:
Constant Field Values

STANDARD_TEST_DIRECTORY_SELECTED

public static final String STANDARD_TEST_DIRECTORY_SELECTED
See Also:
Constant Field Values
Constructor Detail

AbstractMavenBuilder

public AbstractMavenBuilder()
Method Detail

hasPassed

protected boolean hasPassed(int returnCode)
Overrides:
hasPassed in class AbstractBuilder

getCommandLine

public Commandline getCommandLine()
Get the maven command line to execute the build

Specified by:
getCommandLine in class Command
Returns:
The command line

getMavenExecutablePath

protected String getMavenExecutablePath(String homePath)

getExecutableFileName

protected abstract String getExecutableFileName()
Gets the executable file name


setGoal

public void setGoal(String goal)
Set the goal that the build will execute. This can be a single goal, such as "java:compile", or multiple goals, such as "clean test".

Parameters:
goal - The maven goal

getGoal

public String getGoal()
Which goal will maven use to build the build?

Returns:
the name of the Maven goal

getTestResultsDirectory

public String getTestResultsDirectory()
Return the default

Specified by:
getTestResultsDirectory in interface Builder
Overrides:
getTestResultsDirectory in class AbstractBuilder
Returns:
maven test results

getDefaultTestReportsDirectory

protected abstract String getDefaultTestReportsDirectory()

getTestDirectory

public String getTestDirectory()
Which test directory option are we using "standardTestDirectory:, or a "customTestDirectory"


setTestDirectory

public void setTestDirectory(String testDirectory)
Let the UI specify which test directory option we're using - standard or custom.

Parameters:
testDirectory -

setParams

public void setParams(FilteredMap filteredBuilderParams)
Specified by:
setParams in interface Builder
Overrides:
setParams in class AbstractBuilder

validate

public ErrorCollection validate(FilteredMap filteredParams)
Validate that the goal has been defined

Parameters:
filteredParams -
Returns:
The collection of validation errors. An empty list if there are no errors

validate

public ErrorCollection validate(BuildConfiguration buildConfiguration)

addDefaultValues

public void addDefaultValues(BuildConfiguration configuration)

getFullParams

public Map getFullParams()
Description copied from interface: Builder
Subclasses should extend this method rather than Builder.getFilteredParams() since it calls back on this method (getFillParams)

Specified by:
getFullParams in interface Builder
Overrides:
getFullParams in class AbstractBuilder
Returns:
Map key by the full param key (e.g. builder.ant.label). Never null

isPathValid

public boolean isPathValid(String homeDirectory)
Does the home dir contain /bin/ant?

Parameters:
homeDirectory -
Returns:
true if valid

getTemplateContext

protected Map getTemplateContext()
Overrides:
getTemplateContext in class AbstractBuilder


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.