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

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.pom</groupId>
        <artifactId>closedsource-pom</artifactId>
        <version>5.0.21</version>
    </parent>

    <scm>
        <connection>scm:git:ssh://git@bitbucket.org/atlassian/remote-link-aggregator.git</connection>
        <developerConnection>scm:git:ssh://git@bitbucket.org/atlassian/remote-link-aggregator.git</developerConnection>
        <url>https://bitbucket.org/atlassian/remote-link-aggregator</url>
      <tag>remote-link-aggregator-3.0.0</tag>
  </scm>

    <groupId>com.atlassian.plugins</groupId>
    <artifactId>remote-link-aggregator</artifactId>
    <version>3.0.0</version>
    <packaging>pom</packaging>
    <licenses>
        <license>
            <name>Atlassian End User License</name>
            <url>https://www.atlassian.com/end-user-agreement/</url>
            <comments>Atlassian 3.0 End User License Agreement</comments>
        </license>
    </licenses>

    <name>Remote Link Aggregator</name>
    <description>Aggregates counts of outbound links to a given external entity.</description>

    <modules>
        <module>remote-link-aggregator-api</module>
        <module>remote-link-aggregator-plugin</module>
        <module>jira-remote-link-aggregator-plugin</module>
    </modules>

    <properties>
        <platform.version>5.0.0-m11</platform.version>

        <amps.version>8.0.0-m6</amps.version>
        <jira.version>8.0.0-m0028</jira.version>

        <atlassian.json.version>0.11</atlassian.json.version>
        <atlassian-nav-links.version>5.0.0</atlassian-nav-links.version>

        <atlassian-plugin.description>${project.description}</atlassian-plugin.description>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>amps-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>amps-dispatcher-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>jira-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <!-- sensible defaults -->
                        <productVersion>${jira.version}</productVersion>
                        <productDataVersion>${jira.version}</productDataVersion>
                        <extractDependencies>false</extractDependencies>

                        <!-- disable AMPS bloat -->
                        <skipAllPrompts>true</skipAllPrompts>
                        <enableFastdev>false</enableFastdev>
                        <enableDevToolbox>false</enableDevToolbox>
                    </configuration>
                </plugin>
                <plugin>
                    <!-- use local checkout with Git -->
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <localCheckout>true</localCheckout>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

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

            <!-- Inter-module -->
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>jira-remote-link-aggregator-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>remote-link-aggregator-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>remote-link-aggregator-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Atlassian -->
            <dependency>
                <groupId>com.atlassian.jira</groupId>
                <artifactId>jira-api</artifactId>
                <version>${jira.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.json</groupId>
                <artifactId>atlassian-json-api</artifactId>
                <version>${atlassian.json.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-nav-links-api</artifactId>
                <version>${atlassian-nav-links.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-nav-links-plugin</artifactId>
                <version>${atlassian-nav-links.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- External -->
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.10</version>
                <scope>provided</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile> <!-- Used for snapshots so we don't have caching problems and know which git revision was used -->
            <id>stamp</id>
            <activation>
                <property>
                    <name>!skipCommitIdStamp</name>
                </property>
            </activation>
            <properties>
                <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ssZ</maven.build.timestamp.format>
                <!-- place the revision and build date in the plugin description -->
                <atlassian-plugin.description>${project.description} (rev: ${git.commit.id.short}, date: ${maven.build.timestamp})</atlassian-plugin.description>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>buildnumber-maven-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <id>get-commit-id</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>create</goal>
                                    <goal>create-timestamp</goal>
                                </goals>
                                <configuration>
                                    <buildNumberPropertyName>git.commit.id.long</buildNumberPropertyName>
                                </configuration>
                            </execution>
                            <execution>
                                <id>get-short-commit-id</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>create</goal>
                                </goals>
                                <configuration>
                                    <buildNumberPropertyName>git.commit.id.short</buildNumberPropertyName>
                                    <shortRevisionLength>7</shortRevisionLength>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- set the Git commit id -->
                            <revisionOnScmFailure>unknown</revisionOnScmFailure>
                            <getRevisionOnlyOnce>true</getRevisionOnlyOnce>

                            <!-- also set the build timestamp -->
                            <timestampFormat>yyyy-MM-dd'T'HH:mm:ssZ</timestampFormat>
                            <timestampPropertyName>maven.build.timestamp</timestampPropertyName>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <configuration>
                            <archive>
                                <manifestEntries>
                                    <Atlassian-Commit-Id>${git.commit.id.long}</Atlassian-Commit-Id>
                                </manifestEntries>
                            </archive>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
