<?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">
    <parent>
        <groupId>com.atlassian.servicedesk</groupId>
        <artifactId>servicedesk-parent-pom</artifactId>
        <version>1000.63.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>servicedesk-tests-parent</artifactId>
    <name>Service Desk Test Parent POM</name>
    <packaging>pom</packaging>

    <dependencyManagement>
        <dependencies>
            <!--
                Declare the atlassian selenium dependencies in the test parent pom to avoid transitive dependency resolution
                issues.
            -->
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-pageobjects-api</artifactId>
                <version>${atlassian.selenium.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.jira</groupId>
                <artifactId>jira-projects-page-objects</artifactId>
                <version>${jira.projects.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-webdriver-core</artifactId>
                <version>${atlassian.selenium.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-pageobjects-elements</artifactId>
                <version>${atlassian.selenium.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient-cache</artifactId>
                <version>${httpclient.cache.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpmime</artifactId>
                <version>${httpclient.version}</version>
            </dependency>
           <dependency>
                <groupId>com.atlassian</groupId>
                <artifactId>test-batching</artifactId>
                <version>2.0.1</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.jira</groupId>
                <artifactId>jira-rest-java-client-api</artifactId>
                <version>${rest.java.client.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.jira</groupId>
                <artifactId>jira-rest-java-client-core</artifactId>
                <version>${rest.java.client.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-context</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence-stateless-test-runner</artifactId>
                <version>${confluence.test.runner.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit-dep</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>log4j-over-slf4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence-webdriver-pageobjects</artifactId>
                <version>${confluence.webdriver.pageobjects.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit-dep</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <properties>
        <license.scope>test</license.scope>

        <!-- base JVM args for JIRA test runners -->
        <jira.user.jvmargs>-Duser.language=en -Duser.region=AU -Duser.timezone=Australia/Sydney</jira.user.jvmargs>
        <jira.test.runner.jvmargs>-Dfile.encoding=utf-8 ${jira.user.jvmargs}</jira.test.runner.jvmargs>

        <httpclient.cache.version>4.4.1</httpclient.cache.version>
        <rest.java.client.version>4.0.0</rest.java.client.version>

        <oracle.atlassian.plugins.enable.wait>300</oracle.atlassian.plugins.enable.wait>
        <mysql.atlassian.plugins.enable.wait>300</mysql.atlassian.plugins.enable.wait>
        <mssql.atlassian.plugins.enable.wait>300</mssql.atlassian.plugins.enable.wait>
    </properties>

    <profiles>
        <profile>
            <!-- This profile will include the test modules and thus build them when its activated.
                 It will always be enabled unless it has been explcitly disabled via: -P-with-integration-tests-module
                 That will enable us to get rid of the dreaded -pl list for master -->
            <id>with-test-modules</id>
            <modules>
                <module>web-test-fixtures</module>
                <module>condition-plugin</module>
                <module>servicedesk-testutils-plugin</module>
                <module>applinks-util-plugin</module>
                <module>integration-tests-parent</module>
                <module>tpm</module>
            </modules>
            <activation>
                <!-- hack to really always enable the profile, unless its explicitly disabled -->
                <jdk>[1.8,)</jdk>
            </activation>
        </profile>
        <!-- Database profiles - select the appropriate JDBC driver. Versions are controlled in depMgt and overridable via *.jdbc.version properties -->

        <!-- MSSQL -->
        <profile>
            <id>MSSQL</id>
            <properties>
                <db.artifactGroup>net.sourceforge.jtds</db.artifactGroup>
                <db.artifactId>jtds</db.artifactId>
                <db.artifactVersion>${mssql.jdbc.version}</db.artifactVersion>
                <db.ofBizFieldType>mssql</db.ofBizFieldType>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-jira-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <!--
                                    Service Desk takes longer to start up with MS SQL when running TPMs,
                                    so let's wait 5 minutes rather than the default 1 minute.
                                -->
                                <atlassian.plugins.enable.wait>${mssql.atlassian.plugins.enable.wait}</atlassian.plugins.enable.wait>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- MySQL -->
        <profile>
            <id>MySQL</id>
            <properties>
                <db.artifactGroup>mysql</db.artifactGroup>
                <db.artifactId>mysql-connector-java</db.artifactId>
                <db.artifactVersion>${mysql.jdbc.version}</db.artifactVersion>
                <db.ofBizFieldType>mysql</db.ofBizFieldType>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-jira-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <!--
                                    Service Desk takes longer to start up with MySQL when running TPMs,
                                    so let's wait 5 minutes rather than the default 1 minute.
                                -->
                                <atlassian.plugins.enable.wait>${mysql.atlassian.plugins.enable.wait}</atlassian.plugins.enable.wait>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Oracle -->
        <profile>
            <id>Oracle</id>
            <properties>
                <db.artifactGroup>com.oracle</db.artifactGroup>
                <db.artifactId>${oracle.jdbc.artifactId}</db.artifactId>
                <db.artifactVersion>${oracle.jdbc.version}</db.artifactVersion>
                <db.ofBizFieldType>oracle10g</db.ofBizFieldType>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-jira-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <!--
                                    Service Desk takes longer to start up with Oracle when running TPMs,
                                    so let's wait 5 minutes rather than the default 1 minute.
                                -->
                                <atlassian.plugins.enable.wait>${oracle.atlassian.plugins.enable.wait}</atlassian.plugins.enable.wait>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Postgres -->
        <profile>
            <id>Postgres</id>
            <properties>
                <db.artifactGroup>postgresql</db.artifactGroup>
                <db.artifactId>postgresql</db.artifactId>
                <db.artifactVersion>${postgres.jdbc.version}</db.artifactVersion>
                <db.ofBizFieldType>postgres72</db.ofBizFieldType>
            </properties>
        </profile>
    </profiles>
</project>
