Independent extensions:

RSS Feeds


Pages and Blog posts
Mailing list

Prequisites

  • Check out or download as a ZIP file the Codehaus Cargo source code from Github into a CARGOHOME directory (wherever you want on your machine).
  • Install the JDK 11. If you really want to build with JDK 8 or with JDK 12 and above, read our chapter on building with older or newer versions of the JDK.
  • Install Maven 3.2.3 or later, i.e. versions that ensure access to Maven Central is done via HTTPS.
    • If you are using Maven 3.8.1 or newer, you might have some ArtifactTransferExceptions with the OW2 snapshot repository (which was defined as HTTP over a decade back). You can work around these using the instructions in the chapter ArtifactTransferException with Maven 3.8.1 onwards.

Verify your installation works by running the following command in a command prompt / terminal window: mvn --version

Building

To build Codehaus Cargo:

  • Go to CARGOHOME and run mvn install
    This will build the full Cargo project.
  • If you wish to clean all build-generated files, cd to CARGOHOME and run mvn clean

First time build

The Codehaus Cargo build contains functional tests. Those tests are run on different containers. The first time you build Codehaus Cargo it will download those container distributions which will take some time (the containers are installed into core/samples/java/installs). If you want to tell Codehaus Cargo to run only on some specific container, see below.

Selecting containers

The default list of containers to run on depends a property cargo.containers defined in CARGOHOME/core/samples/pom.xml. It can also be supplied at the command line by using profiles (-P<containerId>).

For example if you only want to run on Tomcat 8.x you'd run: mvn -Ptomcat8x clean install

Proxy settings

If you need to build Codehaus Cargo from behind a proxy, proceed as follows:

  • Edit the .m2/settings.xml file from your home directory (C:\Documents and Settings\username or C:\Users\username on Windows),
  • Comment out the <proxy> element and fill in the proxy server settings accordingly.

ArtifactTransferException with Maven 3.8.1 onwards

With Maven 3.8.1 onwards you might get errors such as: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.ow2.jonas.tools.configurator:api:pom:1.9.4-SNAPSHOT from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [ow2-snapshot (http://repository.ow2.org/nexus/content/repositories/snapshots, default, snapshots)]

To work around the issue, create a settings.xml file in your .m2 home which overrides the HTTP-based OW2 SNAPSHOTS repository:

settings.xml sample
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <mirrors>
    <mirror>
      <id>ow2-snapshot-override</id>
      <name>ow2-snapshot-override</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <mirrorOf>ow2-snapshot</mirrorOf>
    </mirror>
  </mirrors>
</settings>

Building with older or newer versions of the JDK

Codehaus Cargo has support for very old and very new containers, which implies it has quite a broad combination of Java source and target version requirements:

  • The Resin 3.x container requires Java 6 (it cannot run with newer versions of Java)
  • The Jetty Remote Deployer for Jetty 6.x as well as for Jetty 7.x to 9.x are built with Java 6, so we can support a broad range of Java versions on these Jetty containers
  • At the same time, the Jetty Remote Deployer for Jetty 10.x onwards requires the JDK 11 (because Jetty 10.x requires JDK 11 or above)

The only version of the JDK that can build with all these constraints is the JDK 11. We hence have certain modules of the Codehaus Cargo build that do not activate on JDK 8, and some others that don't activate on JDK 12 onwards. On these JDKs, you hence will get exceptions such as:

Error when building with JDK 8 or JDK 12 and above
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy (copy-test-ear) on project cargo-core-container-jonas: Unable to find/resolve artifact.: Could not find artifact org.codehaus.cargo:simple-ear:ear:1.9.8-SNAPSHOT -> [Help 1]

To build on these JDKs, you can either have a "pre-build" in JDK 11, or use the snapshots repository by adding the below to your Maven settings.xml:

settings.xml sample
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <profiles>
    <profile>
      <id>sonatype-snapshots-repository</id>
	  <activation>
	    <activeByDefault>true</activeByDefault>
	  </activation>
      <repositories>
        <repository>
          <id>sonatype-snapshots</id>
          <name>Sonatype Snapshots</name>
          <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>
</settings>


Copyright 2004-2021. All rights reserved unless otherwise noted.
Click here to read our privacy and cookie policy