<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>test-simple</groupId>
    <artifactId>test-simple</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>Maven Simple Archetype</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <finalName>test-simple</finalName>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>0.3-SNAPSHOT</version>

                <executions>
                    <execution>
                        <id>start-node1-container</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <configuration>
                            <wait>false</wait>
                            <container>
                                <containerId>tomcat5x</containerId>
                                <zipUrlInstaller>
                                    <url>
                                        http://apache.planetmirror.com.au/dist/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.zip</url>
                                    <installDir>${installDir}</installDir>
                                </zipUrlInstaller>
                                <timeout>120000</timeout>
                                <output>${project.build.directory}/output-node1.log</output>
                                <log>${project.build.directory}/cargo-log-node1.log</log>
                                <systemProperties>
                                    <confluence.home>
                                        ${project.build.directory}/confluence-home-node1</confluence.home>
                                </systemProperties>
                            </container>

                            <configuration>
                                <home>
                                    ${project.build.directory}/tomcat5x-node1/container</home>
                                <properties>
                                    <cargo.servlet.port>12195</cargo.servlet.port>
                                    <cargo.jvmargs>-Djava.awt.headless=true -Xms256m -Xmx512m</cargo.jvmargs>
                                </properties>
                            </configuration>
                        </configuration>
                    </execution>
                    <execution>
                        <id>start-node2-container</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <configuration>
                            <wait>false</wait>
                            <container>
                                <containerId>tomcat5x</containerId>
                                <zipUrlInstaller>
                                    <url>
                                        http://apache.planetmirror.com.au/dist/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.zip</url>
                                    <installDir>${installDir}</installDir>
                                </zipUrlInstaller>
                                <timeout>120000</timeout>
                                <output>${project.build.directory}/output-node2.log</output>
                                <log>${project.build.directory}/cargo-log-node2.log</log>
                                <systemProperties>
                                    <confluence.home>
                                        ${project.build.directory}/confluence-home-node2</confluence.home>
                                </systemProperties>
                            </container>

                            <configuration>
                                <home>
                                    ${project.build.directory}/tomcat5x-node2/container</home>
                                <properties>
                                    <cargo.servlet.port>${cargo.servlet.port2}</cargo.servlet.port>
                                    <cargo.jvmargs>-Djava.awt.headless=true -Xms256m -Xmx512m</cargo.jvmargs>
                                </properties>
                            </configuration>
                        </configuration>
                    </execution>
                    <execution>
                        <id>deploy-containers</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                        <configuration>
                            <deployer>
                                <deployables>
                                    <deployable>
                                        <groupId>test-webapp</groupId>
                                        <artifactId>test-webapp</artifactId>
                                        <type>war</type>
                                        <location>test-webapp.war</location>
                                        <pingURL>http://localhost:12195/</pingURL>
                                        <pingTimeout>240000</pingTimeout>
                                    </deployable>
                                    <deployable>
                                        <groupId>test-webapp</groupId>
                                        <artifactId>test-webapp</artifactId>
                                        <type>war</type>
                                        <location>test-webapp.war</location>
                                        <pingURL>http://localhost:12197/</pingURL>
                                        <pingTimeout>240000</pingTimeout>
                                    </deployable>
                                </deployables>
                            </deployer>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop-container</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
