Migrate tomcat7-maven-plugin to cargo-maven3-plugin

71 Views Asked by At

We are updating a project to use the new cargo-maven3-plugin instead of tomcat7-maven-plugin, and we need some help understanding how to configure certain features.

The existing plugin configuration is:

    <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.0</version>
        <configuration>
            <port>7777</port>
            <contextFile>a/b/context.xml</contextFile>
            <tomcatUsers>a/b/tomcat-users.xml</tomcatUsers>
            <additionalClasspathDirs>
                <additionalClasspathDir>a/b/c</additionalClasspathDir>
            </additionalClasspathDirs>
            <path>/somename</path>
            <systemProperties>
                <CATALINA_OPTS>-Dcom.sun.management.jmxremote
                -Dcom.sun.management.jmxremote.port=9999
                -Dcom.sun.management.jmxremote.ssl=false
                -Dcom.sun.management.jmxremote.authenticate=false
                </CATALINA_OPTS>
            </systemProperties>
            <update>true</update>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.aa.bb</groupId>
                    <artifactId>ccc</artifactId>
                    <version>1.2.3</version>
                    <scope>runtime</scope>
            </dependencies>
    </plugin>

We want to use the cargo-maven3-plugin

    <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven3-plugin</artifactId>
        <version>1.9.9</version>
        <!-- Need to replicate the settings of the tomcat7-maven-plugin here
        JAR org.aa.bb:ccc:1.2.3 is declared as <scope>provided</scope> in the project's pom.xml. We want to configure the cargo plugin to copy this jar to our Tomcat instance when deploying the webapp.
         -->
    </plugin>

What is the equivalent cargo-maven3-plugin syntax for these settings?

We have installed Tomcat v9 locally, but we are also open to using the embedded instance, if that simplifies things.

The dependency JAR org.aa.bb:ccc:1.2.3 is declared as a "provided" dependency in the project, so we need to configure the cargo-maven3-plugin to copy it (make it available) to the Tomcat instance.

0

There are 0 best solutions below