<?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">
    <parent>
        <artifactId>stash-plugins-parent</artifactId>
        <groupId>com.atlassian.stash</groupId>
        <version>2.7.2</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>stash-jira-integration</artifactId>

    <organization>
        <name>Atlassian</name>
        <url>http://www.atlassian.com/</url>
    </organization>

    <name>Atlassian Stash JIRA Integration Plugin</name>
    <description>This is the JIRA integration plugin for Atlassian Stash.</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-util</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-rest-common</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-test-util</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.integration.jira</groupId>
            <artifactId>jira-integration-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.integration.jira</groupId>
            <artifactId>jira-integration-plugin</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.markup</groupId>
            <artifactId>atlassian-markup-renderer-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.markup</groupId>
            <artifactId>atlassian-markup-renderer</artifactId>
            <scope>test</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-servlet</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.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.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</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>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-stash-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <products>
                        <product>
                            <id>stash</id>
                            <instanceId>stash</instanceId>
                            <version>${project.version}</version>
                            <dataVersion>${project.version}</dataVersion>
                        </product>
                    </products>
                </configuration>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>*.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>*.xml</exclude>
                </excludes>
            </resource>
        </resources>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <!-- Needed for wadl generation -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                            <excludePackageNames>com.atlassian.stash.integration.jira.idx:com.atlassian.stash.integration.jira.impl:com.atlassian.stash.integration.jira.rest:com.atlassian.stash.integration.jira.web</excludePackageNames>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>com.sun.jersey.contribs</groupId>
                        <artifactId>maven-wadl-plugin</artifactId>
                        <configuration>
                            <wadlFile>${project.build.directory}/stash-jira-integration-rest.wadl</wadlFile>
                            <packagesResourceConfig>
                                <param>com.atlassian.stash.integration.jira.rest</param>
                            </packagesResourceConfig>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>exec-xsltproc</id>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <executable>xsltproc</executable>
                                    <commandlineArgs>-o ${project.build.directory}/stash-jira-integration-rest.html ${project.basedir}/../${wadl-transform-xsl} ${project.build.directory}/stash-jira-integration-rest.wadl</commandlineArgs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
