Definition
Cargo provides Ant tasks to perform all the operations available from the Java API
Explanation
Before using the Ant API you need to register the Cargo Ant tasks into Ant. This is done in the following manner:
Example
Orion 2.x
Here's a full example showing how to deploy a WAR, and expanded WAR and an EAR in an Orion 2.x container. Please note that the output and log attribute are optional. The property elements allow you to tune how the container is configured. Here we're telling it to start on port 8180 and to generate the maximum amount of logs in the container output file.
Tomcat 5.x
This example gives a walk through of how to get a Cargo Ant build to work with Tomcat 5.x .
Prerequisites
- It is assumed that tomcat 5.x is already installed
- Jars cargo-core-uberjar-0.7.jar and cargo-ant-0.7.jar have been downloaded
- A mimimum knowledge of Ant is required
- User already has a
wartarget that properly generates a working war file
Steps
Follow the following steps to configure your build.xml :
- Create a folder under your basedir called cargolib that will hold cargo-core-uberjar-0.7.jar and cargo-ant-0.7.jar
- Define a property for cargolib
- Define 2 new properties
cargo-uberjarandcargo-antjaras shown below:
- Add additional properties for defining the following:
Property
Description
tomcat.home
Installation directory of tomcat5x
tomcatlog.dir
This is where our logs are going to be generated
tomcatconfig.dir
Cargo needs an empty config folder
pathtowarfile
The full path of the war file e.g c:/devtools/myapp/dist/myfile.war
- Add the following code to your build.xml :
| Stopping Tomcat If the following is not specified in the target: the build after executing the |