<?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.pom</groupId>
        <artifactId>closedsource-pom</artifactId>
        <version>5.0.20</version>
        <relativePath />
    </parent>
    <groupId>com.atlassian.buildeng</groupId>
    <artifactId>bamboo-build-cost</artifactId>
    <version>1.0.0</version>

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

    <name>bamboo-build-cost</name>
    <description>This is the com.atlassian.buildeng:bamboo-build-cost plugin for Atlassian Bamboo.</description>
    <packaging>atlassian-plugin</packaging>

    <properties>
        <bamboo.version>6.5.1</bamboo.version>
        <bamboo.data.version>6.3.2</bamboo.data.version>
        <amps.version>6.3.15</amps.version>
        <plugin.testrunner.version>1.2.3</plugin.testrunner.version>
        <atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
        <!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <checkstyle.version>8.0</checkstyle.version>
        <atlassian.codestyle>buildeng:1.0.5</atlassian.codestyle>
    </properties>

    <scm>
        <connection>scm:git:ssh://git@stash.atlassian.com:7997/buildeng/bamboo-build-cost.git</connection>
        <developerConnection>scm:git:ssh://git@stash.atlassian.com:7997/buildeng/bamboo-build-cost.git</developerConnection>
        <url>https://stash.atlassian.com/buildeng/bamboo-build-cost</url>
        <tag>bamboo-build-cost-1.0.0</tag>
    </scm>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-web</artifactId>
            <version>${bamboo.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-runtime</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jdbc</artifactId>
            <version>9.0.10</version>
        </dependency>
        <!-- No idea who uploaded this to Maven Central but it is NOT the same as the official Amazon JDBC driver.
        It wraps AthenaDriver and does some Atlassian specific magic to prevent having to set the S3 bucket to write to.
        We have to exclude some dependencies that are also included by atlassian-bamboo-web artifact and cause problems
        when they are loaded together.
        -->
        <dependency>
            <groupId>com.amazonaws.athena.jdbc</groupId>
            <artifactId>atl-athena-jdbc-driver</artifactId>
            <version>1.0.2-atlassian-1</version>
            <exclusions>
                <exclusion>
                    <groupId>com.amazonaws.athena.jdbc</groupId>
                    <artifactId>AthenaJDBC41</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-1.2-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- WIRED TEST RUNNER DEPENDENCIES -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
            <version>${plugin.testrunner.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2-atlassian-1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-bamboo-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${bamboo.version}</productVersion>
                    <productDataVersion>${bamboo.data.version}</productDataVersion>
                    <enableQuickReload>true</enableQuickReload>
                    <enableFastdev>false</enableFastdev>

                    <!-- See here for an explanation of default instructions: -->
                    <!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
                    <!--<instructions>-->
                        <!--&lt;!&ndash; Add package to export here &ndash;&gt;-->
                        <!--<Export-Package>-->
                            <!--com.atlassian.buildeng.api,-->
                        <!--</Export-Package>-->

                        <!--&lt;!&ndash; Add package import here &ndash;&gt;-->
                        <!--<Import-Package>-->
                            <!--org.springframework.osgi.*;resolution:="optional",-->
                            <!--org.eclipse.gemini.blueprint.*;resolution:="optional",-->
                            <!--*-->
                        <!--</Import-Package>-->

                        <!--&lt;!&ndash; Ensure plugin is spring powered &ndash;&gt;-->
                        <!--<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>
