mavencargomaven-cargocargo-maven2-plugin

Can I host a container zip on a nexus server for Cargo?


We are successfully using the cargo-maven2-plugin with both Jetty and Tomcat containers. Unfortunately our external internet connection is unstable, so we have failing builds because cargo cannot access the external url to obtain the container zip:

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.11:start (start-container) on project scc-service-impl: Execution start-container of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.11:start failed: Failed to download
[http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.2.5.v20141112/jetty-distribution-9.2.5.v20141112.tar.gz]:
java.net.UnknownHostException: repo1.maven.org: Unknown host repo1.maven.org -> [Help 1]

Is it possible to host the Tomcat or Jetty libraries on our local Nexus server to allow our full build to run without relying on the external network?


Solution

  • The containers used in Cargo are not considered as dependencies, jetty is a special case because it is stored in the maven repositories and so can be defined as a dependency but it won't change anything in the download of the container by the cargo-maven2-plugin.

    On the other hand, in the plugin configuration, you can define a containerUrl (see there) or a zipUrlInstaller (see there) to define where the container has to be downloaded from.

    Thereby, you can download it in your Nexus repository (or on any server you might want to use) and make the URL in the plugin configuration point to your server.

    If you check all the containers in the left column of cargo's main page, you will see that they are not all stored at the same place.