<?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">
    <parent>
        <artifactId>servicedesk-components</artifactId>
        <groupId>com.atlassian.servicedesk</groupId>
        <version>1000.229.0</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>servicedesk-knowledge-base-plugin</artifactId>

    <name>Service Desk Knowledge Base Plugin</name>
    <description>Plugin that provides Confluence knowledge base integration for Service Desk</description>
    <packaging>atlassian-plugin</packaging>

    <properties>
        <sonar.sources>${project.build.sourceDirectory},${sonar.javascript.sources.location}</sonar.sources>
    </properties>

    <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-internal-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- JIRA -->
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.event</groupId>
            <artifactId>atlassian-event</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.analytics</groupId>
            <artifactId>analytics-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Atlassian Pocketknife -->
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-step</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-api-commons</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>atlassian-pocketknife-api-commons-jira</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-rest</artifactId>
            <scope>compile</scope>
        </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>com.atlassian.sal</groupId>
            <artifactId>sal-api</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.applinks</groupId>
            <artifactId>applinks-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
        </dependency>

        <!--3rd party libs -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>jira-servicedesk-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webfragment-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>javax.mail-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</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>com.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>provided</scope>
        </dependency>

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

    <build>
        <resources>
            <!--
                We use gulp (via the mvn exec plugin) transform and copy frontend resources to the frontend-resources
                directory. So we need to let maven know where to find them so they still get bundled in the jar.
            -->
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <!--
                        These frontend resources are copied across to target/classes
                        See: gulpfile.js
                    -->
                    <exclude>**/*.js</exclude>
                    <exclude>**/*.less</exclude>
                    <exclude>**/*.css</exclude>
                    <exclude>**/*.soy</exclude>
                </excludes>
                <!-- tell maven to replace ${var} variables with their build time values -->
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <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>
                        <!-- None -->
                    </scannedDependencies>
                    <verbose>false</verbose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>
                    <compressResources>false</compressResources>
                    <closureJsCompiler>true</closureJsCompiler>
                    <enableFastdev>false</enableFastdev>
                    <enableDevToolbox>false</enableDevToolbox>
                    <systemPropertyVariables>
                        <plugin.resource.directories>${basedir}/target/classes</plugin.resource.directories>
                    </systemPropertyVariables>
                    <instructions>
                        <Atlassian-Plugin-Key>com.atlassian.servicedesk.servicedesk-knowledge-base-plugin</Atlassian-Plugin-Key>
                        <Bundle-SymbolicName>com.atlassian.servicedesk.servicedesk-knowledge-base-plugin</Bundle-SymbolicName>
                        <Spring-Context>*</Spring-Context>
                        <Export-Package>
                            com.atlassian.servicedesk.plugins.kb.internal.obr.install,
                            com.atlassian.servicedesk.plugins.kb.internal.api.*
                        </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,

                            <!--Then other mandatory imports -->
                            com.atlassian.webresource.api.prebake,

                            <!-- 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</Atlassian-Scan-Folders>
                    </instructions>
                    <extractDependencies>false</extractDependencies>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
