Command
The command element is used to wrap a single command to run and artifact capturing elements artifact and dir-artifact. Each command element will have exactly one command (e.g. executable) as a child element, along with zero or more artifact and dir-artifact elements specifying which artifacts produced by the command should be captured. After the child command is executed, the artifacts are captured in the order specified. Usually the order is not important, although if a required artifact is not found (and the command therefore fails), no further artifacts will be captured.
When you do not wish to capture any artifacts from a command, the command element is unnecessary.
Attributes
| Attribute |
Description |
Required? |
Default |
| force |
If true, the command will run even if an earlier command failed. |
No |
false |
| name |
The name of the command. |
Yes (unless specified on the child command) |
|
Child Elements
| Element |
Description |
Number |
| <any command> |
The command to run (e.g. ant, executable, make, maven). |
1 |
| artifact |
Specifies a file to be captured as an artifact. |
0 or more |
| dir-artifact |
Specifies a directory to be captured as an artifact. |
0 or more |
| link-artifact |
Used to link to an external artifact URL. |
0 or more |
Examples
Build the project using make and capture the binary produced, along with a directory of test reports:
<command name="build">
<make targets="all"/>
<artifact name="binary" file="a.out"/>
<dir-artifact name="test reports" base="reports"/>
</command>