Cargo : Static deployment of expanded WAR
This page last changed on Sep 22, 2011 by alitokmen.
DefinitionDeploy an expanded WAR that will be started when the container starts Example using the Java APIInstalledLocalContainer 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 APIStarting 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 APIHere 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:
|
![]() |
Document generated by Confluence on Dec 03, 2011 14:37 |