<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">
    <!--
        Licensed to the Apache Software Foundation (ASF) under one or more
        contributor license agreements. See the NOTICE file distributed with
        this work for additional information regarding copyright ownership.
        The ASF licenses this file to You under the Apache License, Version
        2.0 (the "License"); you may not use this file except in compliance
        with the License. You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0 Unless required by
        applicable law or agreed to in writing, software distributed under the
        License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
        CONDITIONS OF ANY KIND, either express or implied. See the License for
        the specific language governing permissions and limitations under the
        License.
    -->

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.openwebbeans.it</groupId>
        <artifactId>openwebbeans-web-it-forward</artifactId>
        <version>@project.version@</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <groupId>org.apache.openwebbeans.it</groupId>
    <artifactId>openwebbeans-web-it-forward-test</artifactId>
    <packaging>jar</packaging>

    <!--
        For locally debugging this integration test you need to first build the module.
        Afterwards cd into target/it/webcdiapp and start tomcat with
        $ mvn clean package tomcat7:run -Dtomcat.fork=false
    -->

    <properties>
        <tomcat.fork>true</tomcat.fork>
        <tomcat.port.it>8089</tomcat.port.it>
    </properties>


    <dependencies>

        <dependency>
            <groupId>org.apache.openwebbeans.it</groupId>
            <artifactId>openwebbeans-web-it-forward-a</artifactId>
            <version>@project.version@</version>
            <type>war</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.openwebbeans.it</groupId>
            <artifactId>openwebbeans-web-it-forward-b</artifactId>
            <version>@project.version@</version>
            <type>war</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>


        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${httpclient.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>


    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <version>2.2</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.tomcat.embed</groupId>
                            <artifactId>tomcat-embed-core</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-util</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-coyote</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-api</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-jdbc</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-dbcp</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-servlet-api</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-jsp-api</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-jasper</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-jasper-el</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-el-api</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-catalina</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-tribes</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-catalina-ha</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-annotations-api</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat</groupId>
                            <artifactId>tomcat-juli</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.apache.tomcat.embed</groupId>
                            <artifactId>tomcat-embed-logging-juli</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.tomcat.embed</groupId>
                            <artifactId>tomcat-embed-logging-log4j</artifactId>
                            <version>${tomcat7.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.11</version>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>verify</id>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <path>/${project.build.finalName}</path>
                    <port>${tomcat.port.it}</port>
                    <fork>${tomcat.fork}</fork> <!-- true is needed for IT, but if we want to debug it we do not want to fork -->
                    <webapps>
                        <webapp>
                            <groupId>org.apache.openwebbeans.it</groupId>
                            <artifactId>openwebbeans-web-it-forward-a</artifactId>
                            <version>@project.version@</version>
                            <type>war</type>
                            <asWebapp>true</asWebapp>
                            <contextPath>/a</contextPath>
                        </webapp>
                        <webapp>
                            <groupId>org.apache.openwebbeans.it</groupId>
                            <artifactId>openwebbeans-web-it-forward-b</artifactId>
                            <version>@project.version@</version>
                            <type>war</type>
                            <asWebapp>true</asWebapp>
                            <contextPath>/b</contextPath>
                        </webapp>
                    </webapps>
                    <contextFile>src/main/tomcat/context.xml</contextFile>
                </configuration>
                <executions>
                    <execution>
                        <id>start-tomcat</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-tomcat</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>shutdown</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
