<?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>1.1.24</version>
    </parent>

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

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

    <properties>
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
        <confluence.version.noisy-neighbour-works-with>7.15.0</confluence.version.noisy-neighbour-works-with>
    </properties>

    <dependencies>
        <!--   Project     -->
        <dependency>
            <groupId>com.atlassian.diagnostics</groupId>
            <artifactId>noisy-neighbour-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.diagnostics</groupId>
            <artifactId>noisy-neighbour-plugin</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <!--   Platform     -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webfragment-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!--    Platform (3rd party)    -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <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>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>amps-maven-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <products>
                        <product>
                            <id>confluence</id>
                            <version>${confluence.version.noisy-neighbour-works-with}</version>
                        </product>
                    </products>
                    <jvmDebugSuspend>true</jvmDebugSuspend>
                    <jvmArgs>-Xmx4g</jvmArgs>
                    <enableQuickReload>true</enableQuickReload>

                    <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>
                        </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>

                        <!-- Add package import here -->
                        <Import-Package>
                            com.atlassian.plugin.web,
                            com.atlassian.plugin.web.model,
                            com.atlassian.diagnostics.noisyneighbour.api,
                            <!-- import (alltheotherthings) -->
                            *;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>false</verbose>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
