This page describes how to configure an Ant executable for a Task. When creating a new Job or configuring an existing one, you need to specify the Tasks that will execute the Job's builds. You must specify an executable for each Task. If you specify an Ant, Grails or Maven executable, you will also need to choose a JDK. When creating a new Plan, you can configure the Tasks for the Plan's default Job. An executable is a program external to Bamboo used to automate processes. Generally, executables compile source code to generate compiled executable files (referred to as artifacts in Bamboo). Ant, Maven, MSBuild or PHPUnit are just some examples of executables that can be used as part of your build process.New executables can be defined as capabilities in Bamboo. Once an executable has been defined in Bamboo, it can be configured as part of a Task. |
On this page: |
Configuring an Ant Executable for a Task
To configure an Ant executable for a Task:
- Navigate to the Task configuration for the Job (this will be the default Job if creating a new Plan).
- Click the name of the desired Ant Task, or click 'Add Task' and then 'Ant' if creating a new Task.
- In the 'Executable' dropdown, select the Ant executable that you wish to configure for this Task (e.g. "Ant"). The executable that you select will become one of the Task's capability requirements (and hence, one of the Job's requirements). For details, please see Configuring a Job's Requirements.
- The screen will refresh to display the fields specific to Ant:
- 'Task Description' --— Enter a description of the Task, for display in Bamboo.
- 'Build File' — Type the relevant filename (e.g.
build.xml
). You can include variables (see Using Global or Build-specific Variables). - 'Target' — Specify the Ant target that you want Bamboo to execute each time the source code changes. For example:
test
(this will run the Ant target 'test'). You can also use '-D' to define one or more JVM parameters, e.g.:-Djava.awt.headless=true
(this will pass the parameter 'java.awt.headless' with a value of 'true'). Multiple Ant targets can be specified with a space-delimited list. You can also include variables (see Using Global or Build-specific Variables). - 'Build JDK' — Choose a JDK from the list. The JDK that you select will become one of the Job's capability requirements. For details please see Configuring a Job's Requirements.
Specifying Generic JDK Requirements - Configuring generic JDK capabilities — If you want to indicate that an agent is capable of running builds for a set of related JDKs (e.g. all point versions of JDK 1.5), you set up generic JDK capabilities to encompass these JDKs.
For example, you can set up the following JDK capabilities for your Bamboo agent(s):- JDK (where 'JDK Label' = '
JDK
' and 'Java Home' = '/usr/java/jdk1.5.0_07
') — this JDK capability indicates that an agent(s) is capable of running builds with any JDK requirement. - JDK 1.5 (where 'JDK Label' = '
JDK 1.5
' and 'Java Home' = '/usr/java/jdk1.5.0_07
') — this JDK capability indicates that an agent(s) is capable of running builds with a JDK 1.5 requirement or any point version of JDK 1.5, e.g. 1.5.0_07, 1.5.0_08, etc. - JDK 1.5.0_07 (where 'JDK Label' = '
JDK 1.5.0_07
' and 'Java Home' = '/usr/java/jdk1.5.0_07
') — this JDK capability indicates that an agent(s) is only capable of running builds with a JDK 1.5.0_07 requirement.
- JDK (where 'JDK Label' = '
- Configuring generic JDK capabilities — If you want to indicate that an agent is capable of running builds for a set of related JDKs (e.g. all point versions of JDK 1.5), you set up generic JDK capabilities to encompass these JDKs.
- If required, update the system environment variables and working directory settings:
- 'Environment Variables' (Optional) — Specify any additional* operating system environment variables you want to pass to your build; Please note, multiple variables must be separated with spaces, and parameters with spaces must be quoted (e.g 'ANT_OPTS=-Xms200m -Xmx700m'). You can also include Bamboo global or build-specific variables (see Using Global, Plan or Build-specific Variables).
* i.e. additional to the existing environment variables (see Viewing Bamboo's System Information for a list). Note that existing environment variables are automatically available to the executable, thus you don't need to specify them in the 'System Environment Variables' field. - 'Working Sub Directory' (Optional) — A subdirectory relative to the Job build's root directory where Bamboo will execute your specified executable's commands. The Job build's root directory contains everything checked out from your Job's configured source repository. If you leave this field blank, Bamboo will look for the build files in the build root directory (which is assumed to be the Working Directory, as described in Locating Important Directories and Files). This option is useful, if your Task has a build script in a subdirectory and the executable needs to be run from within that subdirectory, in which case, you would type the name of that subdirectory in this field.
- 'Environment Variables' (Optional) — Specify any additional* operating system environment variables you want to pass to your build; Please note, multiple variables must be separated with spaces, and parameters with spaces must be quoted (e.g 'ANT_OPTS=-Xms200m -Xmx700m'). You can also include Bamboo global or build-specific variables (see Using Global, Plan or Build-specific Variables).
- Specify the following general build parameters:
- 'The build will produce test results' — Select this check box if you want Bamboo to gather test results data for each build result. If selected, the following options will appear:
Bamboo requires test results to be XML files that are compatible with JUnit XML format. This format is also used by TestNG.
- 'Look in the standard test results directory' radio button (Only available with Maven and Grails builders) — Select this option if Bamboo should look in the Builder's standard test results directory.
- 'Specify custom results directories' radio button (Only available with Maven and Grails builders) — Select this option if the Builder will place generated test results in an alternative directory. If selected, the following will appear:
- 'Specify custom results directories' field — Type the name of the test results directory (or multiple directories, separated by commas). You can also use Ant-style patterns such as
**/test-reports/*.xml
. Please specify file path relative to your Job build's root directory — do not specify an absolute path like/home/bamboouser/bamboo-home/xml-data/build-dir/JOB_KEY/
.
For Jobs that use CVS, the Job build's root directory is
<bamboo-home>/xml-data/build-dir/JOB_KEY/<cvs-module>
- 'The build will produce test results' — Select this check box if you want Bamboo to gather test results data for each build result. If selected, the following options will appear:
- Click the 'Save' button to save your changes.
Notes
Related Topics
Attachments:


