Configure the Java agent for Maven Cargo plugin

To configure the Java agent for Maven Cargo plugin:

  1. Add a <cargo.jvmargs> property to the <properties> section of <configuration> in your pom.xml. Replace <YourContrastJarPath> with the path to your Contrast JAR file. For example:

    <build>
      <plugins>
        <plugin>
          <groupId>org.codehaus.cargo</groupId>
          <artifactId>cargo-maven2-plugin</artifactId>
          <version>1.7.3</version>
          <configuration>
            <container>
              <containerId>jetty9x</containerId>
              [...]
            </container>
            <configuration>
              <properties>
                <cargo.jvmargs>-javaagent:<YourContrastJarPath></cargo.jvmargs>
              </properties>
            </configuration>
            [...]
          </configuration>
        </plugin>
      </plugins>
    </build>
  2. Run your Maven target or Cargo unit test as usual.

  3. A Contrast startup message should appear in the console before your server messages appear. (Allow one or two extra minutes for server startup.)

  4. Navigate to your application, and allow an extra minute for startup.