<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>weld-servlet-parent</artifactId>
        <groupId>org.jboss.weld.servlet</groupId>
        <version>2.2.3.Final</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>weld-servlet-test-tomcat</artifactId>
    <packaging>jar</packaging>
    <name>Weld Servlet Integration Tests (Tomcat)</name>

    <dependencies>

        <dependency>
            <groupId>org.jboss.spec.javax.ejb</groupId>
            <artifactId>jboss-ejb-api_3.1_spec</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
        </dependency>

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

        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet-test-base</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Weld servlet, EL and JSP required for testing CDI injections -->
        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-core-impl</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-core-jsf</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.faces</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-logging-juli</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Make sure this comes before Tomcat's EL on the classpath -->
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>el-impl</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <defaultGoal>test</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-test-report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report-only</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
                    <outputName>test-report</outputName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!--
                       Set parallel none to force a more modern JUnitCore
                       provider that understands Suites,
                       http://old.nabble.com/Maven-Surefire-and-newer-junit-features-td28539796.html
                    -->
                    <parallel>none</parallel>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <property>
                    <name>!incontainer</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!-- Skip the tests by default, they are all "incontainer" -->
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>incontainer</id>
            <activation>
                <property>
                    <name>incontainer</name>
                </property>
            </activation>
        </profile>

        <profile>
            <id>tomcat7</id>
            <activation>
                <property>
                    <name>!tomcat</name>
                </property>
            </activation>
            <dependencies>

                <dependency>
                    <groupId>org.jboss.arquillian.container</groupId>
                    <artifactId>arquillian-tomcat-embedded-7</artifactId>
                    <scope>test</scope>
                </dependency>

            </dependencies>
        </profile>

        <profile>
            <id>tomcat8</id>
            <activation>
                <property>
                    <name>tomcat</name>
                    <value>8</value>
                </property>
            </activation>

            <properties>
                <tomcat.version>${tomcat8.version}</tomcat.version>
            </properties>

            <dependencies>

                <dependency>
                    <groupId>org.jboss.arquillian.container</groupId>
                    <artifactId>arquillian-tomcat-embedded-8</artifactId>
                    <scope>test</scope>
                </dependency>

            </dependencies>

        </profile>

    </profiles>

</project>
