Cargo : Ant support
This page last changed on Jul 08, 2010 by alitokmen.
DefinitionCargo provides Ant tasks to perform all the operations available from the Java API ExplanationBefore using the Ant API you need to register the Cargo Ant tasks into Ant. This is done in the following manner: <taskdef resource="cargo.tasks"> <classpath> <pathelement location="${cargo-core-uberjar-0.7.jar}"/> <pathelement location="${cargo-ant-0.7.jar}"/> </classpath> </taskdef> Some additional dependencies might also be required for the ANT task. Please see the Installation page for details. Note that by default the <cargo> task will wait so that the container is not stopped upon Ant exiting. If you don't want this, then specify wait="false" in the <cargo> task. ExamplesOrion 2.xHere'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. <taskdef resource="cargo.tasks"> <classpath> <pathelement location="path/to/cargo.jar"/> </classpath> </taskdef> <cargo containerId="orion2x" home="c:/apps/orion-2.0.3" output="target/output.log" log="target/cargo.log" action="start"> <configuration> <property name="cargo.servlet.port" value="8180"/> <property name="cargo.logging" value="high"/> <deployable type="war" file="path/to/my/simple.war"/> <deployable type="war" file="path/to/my/expandedwar/simple"/> <deployable type="ear" file="path/to/my/simple.ear"/> </configuration> </cargo> Tomcat 5.xThis example gives a walk through of how to get a Cargo Ant build to work with Tomcat 5.x . Prerequisites
StepsFollow the following steps to configure your build.xml :
<property name="cargolib.dir" value="${basedir}/cargolib"/>
<property name="cargo-uberjar" value="${cargolib.dir}/cargo-core-uberjar-0.7.jar"/> <property name="cargo-antjar" value="${cargolib.dir}/cargo-ant-0.7.jar"/>
|
![]() |
Document generated by Confluence on Jul 10, 2010 12:22 |