0

I'd like to start a new local Tomcat instance for testing purposes during the Maven's pre-integration-test phase (on different port) and run tests there. Then if the tests pass I'd like to do a cargo:redeploy to a remote Tomcat instance. I'm having issues with getting this right though. If I do

mvn org.codehaus.cargo:cargo-maven2-plugin:run -Dcargo.maven.containerId=tomcat8x -Dcargo.maven.containerUrl=https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.36/bin/apache-tomcat-8.0.36.zip -Dcargo.maven.type=standalone

I get

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.19:run (default-cli) on project atf-relay-server: Execution default-cli of goal org.co
    dehaus.cargo:cargo-maven2-plugin:1.4.19:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [tomcat
    8x], type = [installed]], configuration type [runtime]). Valid types for this configuration are:
    [ERROR] - standalone
    [ERROR] - existing
    [ERROR] -> [Help 1]

My pom.xml for cargo is (specifying only remote instance):

    <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <version>1.4.19</version>
        <configuration>
            <container>
                <containerId>tomcat8x</containerId>
                <type>remote</type>
            </container>

            <configuration>
                <type>runtime</type>
                <properties>
                    <cargo.hostname>localhost</cargo.hostname>
                    <cargo.servlet.port>9990</cargo.servlet.port>
                    <cargo.remote.username>user</cargo.remote.username>
                    <cargo.remote.password>pass</cargo.remote.password>
                </properties>
            </configuration>
            <deployer>
                <type>remote</type>
            </deployer>
        </configuration>
    </plugin>

What's the correct way to achieve this?

burm
  • 93
  • 11

1 Answers1

0

Ok, seems it's quite easy to achieve after getting familiar with Maven profiles. I have now one profile controlling remote Tomcat instance and doing the cargo:redeploy and other profile just creating local Tomcat, running it, deploying app there and running the tests.

burm
  • 93
  • 11