Cargo : Static deployment of WAR
This page last changed on Aug 20, 2011 by alitokmen.
DefinitionDeploy a WAR that will be started when the container starts ExampleLet's see how to use Jetty 4.x (an embedded container) with a WAR to deploy in it. LocalContainer container = new Jetty4xEmbeddedLocalContainer( new JettyStandaloneConfiguration("target/jetty4x")); Deployable war = new WAR("src/data/some.war"); war.setContext("application-context"); container.getConfiguration().addDeployable(war); container.start(); Example using the Ant APIStarting JOnAS 5.x with a WAR to deploy: <cargo containerId="jonas5x" home="c:/jonas/jonas-5.1.2" action="start"> <configuration> <deployable type="war" file="path/to/simple-war.war"> <property name="context" value="application-context"/> </deployable> </configuration> </cargo> Example using the Maven2/Maven3 APIHere is the plugin configuration defining a JOnAS 5.x container with a WAR to deploy: <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>jonas5x</containerId> <artifactInstaller> <groupId>org.ow2.jonas.assemblies.profiles</groupId> <artifactId>jonas-full</artifactId> <version>5.2.1</version> <classifier>bin</classifier> </artifactInstaller> <configuration> <deployables> <deployable> <groupId>org.codehaus.cargo</groupId> <artifactId>simple-war</artifactId> <type>war</type> <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 Oct 05, 2011 19:31 |