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

    <groupId>com.atlassian.prettyurls</groupId>
    <artifactId>atlassian-pretty-urls-parent</artifactId>
    <version>4.1.1</version>
    <packaging>pom</packaging>

    <name>Atlassian Pretty URLs Parent</name>
    <description>Pretty URL support in Atlassian products</description>

    <organization>
        <name>Atlassian</name>
        <url>http://www.atlassian.com/</url>
    </organization>

    <licenses>
        <license>
            <name>BSD License</name>
            <url>http://opensource.org/licenses/BSD-3-Clause</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <issueManagement>
        <system>Jira</system>
        <url>https://ecosystem.atlassian.net/browse/PRETTY</url>
    </issueManagement>
    <ciManagement>
        <system>Bamboo</system>
        <url>https://ecosystem-bamboo.internal.atlassian.com/browse/PRETTY</url>
    </ciManagement>
    <scm>
        <connection>scm:git:git@bitbucket.org:atlassian/atlassian-pretty-urls.git</connection>
        <developerConnection>scm:git:git@bitbucket.org:atlassian/atlassian-pretty-urls.git</developerConnection>
        <url>https://bitbucket.org/atlassian/atlassian-pretty-urls</url>
        <tag>atlassian-pretty-urls-parent-4.1.1</tag>
    </scm>

    <modules>
        <module>atlassian-pretty-urls-api</module>
        <module>atlassian-pretty-urls-plugin</module>
        <module>atlassian-pretty-urls-reference-plugin</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Platform modules -->
            <dependency>
                <groupId>com.atlassian.platform</groupId>
                <artifactId>third-party</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.atlassian.annotations</groupId>
                <artifactId>atlassian-annotations</artifactId>
                <version>${atlassian.annotations.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.event</groupId>
                <artifactId>atlassian-event</artifactId>
                <version>${atlassian.event.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins.rest</groupId>
                <artifactId>atlassian-rest-common</artifactId>
                <version>${atlassian.plugins.rest.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins.rest</groupId>
                <artifactId>com.atlassian.jersey-library</artifactId>
                <version>${atlassian.plugins.rest.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-api</artifactId>
                <version>${atlassian.plugins.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-core</artifactId>
                <version>${atlassian.plugins.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-osgi</artifactId>
                <version>${atlassian.plugins.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-servlet</artifactId>
                <version>${atlassian.plugins.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-spring</artifactId>
                <version>${atlassian.plugins.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-webfragment-api</artifactId>
                <version>${atlassian.plugins.webfragment.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-webfragment</artifactId>
                <version>${atlassian.plugins.webfragment.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.sal</groupId>
                <artifactId>sal-api</artifactId>
                <version>${atlassian.sal.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.templaterenderer</groupId>
                <artifactId>atlassian-template-renderer-api</artifactId>
                <version>${atlassian.templaterenderer.version}</version>
            </dependency>
            <dependency>
                <groupId>io.atlassian.fugue</groupId>
                <artifactId>fugue</artifactId>
                <version>${atlassian.fugue.version}</version>
            </dependency>
            <dependency>
                <groupId>io.atlassian.util.concurrent</groupId>
                <artifactId>atlassian-util-concurrent</artifactId>
                <version>${atlassian.util.concurrent.version}</version>
            </dependency>

            <dependency>
                <groupId>com.sun.jersey</groupId>
                <artifactId>jersey-core</artifactId>
                <version>${jersey.core.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>amps-maven-plugin</artifactId>
                    <version>${amps8.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>postgres84</id>
            <properties>
                <postgres.wait.condition>database system is ready to accept connections</postgres.wait.condition>
            </properties>
        </profile>
        <profile>
            <id>postgres95</id>
            <properties>
                <postgres.wait.condition>PostgreSQL init process complete; ready for start up.</postgres.wait.condition>
            </properties>
        </profile>
        <profile>
            <!-- Postgres-in-Docker config for JIRA Cloud, which is Postgres-only.
                 Use together with 'postgres84' or 'postgres95' profile. -->
            <id>jira-cloud</id>
            <properties>
                <!-- The pass-through port at which docker-maven-plugin will expose the real postgres, see below -->
                <postgres.port>15432</postgres.port>
                <postgres.dbname>jira</postgres.dbname>
                <postgres.user>jira</postgres.user>
                <postgres.password>jira</postgres.password>
                <postgres.jdbc.driver.version>9.2-1003-jdbc4</postgres.jdbc.driver.version>
                <!-- This may be set by Bamboo plans on JCBAC -->
                <postgres.docker.image>docker.atlassian.io/armata/postgres/8.4/jira/1000</postgres.docker.image>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <version>${postgres.jdbc.driver.version}</version>
                </dependency>
            </dependencies>

            <build>
                <pluginManagement>
                    <plugins>
                        <!-- Postgres running in docker, configured to start/stop with integration tests
                             where docker-maven-plugin is activated in submodules -->
                        <plugin>
                            <groupId>io.fabric8</groupId>
                            <artifactId>docker-maven-plugin</artifactId>
                            <version>0.27.2</version>

                            <configuration>
                                <images>
                                    <image>
                                        <alias>postgres-db</alias>
                                        <name>${postgres.docker.image}</name>
                                        <run>
                                            <env>
                                                <POSTGRES_USER>${postgres.user}</POSTGRES_USER>
                                                <POSTGRES_PASSWORD>${postgres.password}</POSTGRES_PASSWORD>
                                                <POSTGRES_DB>${postgres.dbname}</POSTGRES_DB>
                                                <POSTGRES_INITDB_ARGS>--encoding=UTF8</POSTGRES_INITDB_ARGS>
                                            </env>
                                            <ports>
                                                <port>${postgres.port}:5432</port>
                                            </ports>
                                            <wait>
                                                <log>${postgres.wait.condition}</log>
                                                <time>45000</time>
                                                <kill>5000</kill>
                                                <shutdown>2000</shutdown>
                                            </wait>
                                            <log>
                                                <prefix>postgres</prefix>
                                                <date>default</date>
                                                <color>cyan</color>
                                            </log>
                                        </run>
                                    </image>
                                </images>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>start</id>
                                    <!-- TODO: This should be in "pre-integration-test" phase,
                                         but AMPS loads its systemPropertyVariables config in "test" phase,
                                         and we need the docker.host.address variable there,
                                         so unfortunately we're forced to start Docker before "test",
                                         hence this is the latest phase that works. Please change when AMPS is gone! -->
                                    <phase>process-test-classes</phase>
                                    <goals>
                                        <goal>start</goal>
                                    </goals>
                                </execution>
                                <execution>
                                    <id>stop</id>
                                    <phase>post-integration-test</phase>
                                    <goals>
                                        <goal>stop</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>

    <properties>
        <prettyurls.plugin.key>com.atlassian.prettyurls.atlassian-pretty-urls-plugin</prettyurls.plugin.key>

        <!-- Platform -->
        <platform.version>6.0.16</platform.version>
        <amps8.version>8.6.0</amps8.version>

        <atlassian.annotations.version>4.0.0</atlassian.annotations.version>
        <atlassian.event.version>5.0.1</atlassian.event.version>
        <atlassian.fugue.version>4.7.2</atlassian.fugue.version>
        <atlassian.plugins.rest.version>7.0.3</atlassian.plugins.rest.version>
        <atlassian.plugins.version>7.0.7</atlassian.plugins.version>
        <atlassian.plugins.webfragment.version>6.0.0</atlassian.plugins.webfragment.version>
        <atlassian.sal.version>5.0.2</atlassian.sal.version>
        <atlassian.templaterenderer.version>4.0.4</atlassian.templaterenderer.version>
        <atlassian.util.concurrent.version>4.0.1</atlassian.util.concurrent.version>

        <!-- To match platform version -->
        <refapp.version>6.0.0-m02</refapp.version>

        <!-- These may be set by plans on product Bamboos -->
        <jira.version>6.3</jira.version>
        <confluence.version>5.9.4</confluence.version>

        <quick.reload.version>1.7</quick.reload.version>
        <atlassian.scanner.version>2.1.17</atlassian.scanner.version>

        <jvm.debug.suspend>false</jvm.debug.suspend>

        <jersey.core.version>1.19.4</jersey.core.version>
    </properties>
</project>
