This page last changed on Apr 28, 2005 by aheritier.

Definition

Cargo provides a Maven plugin to perform operations available from Ant support.

Installation

Warning

This plugin is not yet published.
The first plugin release will be available with Cargo 0.5.

To automatically install the plugin, type the following on a single line:

maven plugin:download
  -DgroupId=cargo
  -DartifactId=cargo-maven-plugin
  -Dversion=X.X(.X)

where X.X(.X) is the release number you want to install.

Plugin goals

goal description
cargo:start Starts all containers defined by the cargo.containers property
cargo:startAndWait Starts all containers defined by the cargo.containers property and wait for user's input. Without this, Maven stops and the started containers stop as the JVM exits
cargo:stop Stops all containers defined by the cargo.containers property

Plugin properties

Property name Required? Description Default
cargo.containers 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 containerId the corresponding settings. empty
cargo.zipUrlInstaller.<installerId>.installUrl URL from where the container archive can be downloaded. empty
cargo.zipUrlInstaller.<installerId>.installDir The path where the container will be downloaded and extracted. empty
cargo.proxy.host Proxy hostname (IP or server name). ${maven.proxy.host}
cargo.proxy.port Proxy port. ${maven.proxy.port}
cargo.proxy.user Proxy username. ${maven.proxy.user}
cargo.proxy.password Proxy password. ${maven.proxy.password}
cargo.proxy.excludehosts 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
cargo.container.<containerId>.containerKey The container type. Valid values are: jo1x | resin2x | resin3x | orion1x | orion2x | oc4j9x | tomcat3x | tomcat4x | tomcat5x | weblogic8x. empty
cargo.container.<containerId>.homeDir The path where the container is installed. empty
cargo.container.<containerId>.zipUrlInstaller The id of a zipUrLInstaller. empty
cargo.container.<containerId>.output The path for the file to which output of the container should be written. empty
cargo.container.<containerId>.log The path for the cargo log file. empty
cargo.container.<containerId>.deployables A list of deployable Ids. Each deployable must be defined using the deployables settings. empty
cargo.container.<containerId>.config.hint The hint to differentiate the configuration from others for the specified container.Currently the only hint supported by cargo is : standalone. empty
cargo.container.<containerId>.config.dir The home directory for the configuration of the container. empty
cargo.container.<containerId>.config.standalone.servlet.port Port on which the Servlet/JSP container will listen to. empty
cargo.container.<containerId>.config.standalone.hostname Host name on which the container will listen to. empty
cargo.container.<containerId>.config.standalone.logging Level representing the quantity of information we wish to log. Valid values are low | medium | high. empty
cargo.container.<containerId>.config.standalone.jvmargs JVM args to be used when starting/stopping containers. empty
cargo.container.<containerId>.start.output The path for the file to which output of the container should be written when it starts. empty
cargo.container.<containerId>.start.log The path for the cargo log file when the start action is called for this container. empty
cargo.container.<containerId>.stop.output The path for the file to which output of the container should be written when it stops. empty
cargo.container.<containerId>.stop.log The path for the cargo log file when the stop action is called for this container. empty
cargo.container.<containerId>.config.standalone.orion.rmi.port Port for the Orion RMI server. (Orion 1x, 2x or Oc4j 9x) empty
cargo.container.<containerId>.config.standalone.tomcat.shutdown.port TCP/IP port number on which this server waits for a shutdown command. (Tomcat 4x or 5x) empty
cargo.deployable.<deployableId>.type Deployable type : war | ear. empty
cargo.deployable.<deployableId>.warfile Absolute path to the war or the expanded webapp. empty
cargo.deployable.<deployableId>.earfile Absolute path to the ear. empty
Be Careful
Exactly one of cargo.container.<containerId>.homeDir and cargo.container.<containerId>.zipUrlInstaller must defined.
Be Careful
The property cargo.deployable.<deployableId>.warfile is required if the corresponding cargo.deployable.<deployableId>.type = war.
Be Careful
The property cargo.deployable.<deployableId>.earfile is required if the corresponding cargo.deployable.<deployableId>.type = ear.

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.containerKey = resin3x
cargo.container.myresin.homeDir = c:/apps/resin/
cargo.container.myContainerId.zipUrlInstaller = myContainerInstallerId
cargo.container.myContainerId.output = ${maven.build.dir}/myContainerId/logs/container.log
cargo.container.myContainerId.log = ${maven.build.dir}/myContainerId/logs/cargo.log
cargo.container.myContainerId.deployables = myEarId, myWarId
cargo.container.myContainerId.config.hint = standalone
cargo.container.myContainerId.config.dir = ${maven.build.dir}/myContainerId/config
cargo.container.myContainerId.config.standalone.servlet.port = 8280
cargo.container.myContainerId.config.standalone.hostname = myserver
cargo.container.myContainerId.config.standalone.logging = high
cargo.container.myContainerId.config.standalone.jvmargs = -Xmx64m -Xms2m
cargo.container.myContainerId.start.output = ${maven.build.dir}/myContainerId/logs/container-start.log
cargo.container.myContainerId.start.log = ${maven.build.dir}/myContainerId/logs/cargo-start.log
cargo.container.myContainerId.stop.output = ${maven.build.dir}/myContainerId/logs/container-stop.log
cargo.container.myContainerId.stop.log = ${maven.build.dir}/myContainerId/logs/cargo-stop.log
cargo.container.myContainerId.config.standalone.orion.rmi.port = 25791
cargo.container.myContainerId.config.standalone.tomcat.shutdown.port = 8205
cargo.deployable.myDeployableId.type = war
cargo.deployable.myDeployableId.warfile = ${maven.war.build.dir}/${maven.war.final.name}
cargo.deployable.myDeployableId.earfile = ${maven.build.dir}/${maven.ear.final.name}

Minimal settings to start and stop a container

Example with tomcat already installed:
maven.xml
<preGoal name="cargo:start">
  <ant:mkdir dir="${maven.build.dir}/myTomcat/config"/>
</preGoal>

project.properties
cargo.containers = myTomcat

cargo.container.myTomcat.containerKey = tomcat5x
cargo.container.myTomcat.homeDir = C:/Programs/web/jakarta-tomcat-5.0
cargo.container.myTomcat.config.hint = standalone
cargo.container.myTomcat.config.dir = ${maven.build.dir}/myTomcat/config
cargo.container.myTomcat.config.standalone.servlet.port = 8280
cargo.container.myTomcat.config.standalone.logging = high
Document generated by Confluence on Apr 30, 2005 12:52