![]() | The CARGO Maven1 plugin has been deprecated in July 2010 and has been removed from CARGO version 1.1.0 and onwards. Please use the ANT tasks or Maven2 plugin instead. |
![]() | Maven 2 plugin This page is dedicated for the Maven 1 plugin (the old Maven). There's also a Maven2/Maven3 plugin, and that one is very probably what you're looking for. |
Installation
To automatically install the plugin, type the following on a single line:
maven plugin:download -DgroupId=org.codehaus.cargo -DartifactId=cargo-maven-plugin -Dversion=X.X(.X)
where X.X(.X) is the release number you want to install (0.6 is the first available).
Note that for versions earlier or equal to 0.7 you'll need to use a group id of cargo
instead of org.codehaus.cargo
.
Plugin goals
goal |
description |
---|---|
cargo:start |
Starts all containers defined by the |
cargo:stop |
Stops all containers defined by the |
Plugin properties
Property name |
Required? |
Description |
Default |
---|---|---|---|
|
|
A list of containers ids that specifies on which containers to apply the goal. If this property is empty the Maven plugin will do nothing. You must define for each |
empty |
|
|
URL from where the container archive can be downloaded. |
empty |
|
|
The path where the container will be downloaded and extracted. |
empty |
|
|
Proxy hostname (IP or server name). |
|
|
|
Proxy port. |
|
|
|
Proxy username. |
|
|
|
Proxy password. |
|
|
|
A list of hosts to bypass the proxy on (if any). These should be separated with the vertical bar character '|'. Only in Java 1.4 does FTP use this list. |
empty |
|
|
Whether Maven should block after the container is started or not |
true |
|
|
The container id. |
empty |
|
|
The path where the container is installed. |
empty |
|
|
The id of a zipUrLInstaller. |
empty |
|
|
The path for the file to which output of the container should be written. |
empty |
|
|
The path for the cargo log file. |
empty |
|
|
Timeout (in milliseconds) to wait to see if the container is started/stopped. |
empty |
|
|
A list of deployable Ids. Each deployable must be defined using the deployables settings. |
empty |
|
|
The type to differentiate the configuration from others for the specified container.Currently the only type supported by cargo is : standalone. |
empty |
|
|
The home directory for the configuration of the container. |
empty |
|
|
Port on which the Servlet/JSP container will listen to. |
empty |
|
|
Host name on which the container will listen to. |
empty |
|
|
Level representing the quantity of information we wish to log. Valid values are low | medium | high. |
empty |
|
|
JVM args to be used when starting/stopping containers. |
empty |
|
|
The path for the file to which output of the container should be written when it starts. |
empty |
|
|
The path for the cargo log file when the start action is called for this container. |
empty |
|
|
The path for the file to which output of the container should be written when it stops. |
empty |
|
|
The path for the cargo log file when the stop action is called for this container. |
empty |
|
|
A list of system properties to be passed to the container, separated by space. Each property is described in a sub property. Example:
|
empty |
|
|
Port for the Orion RMI server. (Orion 1x, 2x or Oc4j 9x) |
empty |
|
|
TCP/IP port number on which this server waits for a shutdown command. (Tomcat 4x or 5x) |
empty |
|
|
Deployable type : war | ear. |
empty |
|
|
Absolute path to the deployable file (or the expanded webapp directory). |
empty |
![]() | Be Careful Exactly one of |
Samples
All properties sample (incoherent settings)
cargo.containers = myresin,myorion,myjetty cargo.zipUrlInstaller.myresin.installUrl = http://www.caucho.com/download/resin-3.0.9.zip cargo.zipUrlInstaller.myresin.installDir = $\{maven.build.dir}/installs cargo.proxy.host = myproxy.mycompany.com cargo.proxy.port = 1080 cargo.proxy.user = vmassol cargo.proxy.password = somepassword cargo.proxy.excludehosts = fozbot.corp.sun.com\|\*.eng.sun.com cargo.container.myresin.containerId = resin3x cargo.container.myresin.home = c:/apps/resin/ cargo.container.myContainer.zipUrlInstaller = myContainerInstallerId cargo.container.myContainer.output = $\{maven.build.dir}/myContainer/logs/container.log cargo.container.myContainer.log = $\{maven.build.dir}/myContainer/logs/cargo.log cargo.container.myContainer.timeout = 120000 cargo.container.myContainer.deployables = myEarId, myWarId cargo.container.myContainer.config.type = standalone cargo.container.myContainer.config.home = $\{maven.build.dir}/myContainer/config cargo.container.myContainer.config.standalone.servlet.port = 8280 cargo.container.myContainer.config.standalone.hostname = myserver cargo.container.myContainer.config.standalone.logging = high cargo.container.myContainer.config.standalone.jvmargs = -Xmx64m -Xms2m cargo.container.myContainer.start.output = $\{maven.build.dir}/myContainer/logs/container-start.log cargo.container.myContainer.start.log = $\{maven.build.dir}/myContainer/logs/cargo-start.log cargo.container.myContainer.stop.output = $\{maven.build.dir}/myContainer/logs/container-stop.log cargo.container.myContainer.stop.log = $\{maven.build.dir}/myContainer/logs/cargo-stop.log cargo.container.myContainer.config.standalone.orion.rmi.port = 25791 cargo.container.myContainer.config.standalone.tomcat.shutdown.port = 8205 cargo.deployable.myDeployableId.type = war cargo.deployable.myDeployableId.file = $\{maven.war.build.dir}/$\{maven.war.final.name}
Minimal settings to start and stop a container
Example with tomcat already installed:
<preGoal name="cargo:start"> <ant:mkdir dir="$\{maven.build.dir}/myTomcat/config"/> </preGoal>
cargo.containers = myTomcat cargo.container.myTomcat.containerId = tomcat5x cargo.container.myTomcat.home = C:/Programs/web/jakarta-tomcat-5.0 cargo.container.myTomcat.config.type = standalone cargo.container.myTomcat.config.home = $\{maven.build.dir}/myTomcat/config cargo.container.myTomcat.config.standalone.servlet.port = 8280 cargo.container.myTomcat.config.standalone.logging = high
IDE support
Netbeans
There's a Netbeans module working with Mevenide for Netbeans. The module adds a panel into the Maven project's customizer. It eases the setup of the Maven plugin properties and visualizes the current settings.
The current version of the module is 1.0, it works with Mevenide 0.8.1 and later and Netbeans 4.1 and Netbeans 5.0 beta. It can be downloaded here. After download, start Netbeans and install the module through the AutoUpdate Center.
Sample screenshot