<?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.diagnostics</groupId>
        <artifactId>noisy-neighbour</artifactId>
        <version>7.0.0</version>
    </parent>

    <artifactId>noisy-neighbour-refapp-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>Atlassian Diagnostics - Noisy Neighbour - Refapp Plugin</name>
    <description>Noisy Neighbour test plugin for Refapp to simulate performance issues like database pool exhaustion, slow queries,
        etc.
    </description>

    <properties>
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>refapp-api</artifactId>
            <version>${refapp.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>refapp-maven-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${refapp.version}</productVersion>
                    <enableQuickReload>true</enableQuickReload>
                    <log4jProperties>src/main/resources/log4j.properties</log4jProperties>
                    <systemPropertyVariables>
                        <refapp.profiling.enabled>true</refapp.profiling.enabled>
                    </systemPropertyVariables>

                    <pluginDependencies>
                        <pluginDependency>
                            <groupId>com.atlassian.diagnostics</groupId>
                            <artifactId>noisy-neighbour-plugin</artifactId>
                        </pluginDependency>
                    </pluginDependencies>
                    <bundledArtifacts>
                        <bundledArtifact>
                            <groupId>com.atlassian.diagnostics</groupId>
                            <artifactId>noisy-neighbour-plugin</artifactId>
                            <version>${project.version}</version>
                        </bundledArtifact>
                    </bundledArtifacts>

                    <!-- See here for an explanation of default instructions: -->
                    <!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>

                        <Export-Package>
                            com.atlassian.diagnostics.*,
                            com.atlassian.core.task.*
                        </Export-Package>
                        <Import-Package>
                            com.atlassian.analytics.api.annotations;resolution:="optional",
                            com.atlassian.plugin*;resolution:="optional",
                            com.atlassian.sal.api.*;resolution:="optional",
                            com.atlassian.scheduler;resolution:="optional",
                            com.atlassian.scheduler.caesium.spi;resolution:="optional",
                            com.atlassian.refapp.api;resolution:="optional",
                            com.atlassian.beehive.*;resolution:="optional",
                            io.atlassian.util.concurrent,
                            com.atlassian.activeobjects*,
                            org.springframework.cglib.core;resolution:="optional",
                            org.springframework.cglib.proxy;resolution:="optional",
                            org.springframework.beans;resolution:="optional",
                            org.springframework.beans.factory;resolution:="optional",
                            com.atlassian.diagnostics.internal.*;resolution:="optional",
                            org.eclipse.gemini.blueprint.service.importer.support,
                            org.osgi.framework,
                            org.slf4j,
                            *;resolution:="optional",
                        </Import-Package>

                        <!-- Ensure plugin is spring powered -->
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                </configuration>
            </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.plugin</groupId>
                            <artifactId>atlassian-spring-scanner-external-jar</artifactId>
                        </dependency>
                    </scannedDependencies>
                    <verbose>true</verbose>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
