Definition
Deploy an expanded WAR that will be started when the container starts
Example using the Java API
InstalledLocalContainer container = new Resin3xInstalledLocalContainer(
new Resin3xStandaloneConfiguration("target/resin3x"));
container.setHome("c:/apps/resin-3.0.27");
Deployable war = new WAR("some/expanded/war/directory");
war.setContext("application-context");
container.getConfiguration().addDeployable(war);
container.start();
Example using the Ant API
Starting Tomcat 6.x with a WAR to deploy:
<cargo containerId="tomcat6x" home="c:/tomcat/tomcat-6.0.33" action="start">
<configuration>
<deployable type="war" file="some/expanded/war/directory">
<property name="context" value="application-context"/>
</deployable>
</configuration>
</cargo>
Example using the Maven2/Maven3 API
Here is the plugin configuration defining a Tomcat 6.x container with a WAR to deploy expanded:
<dependencies>
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>simple-war</artifactId>
<version>${simple-war.version}</version>
<type>war</type>
</dependency>
</dependencies>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>${cargo.version}</version>
<configuration>
<containerId>tomcat6x</containerId>
<zipUrlInstaller>
<url>http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.33/bin/apache-tomcat-6.0.33.zip</url>
</zipUrlInstaller>
<configuration>
<deployables>
<deployable>
<groupId>org.codehaus.cargo</groupId>
<artifactId>simple-war</artifactId>
<type>war</type>
<!--
Override location to point to the exploded webapp.
-->
<location>some/expanded/war/directory</location>
<properties>
<context>application-context</context>
</properties>
</deployable>
</deployables>
</configuration>
</configuration>
</plugin>
</plugins>
For more information...
For more information about how deployment in CARGO works, please read:
- How deployables work, which explains how to instanciate and personalize deployables.
- How deployers work, which explains how the different deployers work.