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 27 Next »


Installs a container


An Installer is meant to install a container on your local machine. There is currently only a single Installer implementation: ZipURLInstaller which downloads a zipped container distribution from a URL and which installs it (i.e. unpacks it) in a specified directory. This is useful if you wish to fully automate a container installation without having to ask the user to manually install a container on their machine.

Of course you don't have to use an Installer if you want to use a container already installed on your machine.

Difference between versions


The ZipURLInstaller has been changed between Cargo versions:

  • In Cargo version 1.1.0 and onwards, the ZipURLInstaller has two attributes:
    • downloadDir: Directory in which the container's distributable archive is downloaded. Defaults to ${}/cargo/installs.
    • extractDir: Directory in which the container's distributable archive is extracted. Defaults to:
      • ${}/cargo/installs on the Java API and ANT tasks
      • ${}/cargo/installs on the Maven2 plugin
  • In older versions, the ZipURLInstaller has only one attribute:
    • installDir: Directory in which the container's distributable archive is downloaded and extracted. Defaults to ${}/cargo/installs.
      Similarly, the ZipURLInstaller constructor's parameters also reflect the same mechanism.

Example using the Java API

Example using the Ant API

Example using the Maven2 plugin

Using Maven2-based distributions

New versions of most application servers have their distribution packages built by Maven2, hence distribute these as ZIP or TAR.GZ files on a Maven2 repository. It is also rather easy to upload servers' packages to an internal (for example, enterprise) Maven repository.

Starting from Cargo 1.1.0, you can directly use such artifacts using an ArtifactInstaller. Here is the example for Jetty 7:

In older versions of Cargo, the CARGO ZipUrlInstaller can be used to reuse the Maven dependency. The example below illustrates that use case applied on Jetty 7:

  • No labels