<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>stash-parent</artifactId>
        <groupId>com.atlassian.stash</groupId>
        <version>2.6.0-rc2</version>
    </parent>

    <artifactId>stash-func-test-parent</artifactId>
    <packaging>pom</packaging>
    <name>Atlassian Stash Functional Tests Parent</name>

    <modules>
        <module>common</module>
        <module>page-objects</module>
        <module>hosting-test-util</module>
        <module>javascript-tests</module>
    </modules>
    <properties>
        <license.scope>test</license.scope>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>maven-stash-plugin</artifactId>
                    <configuration>
                        <skipITs>${skipIntegrationTests}</skipITs>
                        <skipTests>${skipIntegrationTests}</skipTests>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <!-- There are no unit tests below this module, only integration tests. Surefire is used to run
                             the unit tests, and Failsafe is used to run the integration tests. So we can fully disable
                             the Surefire plugin below here; it's not necessary. -->
                        <skipTests>true</skipTests>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <!-- builds all artifacts required for amps. The amps.prepare profile activated by the
                 release plugin (see maven-release-plugin) -->
            <id>amps.prepare</id>
            <modules>
                <module>plugin-test-resources</module>
            </modules>
        </profile>

        <!-- mvn install -Pit runs the integration tests -->
        <profile>
            <id>it</id>
            <modules>
                <!-- plugin-test-resources needs to be before func-tests, because it
                generates the initial home for the tests. -->
                <module>plugin-test-resources</module>
                <module>browser</module>
                <module>rest</module>
                <module>hosting</module>
                <module>migration</module>
                <module>setup</module>
            </modules>
        </profile>
        <profile>
            <id>it.soke</id>
            <modules>
                <module>soke</module>
            </modules>
        </profile>
        <profile>
            <id>it.smoke</id>
            <modules>
                <module>smoke</module>
            </modules>
        </profile>
        <profile>
            <id>it.browser</id>
            <modules>
                <!-- plugin-test-resources needs to be before func-tests, because it
                     generates the initial home for the tests. -->
                <module>plugin-test-resources</module>
                <module>browser</module>
            </modules>
        </profile>
        <profile>
            <id>it.rest</id>
            <modules>
                <!-- plugin-test-resources needs to be before func-tests, because it
                     generates the initial home for the tests. -->
                <module>plugin-test-resources</module>
                <module>rest</module>
            </modules>
        </profile>
        <profile>
            <id>it.hosting</id>
            <modules>
                <!-- plugin-test-resources needs to be before func-tests, because it
                     generates the initial home for the tests. -->
                <module>plugin-test-resources</module>
                <module>hosting</module>
            </modules>
        </profile>
        <profile>
            <id>it.setup</id>
            <modules>
                <module>setup</module>
            </modules>
        </profile>
        <profile>
            <id>it.migration</id>
            <modules>
                <!-- plugin-test-resources needs to be before func-tests, because it
                     generates the initial home for the tests. -->
                <module>plugin-test-resources</module>
                <module>migration</module>
            </modules>
        </profile>
    </profiles>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.stash</groupId>
                <artifactId>stash-func-test-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.stash</groupId>
                <artifactId>stash-page-objects</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
