Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 36 Next »

Reference Guide

These are the various XML configuration elements that you can use to configure the Cargo Maven2 plugin. Make sure you also check the use cases which show how to use them.

Top level configuration elements

Description

Mandatory?

Default value

<configuration>

Definition of a Configuration

(thumbs down)

Defaults to a standalone configuration if the container is of type local and a runtime one if it's of type remote

<container>

Definition of a Container

(thumbs down)

Defaults to a Jetty 5.x container if not specified

<deployer>

Definition of a Deployer

(thumbs down)

Defaults to a deployer matching the container's type if none is specified (installed local deployer for an installed container, remote deployer for a remote container and embedded local deployer for an embedded container)

<skip>

Set this to 'true' to bypass cargo execution (since v1.0.3)

(thumbs down)

Defaults to false

<wait>

Decides if Cargo should wait after the container is started or not

(thumbs down)

Defaults to true

<configuration> elements

Description

Mandatory?

Default value

<configfiles>

List of Configuration files that are to be added to a local container's configuration. Each file is specified using a <configfile> element. Cargo token replacement is applied to the files and any existing file is overwritten.

(thumbs down)

No default

<deployables>

List of modules to deploy when the container is started. You specify each module using a <deployable> element.

(thumbs down)

If the project's packaging is war, ear or ejb and there is no deployer specified and the user has not defined the auto-deployable inside the <deployables> element, then the generated artifact is added automatically to the list of deployables to deploy

<files>

List of files that are to be added to a local container's configuration. Each file is specified using a <file> element.

(thumbs down)

No default

<home>

For standalone configuration this is the location where Cargo will create the configuration and for existing configuration this is where it is located

(thumbs down)

${java.io.tmpdir}/cargo/conf

<implementation>

Full classname of a custom configuration implementation to use. In that case the custom configuration is registered with the <containerId> and <type> specified

(thumbs down)

Defaults to the Cargo-provided implementation if not specified

<properties>

Values to use for various Configuration properties

(thumbs down)

Default configuration properties

<type>

Configuration's type. Valid values are standalone, existing and runtime

(thumbs down)

standalone

<container> elements

Description

Mandatory?

Default value

<append>

If true then the file specified by <output> will not be erased across different runs

(thumbs down)

False

<containerId>

Id of the container to use. Valid values can be found in the description page for each container

(thumbs down)

jetty5x

<dependencies>

List of extra dependencies that will be added to the container execution classpath.

(thumbs down)

No default

<home>

Location where the container is installed. If specified in conjunction with the <zipUrlInstaller> element, it will override the home directory defined by the installer (since v1.0.2)

(thumbs down)

No default, user must define either a home or a <zipUrlInstaller> element

<implementation>

Full classname of a custom container implementation to use. In that case, the custom container is registered with the <containerId> and <type> specified

(thumbs down)

Defaults to the Cargo-provided implementation if not specified

<log>

Path to a file where Cargo logs are saved

(thumbs down)

Logs to the Maven console if no log file is specified

<output>

Path to a file where container logs are saved

(thumbs down)

Logs to the file specified by the <log> element or to the Maven console if no such file has been specified

<systemProperties>

List of <key>value</key> pairs to be passed as System properties to the container when it is started

(thumbs down)

No default

<timeout>

The timeout after which Cargo reports an error if the container is not started or stopped

(thumbs down)

120000 ms (2 minutes)

<type>

The container's type. Valid values are installed, embedded and remote

(thumbs down)

Default value is installed unless the <containerId> has not been specified, in which case the default is to use the Jetty 5.x Embedded container

<zipUrlInstaller>

Defines the location of a container distribution zip that will be downloaded and installed

(thumbs down)

No default, user must define either a <zipUrlInstaller> or a home element

<deployer> elements

Description

Mandatory?

Default value

<deployables>

A list of deployables that are going to be deployed in the container when it is started

(thumbs down)

No default

<implementation>

Deployer implementation class. Usage of this option is not recommended, please prefer type instead.

(thumbs down)

No default

<type>

The deployer's type.

(thumbs down)

Defaults to a deployer matching the container's type if none is specified (installed local deployer for an installed container, remote deployer for a remote container and embedded local deployer for an embedded container)

<configfile> elements

Description

Mandatory?

Default value

<file>

The configuration file, or directory, to add

(thumbs up)

No default

<todir>

The target directory, relative to configuration home, where the file should be copied

(thumbs down)

If not specified, the file will be copied to the configuration's home directory

<tofile>

The target file name to use

(thumbs down)

The original file name

<file> elements

Description

Mandatory?

Default value

<file>

The file, or directory, to add

(thumbs up)

No default

<todir>

The target directory, relative to configuration home, where the file should be copied

(thumbs down)

If not specified, the file will be copied to the configuration's home directory

<tofile>

