<?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-connect-parent-pom</artifactId>
        <groupId>com.atlassian.servicedesk</groupId>
        <version>1000.469.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>servicedesk-connect-support-plugin</artifactId>
    <name>Service Desk Connect Support Plugin</name>
    <description>Provides Connect features specific to Service Desk (modules, conditions, context parameters, ...)</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-connect-extension-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-connect-host-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-connect-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-connect-modules</artifactId>
            <scope>provided</scope>
        </dependency>
        <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>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-bridge</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Need this for com.atlassian.json.schema.annotations -->
        <dependency>
            <groupId>io.atlassian.json-schemagen</groupId>
            <artifactId>json-schemagen-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bundles</groupId>
            <artifactId>json-schema-validator-atlassian-bundle</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</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>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </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.plugins</groupId>
            <artifactId>atlassian-connect-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <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>
                    <verbose>true</verbose>
                    <scannedDependencies>
                    </scannedDependencies>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.atlassian.servicedesk.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Atlassian-Plugin-Key>com.atlassian.servicedesk.connect-support-plugin</Atlassian-Plugin-Key>
                        <Bundle-SymbolicName>com.atlassian.servicedesk.connect-support-plugin</Bundle-SymbolicName>
                        <Spring-Context>*</Spring-Context>
                        <Import-Package>
                            !org.springframework.osgi.service.exporter.support,
                            !org.springframework.osgi.service.importer.support,
                            <!-- These are annotations we do _not_ need at runtime, they're only used to generate the json-schema files at build-time -->
                            !com.atlassian.json.schema.annotation,
                            *
                        </Import-Package>
                    </instructions>
                </configuration>
            </plugin>

            <!-- Generate json schema of our custom Connect module types -->
            <plugin>
                <groupId>io.atlassian.json-schemagen</groupId>
                <artifactId>json-schemagen-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>jsd-schema</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>generate-schema</goal>
                        </goals>
                        <configuration>
                            <generatorProvider>com.atlassian.plugin.connect.modules.schema.ConnectSchemaGeneratorProvider</generatorProvider>
                            <rootClassName>com.atlassian.servicedesk.connect.modules.JSDModuleList</rootClassName>
                            <rawOutput>${project.build.outputDirectory}/schema/jira-servicedesk-schema.json</rawOutput>
                            <prettyOutput>${project.build.outputDirectory}/schema/jira-servicedesk-schema-pretty.json</prettyOutput>
                            <enumCase>insensitive</enumCase>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
