<?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>6.2.5</version>
        <relativePath />
    </parent>
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>Atlassian Customer Agreement</name>
            <url>https://www.atlassian.com/customer-agreement/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <groupId>com.atlassian.buildeng</groupId>
    <artifactId>bamboo-plan-ownership</artifactId>
    <version>1.1.1</version>

    <organization>
        <name>Atlassian</name>
        <url>https://www.atlassian.com/</url>
    </organization>

    <name>bamboo-plan-ownership</name>
    <description>This is the com.atlassian.buildeng.bamboo-plan-ownership plugin for Atlassian Bamboo.</description>
    <packaging>atlassian-plugin</packaging>

    <properties>
        <bamboo.version>12.0.0-m014</bamboo.version>
        <bamboo.data.version>${bamboo.version}</bamboo.data.version>
        <amps.version>9.3.3</amps.version>
        <platform.version>8.0.0-m09</platform.version>
        <plugin.testrunner.version>4.0.0-jakarta-m001</plugin.testrunner.version>
        <atlassian.spring.scanner.version>6.0.0</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>
        <atlassian-browsers-auto.version>3.2.2</atlassian-browsers-auto.version>
        <xvfb.enable>true</xvfb.enable>
        <webdriver.browser>firefox</webdriver.browser>
        <failOnMilestoneOrReleaseCandidateDeps>false</failOnMilestoneOrReleaseCandidateDeps>
        <checkstyle.version>9.3</checkstyle.version>
        <palantirJavaFormat.version>2.35.0</palantirJavaFormat.version>
        <spotless.version>2.44.5</spotless.version>
        <buildengCheckstyle.version>1.2.3</buildengCheckstyle.version>

        <jdkLevel>21</jdkLevel>
        <maven.compiler.source>${jdkLevel}</maven.compiler.source>
        <maven.compiler.target>${jdkLevel}</maven.compiler.target>
    </properties>
    <scm>
        <connection>scm:git:https://bitbucket.org/atlassian/bamboo-plan-ownership-plugin.git</connection>
        <developerConnection>scm:git:ssh://git@bitbucket.org/atlassian/bamboo-plan-ownership-plugin.git</developerConnection>
        <url>https://bitbucket.org/atlassian/bamboo-plan-ownership-plugin</url>
        <tag>bamboo-plan-ownership-1.1.1</tag>
    </scm>
    <dependencies>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-web</artifactId>
            <version>${bamboo.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.ws.rs</groupId>
                    <artifactId>jsr311-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <scope>provided</scope>
        </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>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.wink</groupId>
                    <artifactId>wink-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.ws.rs</groupId>
                    <artifactId>jsr311-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.12.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.buildeng</groupId>
            <artifactId>bamboo-plan-ownership-specs</artifactId>
            <version>2.1.7</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>3.12.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-pageobjects</artifactId>
            <version>${bamboo.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.aui</groupId>
            <artifactId>aui-pageobjects</artifactId>
            <version>1.0.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bamboo</groupId>
            <artifactId>atlassian-bamboo-test-utils</artifactId>
            <version>${bamboo.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.browsers</groupId>
            <artifactId>atlassian-browsers-auto</artifactId>
            <version>${atlassian-browsers-auto.version}</version>
            <scope>test</scope>
        </dependency>


    </dependencies>
    <dependencyManagement>
        <dependencies>
            <!-- Platform dependencies -->
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-public-api</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-system-classpath</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-framework-bundles</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-bundled-plugins</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-test-resources</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>bamboo-maven-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <enableQuickReload>true</enableQuickReload>
                    <productVersion>${bamboo.version}</productVersion>
                    <productDataVersion>${bamboo.data.version}</productDataVersion>
                    <containerId>tomcat10x</containerId>
                    <!-- 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 to export here -->
                        <Export-Package>com.atlassian.buildeng.api,</Export-Package>
                        <!-- Add package import here -->
                        <Import-Package>
                            org.springframework.osgi.*;resolution:="optional",
                            org.eclipse.gemini.blueprint.*;resolution:="optional",
                            com.atlassian.sal.api.pluginsettings;
                            *;resolution:=optional
                        </Import-Package>
                        <!-- Ensure plugin is spring powered -->
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                    <pluginArtifacts>
                        <!--to make backdoor work -->
                        <pluginArtifact>
                            <groupId>com.atlassian.bamboo.plugins</groupId>
                            <artifactId>atlassian-bamboo-plugin-test-utils</artifactId>
                            <version>${bamboo.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                    <systemPropertyVariables>
                        <xvfb.enable>${xvfb.enable}</xvfb.enable>
                        <webdriver.browser>${webdriver.browser}</webdriver.browser>
                        <bamboo.websudo.disabled>true</bamboo.websudo.disabled>
                    </systemPropertyVariables>
                    <includedFeModuleManifests>
                        <includedFeModuleManifest>${project.basedir}/package.json</includedFeModuleManifest>
                        <includedFeModuleManifest>${project.basedir}/package-lock.json</includedFeModuleManifest>
                    </includedFeModuleManifests>
                    <feManifestAssociations>
                        <feManifestAssociation>
                            <packageName>@atlassian/dc.bamboo.plan-ownership-plugin</packageName>
                            <manuallyVerifiedEveryFileHasItsDependenciesDeclaredInTheManifest>
                                <outputDirectoryFiles>
                                    <file>js/bamboo-plan-ownership-min.js</file>
                                    <file>js/bamboo-plan-ownership-warning-min.js</file>
                                    <file>js/bamboo-plan-ownership-warning.js</file>
                                    <file>js/bamboo-plan-ownership.js</file>
                                </outputDirectoryFiles>
                            </manuallyVerifiedEveryFileHasItsDependenciesDeclaredInTheManifest>
                        </feManifestAssociation>
                    </feManifestAssociations>
                </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>
                    <includeExclude>-com.atlassian.buildeng.ownership.rest.*</includeExclude>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.3.1</version>
                <dependencies>
                    <dependency>
                        <groupId>com.atlassian.codestyle</groupId>
                        <artifactId>buildeng</artifactId>
                        <version>${buildengCheckstyle.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <configLocation>checkstyle-rules.xml</configLocation>
                    <inputEncoding>UTF-8</inputEncoding>
                    <outputEncoding>UTF-8</outputEncoding>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <failOnViolation>true</failOnViolation>
                    <violationSeverity>warning</violationSeverity>
                    <linkXRef>false</linkXRef>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless.version}</version>
                <configuration>
                    <java>
                        <palantirJavaFormat>
                            <!-- Optionally specify a version -->
                            <version>${palantirJavaFormat.version}</version>
                        </palantirJavaFormat>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>verify</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <!--
            profile to run integration tests locally on mac, see README for details.
            these 2 properties also require 'server' property to be entered from cmd line to work.
            -->
            <id>dev</id>
            <properties>
                <xvfb.enable>false</xvfb.enable>
                <webdriver.browser>firefox</webdriver.browser>
                <server>localhost</server>
            </properties>
        </profile>
    </profiles>
</project>