The target file name to use

(thumbs down)

The original file name

<configfile>

Indicates if Cargo token replacement should be applied ('true') when copying. Do not use this option on a non-ascii file as it will corrupt it!

(thumbs down)

False

<overwrite>

If any existing file should be overwritten or not

(thumbs down)

True

<deployable> elements

Description

Mandatory?

Default value

<artifactId>

Maven artifact id for the module. This artifact id must match either the project's artifact id if your project generates a J2EE artifact (WAR, EAR, EJB and RAR) or it must match a specified <project>/<dependencies>/<dependency> artifact id

(thumbs down)

Defaults to the project's artifact id

<groupId>

Maven group id for the module. This group id must match either the project's group id if your project generates a J2EE artifact (WAR, EAR, EJB and RAR) or it must match a specified <project>/<dependencies>/<dependency> group id

(thumbs down)

Defaults to the project's group id

<implementation>

Deployable implementation class. Usage of this option is not recommended, please prefer type instead.

(thumbs down)

No default

<location>

Path location where the module can be found

(thumbs down)

Default's to the project's generated artifact location or to the specified <project>/<dependencies>/<dependency> location

<pingURL>

URL on which to ping the deployed or undeployed application (to check if deployment or undeployment is successful). If not set, the deployed or underployed application will not be pinged, hence the deployment considered as complete as soon as the target server's method returns successfully.

(thumbs down)

No default

<pingTimeout>

If <pingURL> is set, the number of milliseconds after which the ping fails the build if still not successful.

(thumbs down)

No default

<properties>

User-defined properties of a deployable.

(thumbs down)

No default

<type>

Maven type for the module. This type must match either the project's packaging if your project generates a J2EE artifact (WAR, EAR, EJB and RAR) or it must match a specified <project>/<dependencies>/<dependency> type

(thumbs down)

Defaults to the project's packaging

<properties> elements

 Deployable Type

Description

Mandatory?

Default value

<context>

WAR

The context name to use when deploying the web application.

(thumbs down)

If not specified, then the default context name is computed from the name of WAR itself (without the file extension) or <project>/<build>/<finalName>

<war>

WAR

The path of the WAR being deployed.

(thumbs down)

Default's to the project's generated artifact location

<ear>

EAR

The path of the EAR being deployed.

(thumbs down)

Default's to the project's generated artifact location

<name>

EAR

The name of EAR deployable (it can be anything, there's no special rule).

(thumbs down)

If not specified, it is computed from the EAR's file name (removing the filename extension) or <project>/<build>/<finalName>

<ejb>

EJB

The path of the EJB being deployed.

(thumbs down)

Default's to the project's generated artifact location

About WAR contexts

Icon

Many containers have their specific files for redefining context roots (Tomcat has context.xml, JBoss has jboss-web.xml, etc.). If your WAR has such a file, the server will most probably use the context root defined in that file instead of the one you specify using the CARGO deployer.

<dependency> elements

Description

Mandatory?

Default value

<artifactId>

Maven's artifact id. This artifact id must match a specified <project>/<dependencies>/<dependency> artifact id

(thumbs down)

Defaults to the project's artifact id

<groupId>

Maven's group id. This group id must match a specified <project>/<dependencies>/<dependency> group id

(thumbs down)

Defaults to the project's group id

<type>

Maven's type. This type must match a specified <project>/<dependencies>/<dependency> type

(thumbs down)

Defaults to the project's packaging

<location>

The path of a folder or a jar file you wish to add to deployable classpath. This element can be used to explicitly add entries to the classpath. For example:

(thumbs down)

If the groupId and artifactId match those of the project then the deployable is the artifact generated by the project. Otherwise the location is the location of the dependency in your local respository.

<zipUrlInstaller> elements

Description

Mandatory?

Default value

<url>

URL from which to download the container's ZIP or TAR.GZ file.

(thumbs down)

No default

<installDir>

Directory in which the zipUrlInstaller should download the container's ZIP or TAR.GZ file and extract it.

(thumbs down)

${java.io.tmpdir}/installs

<proxy>

Proxy server settings, if required.

(thumbs down)

No default

Proxy settings in CARGO 1.1.0 and afterwards

Icon

Starting from version 1.1.0, CARGO can reuse existing Maven2 proxy configuration -so you won't need to type the proxy settings for the zipUrlInstaller element.

<proxy> elements (under the zipUrlInstaller element)

Description

Mandatory?

Default value

<cargo.proxy.host>

Proxy host name or IP address.

(thumbs down)

No default

<cargo.proxy.port>

Proxy port.

(thumbs down)

Very probably 80

<cargo.proxy.user>

User name to connect to the proxy server.

(thumbs down)

No default

<cargo.proxy.password>

Password to connect to the proxy server.

(thumbs down)

No default

  • No labels