Definition

How to configure the executing container's classpath

This feature is only available for local containers

Explanation

This topic is not about the classpath requirements to run Cargo (see the Installation page for this); it's about configuring the classpath for the executing container. You can therefore add custom JARs (code instrumentation, DataSource JARs, security-related libraries, etc.) to the container's execution classpath as shown below.

Note that some containers also support adding custom JARs to the applications' classpath only: see Application Classpath for details.

Example using the Java API

Starting Orion 1.x with Clover jar added to its classpath. For example if you have instrumented your source code with Clover you'll need to add the Clover jar to the classpath.

InstalledLocalContainer container = new Orion1xInstalledLocalContainer(
    new OrionStandaloneLocalConfiguration("target/orion1x"));
container.setHome("c:/apps/orion-1.6.0b");

container.setExtraClasspath(new String[] { "libs/clover.jar" });

container.start();

Example using the Ant API

Starting Orion 1.x with some additional classpath entries:

<cargo containerId="orion1x" home="c:/apps/orion-1.6.0b" action="start">
  <extraClasspath>
    <pathelement location="libs/clover.jar"/>
  </extraClasspath>
</cargo>

Example using the Maven 2 Plugin

See Starting and stopping a container - Adding jars to a container's classpath