<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.applinks</groupId>
        <artifactId>applinks-parent</artifactId>
        <version>4.3.10</version>
    </parent>

    <artifactId>applinks-plugin</artifactId>
    <name>Applinks Product Plugin</name>
    <description>Plugin that facilitates discovery, connections and authentication with remote applications</description>
    <packaging>atlassian-plugin</packaging>

    <properties>
        <!-- override these to support multiple instances without clashing -->
        <applinks.build.directory>${basedir}/target</applinks.build.directory>
        <http.port>5990</http.port>
        <context.path>/refapp</context.path>
        <jvm.debug.port>5001</jvm.debug.port>
    </properties>

    <profiles>
        <profile>
            <id>refapp2</id>
            <properties>
                <applinks.build.directory>${basedir}/target_refapp2</applinks.build.directory>
                <http.port>5992</http.port>
                <jvm.debug.port>5002</jvm.debug.port>
            </properties>
        </profile>
        <profile>
            <id>refapp3</id>
            <properties>
                <applinks.build.directory>${basedir}/target_refapp3</applinks.build.directory>
                <http.port>5993</http.port>
                <jvm.debug.port>5003</jvm.debug.port>
            </properties>
        </profile>
        <!-- The profiles below can be used for running mvn amps:cli against any instance started from AMPS with
             default config, e.g. mvn amps:cli -Pjira -->
        <profile>
            <id>jira</id>
            <properties>
                <context.path>/jira</context.path>
                <http.port>2990</http.port>
            </properties>
        </profile>
        <profile>
            <id>confluence</id>
            <properties>
                <context.path>/confluence</context.path>
                <http.port>1990</http.port>
            </properties>
        </profile>
        <profile>
            <id>stash</id>
            <properties>
                <context.path>/stash</context.path>
                <http.port>7990</http.port>
            </properties>
        </profile>
        <profile>
            <id>fecru</id>
            <properties>
                <context.path>/fecru</context.path>
                <http.port>4990</http.port>
            </properties>
        </profile>
    </profiles>

    <build>
        <directory>${applinks.build.directory}</directory>
        <plugins>
            <!-- Runner plugins need to be explicitly defined here to pick up the parent configuration, because AMPS -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <log4jProperties>src/test/resources/log4j.properties</log4jProperties>
                    <instructions>
                        <!-- Ensure plugin is spring powered - see https://extranet.atlassian.com/x/xBS9hQ -->
                        <Spring-Context>*</Spring-Context>
                        <Import-Package>
                            javax.xml.bind*;version="2.1.0",
                            com.atlassian.jira.project;resolution:=optional,
                            com.cenqua.fisheye;resolution:=optional,
                            com.atlassian.confluence.spaces;resolution:=optional,
                            com.atlassian.bamboo.build;resolution:=optional,
                            net.oauth.*;version=20090617;resolution:=required,
                            org.json;resolution:=required,
                            com.atlassian.plugins.rest.common*;version=0.0.0,
                            com.atlassian.plugin.webresource*;version=0.0.0,
                            com.atlassian.sal.api*;version="2.10",
                            com.atlassian.velocity.htmlsafe;version=!,
                            com.atlassian.security.auth.trustedapps,
                            com.atlassian.templaterenderer*;version=!,
                            org.springframework.beans.factory;version="2.5",
                            org.springframework.beans.factory.annotation;version="2.5",
                            *;resolution:=optional
                        </Import-Package>
                    </instructions>
                    <products>
                        <product>
                            <id>refapp</id>
                            <version>${refapp.version}</version>
                        </product>
                    </products>
                    <libArtifacts>
                        <libArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>applinks-api</artifactId>
                            <version>${project.version}</version>
                        </libArtifact>
                        <libArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>applinks-host</artifactId>
                            <version>${project.version}</version>
                        </libArtifact>
                        <libArtifact>
                            <groupId>com.atlassian.applinks</groupId>
                            <artifactId>applinks-spi</artifactId>
                            <version>${project.version}</version>
                        </libArtifact>
                    </libArtifacts>
                    <pluginArtifacts>
                        <!-- uncomment to start refapp with applinks-tests plugin installed -->
                        <!--<pluginArtifact>-->
                        <!--<groupId>${project.groupId}</groupId>-->
                        <!--<artifactId>applinks-tests</artifactId>-->
                        <!--<version>${project.version}</version>-->
                        <!--</pluginArtifact>-->
                        <pluginArtifact>
                            <groupId>com.atlassian.oauth</groupId>
                            <artifactId>atlassian-oauth-api</artifactId>
                            <version>${oauth.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.oauth</groupId>
                            <artifactId>atlassian-oauth-consumer-spi</artifactId>
                            <version>${oauth.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.oauth</groupId>
                            <artifactId>atlassian-oauth-service-provider-spi</artifactId>
                            <version>${oauth.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.oauth</groupId>
                            <artifactId>atlassian-oauth-consumer-sal-plugin</artifactId>
                            <version>${oauth.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.oauth</groupId>
                            <artifactId>atlassian-oauth-consumer-plugin</artifactId>
                            <version>${oauth.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.oauth</groupId>
                            <artifactId>atlassian-oauth-service-provider-plugin</artifactId>
                            <version>${oauth.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.oauth</groupId>
                            <artifactId>atlassian-oauth-service-provider-sal-plugin</artifactId>
                            <version>${oauth.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.oauth</groupId>
                            <artifactId>atlassian-oauth-admin-plugin</artifactId>
                            <version>${oauth.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <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>com.atlassian.event</groupId>
            <artifactId>atlassian-event</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-module</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.util.concurrent</groupId>
            <artifactId>atlassian-util-concurrent</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.templaterenderer</groupId>
            <artifactId>atlassian-template-renderer-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.velocity.htmlsafe</groupId>
            <artifactId>velocity-htmlsafe</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webfragment</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-spring</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.cache</groupId>
            <artifactId>atlassian-cache-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- To support legacy Confluence action for managing space links -->
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>jsr250-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bundles</groupId>
            <artifactId>jsr305</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-service-provider-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.oauth.core</groupId>
            <artifactId>oauth</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-consumer-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.security.auth.trustedapps</groupId>
            <artifactId>atlassian-trusted-apps-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.analytics</groupId>
            <artifactId>analytics-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-nop</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-sal-plugin</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian</groupId>
            <artifactId>atlassian-localhost</artifactId>
        </dependency>

        <!-- TEST dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-test-resources</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.cache</groupId>
            <artifactId>atlassian-cache-memory</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.jettison</groupId>
            <artifactId>jettison</artifactId>
        </dependency>

        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>
