Getting Started
Very quick start (CARGO versions older than 1.1.2)
The simplest Cargo configuration for your existing Maven2 Java EE project (WAR, EAR or other) would the following plugin definition:
<plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <configuration> <container> <containerId>tomcat7x</containerId> <zipUrlInstaller> <url>http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.12/bin/apache-tomcat-7.0.12.zip</url> </zipUrlInstaller> </container> </configuration> </plugin>
And then run:
mvn clean verify cargo:run
![]() | The cargo:run MOJO Note that mvn clean verify start -Dwait=true |
This will create a default Tomcat 7.x container and start it using the Cargo Maven2 plugin with your Maven2 project's deployable (a WAR, for example) deployed to it; so you can run manual tests (as a first introduction).
What is magic is that you can replace the tomcat7x
(and associated container URL, of course) with anything from other versions of Tomcat to Jetty, JBoss, JOnAS, GlassFish, WebLogic, ... and still the plugin configuration will stay the same. This reality holds even when you want to change the container's configuration (for example, its HTTP port), independently from the container.
Like it? Well, keep on reading, then!
More examples and the plugin in detail
Please read: Maven2 Plugin Getting Started.