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

    <parent>
        <groupId>com.atlassian.servicedesk</groupId>
        <artifactId>servicedesk-components</artifactId>
        <version>4.5.10-REL-0001</version>
    </parent>

    <artifactId>servicedesk-reports-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>Service Desk Reports Plugin</name>
    <description>Plugin that handles reports for Service Desk</description>

    <dependencies>
        <!-- Atlassian Platform dependencies -->
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
        </dependency>
        <!-- SD -->
        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>jira-servicedesk-api</artifactId>
            <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.servicedesk</groupId>
            <artifactId>jira-workinghours-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>servicedesk-knowledge-base-plugin</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- JIRA -->
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-lucene-dmz</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Active Objects -->
        <dependency>
            <groupId>com.atlassian.activeobjects</groupId>
            <artifactId>activeobjects-plugin</artifactId>
        </dependency>
        <!-- Atlassian Pocketknife -->
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-api-commons</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-api-commons-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-api-commons-jira</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-ao-dao</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-enablement</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-querydsl</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-step</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-vertigo-annotations</artifactId>
        </dependency>
        <!-- Spring dependencies -->
        <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>

        <!-- Dependencies to other Atlassian lib/modules/plugins -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.atlassian.util.concurrent</groupId>
            <artifactId>atlassian-util-concurrent</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.event</groupId>
            <artifactId>atlassian-event</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.analytics</groupId>
            <artifactId>analytics-client-lib</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.analytics</groupId>
            <artifactId>analytics-client</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-module</artifactId>
            <scope>provided</scope>
        </dependency>

        <!--3rd party libs -->
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-sql</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mysema.commons</groupId>
            <artifactId>mysema-commons-lang</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</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>com.atlassian.jira</groupId>
            <artifactId>jira-tests</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.atlassian.fugue</groupId>
            <artifactId>fugue-hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>servicedesk-test-common</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.annotations</groupId>
            <artifactId>atlassian-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.scheduler</groupId>
            <artifactId>atlassian-scheduler-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-customfields</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webfragment-api</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <!-- tell maven to replace ${var} variables with their build time values -->
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/*DBIT.java</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <!-- using surefire for integration tests since AMPS completely ignores failsafe -->
                    <execution>
                        <id>integration-test-dbunit</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <excludes>
                                <exclude>none</exclude>
                            </excludes>
                            <includes>
                                <include>**/*DBIT.java</include>
                            </includes>
                            <skipTests>${dbunit.skip}</skipTests>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prepare-soy-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>../../misc/scripts/sd-prepare-soy.py</executable>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.util</groupId>
                <artifactId>db-schema-translator-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                <version>${atlassian.spring.scanner.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>atlassian-spring-scanner</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
                <configuration>
                    <scannedDependencies>
                        <dependency>
                            <groupId>com.atlassian.pocketknife</groupId>
                            <artifactId>jira-pocketknife-enablement</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>com.atlassian.pocketknife</groupId>
                            <artifactId>jira-pocketknife-customfields</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>com.atlassian.pocketknife</groupId>
                            <artifactId>atlassian-pocketknife-querydsl</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>com.atlassian.pocketknife</groupId>
                            <artifactId>jira-pocketknife-ao-dao</artifactId>
                        </dependency>
                    </scannedDependencies>
                    <verbose>false</verbose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>jira-maven-plugin</artifactId>
                <configuration>
                    <closureJsCompiler>true</closureJsCompiler>
                    <systemPropertyVariables>
                        <plugin.resource.directories>${basedir}/target/classes</plugin.resource.directories>
                    </systemPropertyVariables>
                    <instructions>
                        <Atlassian-Plugin-Key>com.atlassian.servicedesk.servicedesk-reports-plugin</Atlassian-Plugin-Key>
                        <Bundle-SymbolicName>com.atlassian.servicedesk.servicedesk-reports-plugin</Bundle-SymbolicName>
                        <Spring-Context>*</Spring-Context>
                        <Export-Package>
                            <!-- For tests -->
                            com.atlassian.servicedesk.plugins.reports.internal.visiblefortesting,
                            com.atlassian.servicedesk.plugins.reports.internal.visiblefortesting.response,

                            <!-- For plugin bundling -->
                            com.atlassian.servicedesk.plugins.reports.internal.obr.install
                        </Export-Package>
                        <Import-Package>
                            <!-- BND cannot find this runtime dependency of the Atlassian plugin system -->
                            !com.atlassian.refapp.api,
                            !com.query.spatial.*,
                            !com.vividsolutions.jts.io,
                            !net.sf.cglib.proxy,
                            !oracle.spatial.geometry,
                            !oracle.sql,
                            !org.geolatte.geom.*,
                            !org.jvnet.hudson.annotation_indexer,
                            !org.postgis,

                            !javax.portlet,

                            <!-- declare import for javax.annotation here so @PostConstruct can be used -->
                            javax.annotation,

                            <!--Then other mandatory imports -->
                            com.atlassian.servicedesk.internal.api.condition,
                            com.atlassian.plugin.web.baseconditions,

                            com.querydsl.*;version="${querydsl.version}",
                            com.mysema.commons.lang;version="${querydsl.version}",

                            <!-- if you declare a com.atlassian.plugin.osgi.external.SingleModuleDescriptorFactory, in your code at runtime the actual -->
                            <!-- package that will be called is com.atlassian.plugin.osgi.bridge.external.SingleModuleDescriptorFactory -->
                            <!-- JIRA 7 and platform 4 use Gemini while the old uses SpringDM -->

                            <!-- At build time the BND plugin will expand this * into the actual packages your code needs access to by analyzing -->
                            <!-- all of your code and it's dependencies through byte code scanning -->
                            *
                        </Import-Package>
                        <Atlassian-Scan-Folders>servicedesk,META-INF/plugin-descriptors</Atlassian-Scan-Folders>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
