<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-platform-parent</artifactId>
        <version>10.0.0.beta11</version>
    </parent>
    <artifactId>vaadin-platform-test</artifactId>
    <packaging>war</packaging>
    <name>Vaadin Platform Tests</name>
    <description>Vaadin Platform Tests</description>
    <url>http://vaadin.com</url>
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <failOnMissingWebXml>false</failOnMissingWebXml>
        <maven.deploy.skip>true</maven.deploy.skip>
        <sauce.options>--tunnel-identifier ${maven.build.timestamp}</sauce.options>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <pluginRepositories>
        <pluginRepository>
            <id>vaadin-pre-relase</id>
            <url>http://maven.vaadin.com/vaadin-prereleases</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin</artifactId>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-server-production-mode</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-testbench</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${project.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>copy-production-files</goal>
                            <goal>package-for-production</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.3.7.v20160115</version>
                <configuration>
                    <stopPort>9999</stopPort>
                    <stopWait>5</stopWait>
                    <stopKey>foo</stopKey>
                </configuration>
                <executions>
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deploy-war</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-jetty</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.20</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <systemPropertyVariables>
                        <sauce.user>${sauce.user}</sauce.user>
                        <sauce.sauceAccessKey>${sauce.sauceAccessKey}</sauce.sauceAccessKey>
                        <sauce.options>${sauce.options}</sauce.options>
                    </systemPropertyVariables>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.saucelabs.maven.plugin</groupId>
                <artifactId>sauce-connect-plugin</artifactId>
                <version>2.1.23</version>
                <dependencies>
                    <dependency>
                        <groupId>com.saucelabs</groupId>
                        <artifactId>ci-sauce</artifactId>
                        <version>1.132</version>
                    </dependency>
                </dependencies>
                <executions>
                    <!-- Start Sauce Connect prior to running the integration 
                        tests -->
                    <execution>
                        <id>start-sauceconnect</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start-sauceconnect</goal>
                        </goals>
                    </execution>
                    <!-- Stop the Sauce Connect process after the integration 
                        tests have finished -->
                    <execution>
                        <id>stop-sauceconnect</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop-sauceconnect</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>1.0.0</version>
                <executions>
                    <execution>
                        <id>read-local-properties-if-present</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>read-project-properties</goal>
                        </goals>
                        <configuration>
                            <files>
                                <file>../local.properties</file>
                            </files>
                            <quiet>true</quiet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>
