<?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>3.1.0-OD-10-001-D20151230T153608</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.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>

            <!-- Tests require an older http client version -->
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${apache.httpclient.test.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient-cache</artifactId>
                <version>${apache.httpclient.test.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore</artifactId>
                <version>${apache.httpcore.test.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpmime</artifactId>
                <version>${apache.httpclient.test.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.jersey.contribs</groupId>
                <artifactId>jersey-multipart</artifactId>
                <version>${jersey.version}</version>
            </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>

        <apache.httpclient.test.version>4.2.1-atlassian-2</apache.httpclient.test.version>
        <apache.httpcore.test.version>4.2.2</apache.httpcore.test.version>

        <rest.java.client.version>3.0.0</rest.java.client.version>

        <oracle.atlassian.plugins.enable.wait>240</oracle.atlassian.plugins.enable.wait>
    </properties>

    <modules>
        <module>web-test-fixtures</module>
        <module>condition-plugin</module>
        <module>js-unit-tests-parent</module>
        <module>servicedesk-testutils-plugin</module>
        <module>applinks-util-plugin</module>
        <module>integration-tests-parent</module>
        <module>tpm</module>
    </modules>

    <profiles>
        <!-- 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>
        </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>
        </profile>

        <!-- Oracle -->
        <profile>
            <id>Oracle</id>
            <properties>
                <db.artifactGroup>com.oracle</db.artifactGroup>
                <db.artifactId>ojdbc6</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 4 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>
