<?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>
        <artifactId>servicedesk-tests-parent</artifactId>
        <groupId>com.atlassian.servicedesk</groupId>
        <version>1000.105.0</version>
    </parent>

    <artifactId>servicedesk-testutils-plugin</artifactId>
    <name>Service Desk Tests Utils Plugin</name>

    <description>Adds the service desk backdoor and some useful client side resources</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>integration-test-data-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version> <!-- special case, needs 2.4 to work, but in compile scope-->
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin.timedpromise</groupId>
            <artifactId>atlassian-timed-promise-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-enablement</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassian.plugin</groupId>
                    <artifactId>atlassian-spring-scanner-annotation</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jira-servicedesk</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassian.plugin</groupId>
                    <artifactId>atlassian-spring-scanner-runtime</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugin</groupId>
                    <artifactId>atlassian-spring-scanner-annotation</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>servicedesk-reports-plugin</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassian.plugin</groupId>
                    <artifactId>atlassian-spring-scanner-runtime</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atlassian.plugin</groupId>
                    <artifactId>atlassian-spring-scanner-annotation</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.ofbiz</groupId>
            <artifactId>entityengine</artifactId>
        </dependency>

        <!-- REST Client that uses Spray JSON and more -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>jira-servicedesk-public-rest-api-internal-client</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-step</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.annotations</groupId>
            <artifactId>atlassian-annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>sd-testing-backdoors</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-api-commons</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.event</groupId>
            <artifactId>atlassian-event</artifactId>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.mail</groupId>
            <artifactId>atlassian-mail</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-rest</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>jira-servicedesk-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>jira-servicedesk-internal-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!--Run time dependencies-->
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>javax.mail-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <scope>provided</scope>
        </dependency>

    </dependencies>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <excludes>
                            <exclude>**/*$*</exclude>
                            <exclude>it/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>maven-amps-dispatcher-plugin</artifactId>
                    <version>${amps.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>
                    <enableFastdev>false</enableFastdev>

                    <!--
                    ***************************************************

                    Keep this section at the very bottom of the pom file since we need to update it frequently and hence
                    going to the bottom of the file will make us all better developers and be able to live in peace and
                    git merge harmony

                    ***************************************************
                    -->
                    <instructions>
                        <Private-Package>
                        </Private-Package>
                        <Require-Bundle>
                        </Require-Bundle>

                        <Export-Package>
                            com.atlassian.servicedesk.backdoor,
                            com.atlassian.servicedesk.backdoor.*
                        </Export-Package>

                        <!--optionals first, in alphabetic order, followed by mandatories, in alphabetic order-->
                        <Import-Package>
                            com.atlassian.pocketknife.api.commons.jira,
                            com.atlassian.pocketknife.api.commons.error,
                            com.atlassian.pocketknife.api.commons.result,
                            com.atlassian.servicedesk.internal.visiblefortesting,
                            com.atlassian.servicedesk.plugins.lingo.internal.visiblefortesting,
                            com.atlassian.servicedesk.plugins.reports.internal.visiblefortesting,
                            com.atlassian.servicedesk.plugins.reports.internal.visiblefortesting.response,
                            com.atlassian.servicedesk.plugins.approvals.internal.visiblefortesting;resolution:="optional",

                            com.atlassian.servicedesk.workinprogressapi.sla.threshold,
                            !com.atlassian.refapp.api,

                            !javax.portlet,

                            *;resolution:="optional"
                        </Import-Package>
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <artifactDir>${project.basedir}/../../passed-artifacts</artifactDir>
    </properties>

    <profiles>
        <profile>
            <!-- Defines the location of Service Desk dependencies at the location where Bamboo places them -->
            <id>ci-deps</id>
            <dependencies>
                <dependency>
                    <groupId>com.atlassian.servicedesk</groupId>
                    <artifactId>sd-testing-backdoors</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${artifactDir}/sd-testing-backdoors/target/sd-testing-backdoors-${project.version}.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>
