<?xml version="1.0"?>
<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>7.0.0</version>
    </parent>
    <groupId>com.atlassian.prettyurls</groupId>
    <artifactId>atlassian-pretty-urls-parent</artifactId>
    <version>6.0.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-6.0.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.dependencies</groupId>
                <artifactId>platform-public-api</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-deprecated-public-api</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-internal-api</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.prettyurls</groupId>
                <artifactId>atlassian-pretty-urls-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.prettyurls</groupId>
                <artifactId>atlassian-pretty-urls-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.prettyurls</groupId>
                <artifactId>atlassian-pretty-urls-reference-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>amps-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                    <configuration>
                        <platformVersion>${platform.version}</platformVersion>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>com.atlassian.maven.enforcer</groupId>
                            <artifactId>maven-enforcer-rules</artifactId>
                            <version>1.5.20</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>ban-milestones-and-release-candidates</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <banVersionDeps>
                                        <excludes>
                                            <!-- TODO remove the whole definition after updated to the stable version of Platform -->
                                            <exclude>com.atlassian.templaterenderer:atlassian-template-renderer-api</exclude>
                                        </excludes>
                                    </banVersionDeps>
                                    <banVersionDeps>
                                        <ignoreProvided>true</ignoreProvided>
                                    </banVersionDeps>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>2.43.0</version>
                <configuration>
                    <java>
                        <palantirJavaFormat>
                            <version>2.28.0</version>
                        </palantirJavaFormat>
                        <importOrder>
                            <wildcardsLast>true</wildcardsLast>
                            <order>java|javax|jakarta,lombok,org.spring|org|com|io,,com.atlassian,com.atlassian
                            .beacon|\#,\#com.atlassian</order>
                        </importOrder>
                        <removeUnusedImports />
                    </java>
                </configuration>
            </plugin>
        </plugins>
    </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.42.0</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>8.0.0-jakarta-m030</platform.version>
        <amps.version>9.3.2</amps.version>
        <!-- To match platform version -->
        <refapp.version>${platform.version}</refapp.version>
        <!-- These may be set by plans on product Bamboos -->
        <jira.version>6.3</jira.version>
        <confluence.version>9.0.0-m78</confluence.version>
        <quick.reload.version>1.30.5</quick.reload.version>
        <atlassian.scanner.version>2.2.5</atlassian.scanner.version>
        <jvm.debug.suspend>false</jvm.debug.suspend>
        <junit.version>4.13.2</junit.version>
        <mockito.version>5.10.0</mockito.version>
        <hamcrest.version>2.2</hamcrest.version>
        <sitemesh.version>2.6.0</sitemesh.version>
        <failOnMilestoneOrReleaseCandidateDeps>false</failOnMilestoneOrReleaseCandidateDeps>
    </properties>
</project>
