<?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>
        <groupId>com.atlassian.jira.plugins</groupId>
        <artifactId>jira-software-monitor-parent-pom</artifactId>
        <version>8.8.0-m0004</version>
    </parent>

    <artifactId>jira-software-monitor-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>JIRA Software Monitor Plugin</name>

    <properties>
        <skipITs>true</skipITs>
        <od.testing.configuration>
            use-java,8
            use-maven,3
        </od.testing.configuration>
        <skipUTs>false</skipUTs>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.application</groupId>
            <artifactId>atlassian-application-host</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-runtime</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian</groupId>
            <artifactId>atlassian-test-categories</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>atlassian-jira-pageobjects</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-plugin</artifactId>
            <version>4.3.5</version>
            <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>
            </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>
                    <systemPropertyVariables>
                        <xvfb.enable>${xvfb.enable}</xvfb.enable>
                    </systemPropertyVariables>
                    <instructions>
                        <Atlassian-Plugin-Key>${project.groupId}.${project.artifactId}</Atlassian-Plugin-Key>
                        <Import-Package>
                            com.atlassian.analytics.api.annotations;resolution:="optional",
                            com.atlassian.application.api,
                            com.atlassian.application.host.plugin,
                            com.atlassian.event.api,
                            io.atlassian.fugue,
                            com.atlassian.jira.component,
                            com.atlassian.jira.event,
                            com.atlassian.jira.extension,
                            com.atlassian.plugin*,
                            com.atlassian.sal.api.lifecycle,
                            com.atlassian.scheduler*,
                            com.google.common*,
                            javax.annotation,
                            org.apache.commons*,
                            org.eclipse.gemini.blueprint.service.*;
                            org.joda*;
                            org.osgi.framework,
                            org.osgi.util.tracker,
                            org.slf4j*,
                            org.springframework.aop.support,
                            org.springframework.beans*,
                            org.springframework.context.annotation,
                            org.springframework.osgi.*;resolution:="optional",
                            org.springframework.stereotype,
                            org.springframework.util,
                            org.w3c.dom
                        </Import-Package>
                        <Export-Package>
                            com.atlassian.jira.plugins.software.monitor.lifecycle
                        </Export-Package>
                    </instructions>
                    <skipManifestValidation>true</skipManifestValidation>
                    <extractDependencies>false</extractDependencies>
                    <jvmArgs>-Xmx768m -XX:MaxPermSize=386m</jvmArgs>
                </configuration>
            </plugin>
            <!-- Build test JAR for AT/SLAT execution -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <forceCreation>true</forceCreation>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>ondemand-acceptance-tests</id>
            <properties>
                <skipITs>false</skipITs>
                <skipUTs>true</skipUTs>
            </properties>
        </profile>
        <profile>
            <!--Code coverage-->
            <id>jacoco</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!--Adding exclude not to run integration tests, as they require Jira running.-->
                            <!--For now we are using Jacoco profile only for UT coverage-->
                            <excludes>
                                <exclude>**/it/com/atlassian/**</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
