<?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.bamboo</groupId>
        <artifactId>atlassian-bamboo-bundled-apps-parent</artifactId>
        <version>9.2.19</version>
    </parent>

    <groupId>com.atlassian.bamboo.plugins</groupId>
    <artifactId>bamboo-agent-notification-plugin</artifactId>

    <packaging>atlassian-plugin</packaging>
    <name>Bamboo Agent Notification plugin</name>
    <description>Send notifications on remote agent online/offline events</description>
    <url>https://marketplace.atlassian.com/plugins/com.atlassianlab.bamboo.plugins.bamboo-agent-notification-plugin</url>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-web</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Atlassian Spring scanner -->
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-runtime</artifactId>
            <scope>provided</scope>
        </dependency>
        <!--tests-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</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>pl.pragmatists</groupId>
            <artifactId>JUnitParams</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-test-utils</artifactId>
            <scope>test</scope>
        </dependency>
        <!--to run remote agent in separate process-->
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>bamboo-agent</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-pageobjects</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-pageobjects-elements</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>atlassian-spring-scanner</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
                <configuration>
                    <!-- Enable this to get build-time logging of annotations atlassian-spring-scanner-maven-plugin has noticed -->
                    <verbose>false</verbose>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>it/**</exclude>
                        <exclude>**/*$*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>bamboo-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>com.atlassianlab.bamboo.plugins.agentnotification.*</Export-Package>
                        <Spring-Context>*;timeout:=60</Spring-Context>
                        <Import-Package>
                            com.atlassian.sal.api.message;version="0.0.0",
                            *;resolution:=optional
                        </Import-Package>
                    </instructions>
                    <productVersion>${bamboo.version}</productVersion>
                    <productDataVersion>${bamboo.version}</productDataVersion>
                    <systemPropertyVariables>
                        <xvfb.enable>true</xvfb.enable>
                        <bamboo.agent.heartbeatInterval>4</bamboo.agent.heartbeatInterval>
                        <bamboo.agent.heartbeatTimeoutSeconds>15</bamboo.agent.heartbeatTimeoutSeconds>
                        <bamboo.agent.heartbeatCheckInterval>5</bamboo.agent.heartbeatCheckInterval>
                        <!--see com.atlassian.bamboo.testutils.agent.RemoteAgentInstallation.REMOTE_AGENT_LOGS_DIRECTORY-->
                        <remote.agent.logs.directory>${project.build.directory}/RemoteAgentLogs</remote.agent.logs.directory>
                        <!--required for local tests to setup mailserver by rest call-->
                        <atlassian.darkfeature.bamboo.experimental.rest.admin.enabled>true</atlassian.darkfeature.bamboo.experimental.rest.admin.enabled>
                        <!--required for RemoteAgentRule to use correct version of bamboo-agent.jar-->
                        <acceptance.test.version>${bamboo.version}</acceptance.test.version>
                    </systemPropertyVariables>
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.atlassian.bamboo.plugins</groupId>
                            <artifactId>atlassian-bamboo-plugin-test-utils</artifactId>
                        </pluginArtifact>
                    </pluginArtifacts>
                    <testGroups>
                        <testGroup>
                            <id>bamboo</id>
                            <instanceIds>
                                <instanceId>bamboo</instanceId>
                            </instanceIds>
                            <includes>
                                <include>it/**/*Test.java</include>
                            </includes>
                        </testGroup>
                    </testGroups>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
