This document explains how to configure Cargo remote deployment support on a Jetty container.


By default, Jetty does not come with possibilities for remote deployment. In order to add such a support to Jetty, Cargo uses a "Jetty remote deployer" Web application.

This application is a simple servlet-based application which exposes methods such as deploy or undeploy on standard HTTP POST URLs. When thse HTTP methods are called, the servlet implementing these methods connects to the Jetty Server implementation and does deployment related actions on the server; this Web application can therefore be seen as a kind of remote administration proxy.

Being a standard Web application, the Cargo Jetty remote deployer application can be secured using Jetty users and roles.

Downloading the remote deployer

Two versions of the Jetty remote deployer WAR are available on the Cargo downloads page (scroll down to the Tools section):

Please make sure to download and install the correct flavour for your Jetty version.


By default, the Cargo Jetty remote deployer comes with no security.

In order to activate security, follow these steps:

  1. Open the WEB-INF/web.xml file of the Cargo Jetty remote deployer WAR
  2. Uncomment the part that says Uncomment in order to activate security. By default, that configuration is as follows:
  3. Create a user with the Jetty role manager:
    1. Open the Jetty file
    2. Add, for example, the following definition

      someusername: somepassword,manager

To try the security settings, you can try to visit the /cargo-jetty-deployer context on your server, for example http://production27:8080/cargo-jetty-deployer, using any Web browser. If security is configured well, it should:

Note: Jetty's website has documentation on hashing the password.


Here is an example Maven2 plugin configuration that:







To run the given Maven2 plugin configuration on a simple Maven2 WAR project, simply execute:

mvn war:war
mvn cargo:deploy

Known issues

By default, Jetty sets theĀ maxIdleTime parameter in theĀ etc/jetty.xml file 30 seconds. This means that if the actual deployment takes more than 30 seconds, you might get error messages like:

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.2:deploy (default-cli)
        on project display: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.2:deploy
        failed: Failed to deploy [/var/lib/jenkins/workspace/Vanessa-cargo/target/display-]:
        Unexpected end of file from server -> [Help 1]


Caused by: Unexpected end of file from server
    at org.codehaus.cargo.container.jetty.JettyRemoteDeployer.getResponseMessage(
    at org.codehaus.cargo.container.jetty.JettyRemoteDeployer.deploy(
    ... 25 more

In this case, open the target Jetty container's etc/jetty.xml file and set the maxIdleTime parameter to longer. For example:

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "">

<Configure id="Server" class="org.mortbay.jetty.Server">
  <Call name="addConnector">
      <New class="org.mortbay.jetty.nio.SelectChannelConnector">
        <!-- Set a longer maxIdleTime (90 seconds in this case) to allow long remote deployments -->
        <Set name="maxIdleTime">90000</Set>