maventomcattomcat7maven-3cargo

Cargo:run If you specify a containerId, you also need to specify a containerUrl


I am trying to run tomcat though cargo. Tomcat is already installed. cargo:deploy is working fine but when I try cargo:run I get the following error

If you specify a containerId, you also need to specify a containerUrl.

If I specify a containerURL I get the following error

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-    
plugin:1.4.13:run (default-cli) on project ctm: Unable to parse configuration   
of mojo org.codehaus.cargo:cargo-maven2-plugin:1.4.13:run for parameter 
containerURL: Cannot find 'containerURL' in class org.codehaus.cargo.maven2.configuration.Container
...

This is my Maven config

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.4.13</version>
    <configuration>
        <container>
            <type>existing</type>
            <containerId>${cargo.maven.containerId}</containerId>
             <home>${container.home}</home>
        </container>
        <configuration>
            <type>existing</type>
            <home>${container.home}</home>
        </configuration>
        <deployables>
            <deployable>
                <groupId>${project.groupId}</groupId>
                <artifactId>${project.artifactId}</artifactId>
                 <type>war</type>
                 <properties>
                     <context>example</context>
                 </properties>
             </deployable>
         </deployables>
        </configuration>
        <executions>
            <execution>
            <id>run</id>
            <configuration>
                <configuration>
                    <type>existing</type>
                </configuration>
            </configuration>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
</plugin>

this is my profile

<profile>
    <id>developer-properties</id>
    <properties>
        <cargo.maven.containerId>tomcat7x</cargo.maven.containerId>
        <container.home>C:/apache-tomcat-7.0.35</container.home>
    </properties>
</profile>

According to cargo documentation; type "existing" should use an existing container installation. I don't think I need containerURL unless the type is "standalone". I don't understand why I'm getting the containerURL error.

Documentation on type is here: https://codehaus-cargo.github.io/cargo/Existing+Local+Configuration.html


Solution

  • I think the documentation is unclear. I think cargo:run always uses a standalone local configuration, hence the description

    If the plugin configuration defines a container with a standalone local configuration, it will create the configuration.

    So it's probably ignoring your existing local configuration.