<?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.plugins</groupId>
        <artifactId>remote-link-aggregator</artifactId>
        <version>3.0.0</version>
    </parent>

    <artifactId>jira-remote-link-aggregator-plugin</artifactId>

    <name>JIRA Remote Link Aggregator Plugin</name>
    <description>Aggregates counts of JIRA outbound links to a given external entity.</description>
    <packaging>atlassian-plugin</packaging>

    <properties>
        <atlassian.plugin.key>com.atlassian.plugins.jira-remote-link-aggregator-plugin</atlassian.plugin.key>
        <enforcer.skip>true</enforcer.skip>
        <skipITs>true</skipITs> <!-- skip integration tests by default -->
        <xvfb.enable>false</xvfb.enable>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>remote-link-aggregator-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Webhooks -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-nav-links-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-host</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-module</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.json</groupId>
            <artifactId>atlassian-json-api</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/xml</directory>
                <targetPath>xml</targetPath>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>

        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>jira-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>remote-link-aggregator-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                    <instructions>
                        <Import-Package>
                            com.atlassian.linkaggregation.*,
                            com.atlassian.json.*;resolution:="optional",
                            org.slf4j;resolution:="optional",
                            com.google.common.base;resolution:="mandatory",
                            com.google.common.cache;resolution:="mandatory",
                            com.google.common.collect;resolution:="optional",
                            com.atlassian.jira.*,
                            com.atlassian.plugin;resolution:="mandatory",
                            com.atlassian.plugin.descriptors;resolution:="mandatory",
                            com.atlassian.plugin.module;resolution:="mandatory",
                            com.atlassian.plugins.capabilities.api,
                            com.atlassian.plugins.rest.common.security;resolution:="optional",
                            com.atlassian.applinks.host.spi;resolution:="mandatory",
                            com.atlassian.applinks.api*;resolution:="mandatory",
                            com.atlassian.sal.api*;resolution:="mandatory",
                            com.atlassian.event.api*;resolution:="mandatory",
                            io.atlassian.util.concurrent;resolution:="optional",
                            javax.annotation;resolution:="mandatory",
                            javax.ws.rs;resolution:="optional",
                            javax.ws.rs.core;resolution:="optional",
                            org.codehaus.jackson;resolution:="optional",
                            org.codehaus.jackson.annotate;resolution:="optional",
                            org.codehaus.jackson.map;resolution:="optional",
                            org.codehaus.jackson.type;resolution:="optional",
                            org.dom4j,
                            org.joda.time,
                            org.springframework.beans.factory.*
                        </Import-Package>
                        <Private-Package />
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                        <Bundle-SymbolicName>${atlassian.plugin.key}</Bundle-SymbolicName>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>-Xmx512m -Dfile.encoding=ISO-8859-1 -Duser.language=en -Duser.region=AU</argLine>
                    <excludes>
                        <exclude>**/*$*</exclude>
                        <exclude>it/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
