<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.pom</groupId>
        <artifactId>closedsource-private-pom</artifactId>
        <version>8.0.29</version>
    </parent>

    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>confluence-jira-integration-plugins</artifactId>
    <version>20.2.3</version>
    <packaging>pom</packaging>

    <name>confluence-jira-integration-plugins</name>
    <description>confluence-jira-integration-plugins</description>
    <organization>
        <name>Atlassian</name>
        <url>https://www.atlassian.com/</url>
    </organization>

    <licenses>
        <license>
            <name>Atlassian 3.0 End User License Agreement</name>
            <url>https://www.atlassian.com/end-user-agreement/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <modules>
        <module>confluence-jira-content</module>
        <module>confluence-jira-metadata</module>
        <module>confluence-jira-plugin</module>
        <module>confluence-software-blueprints</module>
        <module>confluence-software-project</module>
        <module>myworkday</module>
        <module>teamcal</module>
    </modules>

    <scm>
        <connection>scm:git:ssh://git@stash.atlassian.com:7997/confserver/confluence-jira-integration-plugins.git</connection>
        <developerConnection>scm:git:ssh://git@stash.atlassian.com:7997/confserver/confluence-jira-integration-plugins.git</developerConnection>
        <tag>confluence-jira-integration-plugins-20.2.3</tag>
        <url>https://stash.atlassian.com/projects/CONFSERVER/repos/confluence-jira-integration-plugins/browse</url>
    </scm>

    <issueManagement>
        <system>Jira</system>
        <url>https://jira.atlassian.com/projects/CONFSRVDEV/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Bamboo</system>
        <url>https://server-syd-bamboo.internal.atlassian.com/browse/CBP-JIRAINTEGRATIONPLUGINS</url>
    </ciManagement>

    <properties>

        <ajp.confluence.port>8009</ajp.confluence.port>

        <ajp.jira.port>8019</ajp.jira.port>
        <amps8.version>9.10.2</amps8.version>

        <atlassian-antisamy-support.version>1.0.3</atlassian-antisamy-support.version>

        <atlassian-spring-scanner.version>6.0.0</atlassian-spring-scanner.version>

        <atlassian-whitelist.version>6.1.5</atlassian-whitelist.version>
        <aui-pageobjects.version>1.2.0</aui-pageobjects.version>
        <baseurl.confluence>${http.confluence.protocol}://${server}:${http.confluence.port}/${context.confluence.path}</baseurl.confluence>
        <baseurl.jira>${http.jira.protocol}://${server}:${http.jira.port}/${context.jira.path}</baseurl.jira>
        <confluence.data.version>${confluence.version}</confluence.data.version>
        <confluence.java.home>${java.home}</confluence.java.home>
        <confluence.maven-enforcer-rules.version>1.0.5</confluence.maven-enforcer-rules.version>
        <!-- renovate: depName=com.atlassian.confluence:confluence-plugins-platform-pom -->
        <confluence.version>10.2.1</confluence.version>
        <containerId>tomcat10x</containerId>
        <context.confluence.path>confluence</context.confluence.path>
        <context.jira.path>jira</context.jira.path>

        <dependency-report-maven-plugin.version>2.0.12</dependency-report-maven-plugin.version>
        <download.maven.plugin.version>1.13.0</download.maven.plugin.version>
        <exec-maven-plugin.version>3.6.2</exec-maven-plugin.version>
        <failOnMilestoneOrReleaseCandidateDeps>false</failOnMilestoneOrReleaseCandidateDeps>
        <flaky-test-reporter.version>5.2.0</flaky-test-reporter.version>
        <functest.plugin.version>4.0.1</functest.plugin.version>

        <gson.version>2.13.2</gson.version>
        <http.confluence.port>1990</http.confluence.port>
        <http.confluence.protocol>http</http.confluence.protocol>
        <http.jira.port>2990</http.jira.port>
        <http.jira.protocol>http</http.jira.protocol>

        <incremental-build-plugin.version>0.398</incremental-build-plugin.version>
        <incrementalbuild.enabled>true</incrementalbuild.enabled>
        <jacoco.agent.argLine />
        <!-- Overridden by -Ptest-coverage -->
        <jacoco.it.argLine />
        <jacoco.report.name>jacoco.xml</jacoco.report.name>
        <jacocoItDestinationFile>${project.build.directory}/jacoco-it.exec</jacocoItDestinationFile>

        <jira.containerId>tomcat10x</jira.containerId>
        <jira.data.version>${jira.version}</jira.data.version>
        <jira.integration.plugin.version>11.0.5</jira.integration.plugin.version>
        <jira.java.home>${java.home}</jira.java.home>
        <jira.jvm.args>-Xmx${jira.jvm.args.xmx} ${jira.jvm.args.custom} ${jira.jvm.args.extra}</jira.jvm.args>

        <!-- Jira run configuration -->
        <jira.jvm.args.custom />
        <jira.jvm.args.extra />
        <jira.jvm.args.xmx>1024m</jira.jvm.args.xmx>
        <jira.software.version>11.1.2-int-0148</jira.software.version>

        <jira.version>11.0.0-QR-20250714195240</jira.version>

        <!--suppress UnresolvedMavenProperty -->
        <jvm.args>-Xmx${jvm.args.xmx} ${jvm.args.custom} ${jvm.args.extra} ${jacoco.it.argLine}</jvm.args>

        <!-- Confluence run configuration -->
        <jvm.args.custom />
        <jvm.args.extra />
        <jvm.args.xmx>2g</jvm.args.xmx>
        <maven-resources-plugin.version>3.4.0</maven-resources-plugin.version>
        <maven.profiling.product>CONFLUENCE_JIRA_INTEGRATION_PLUGINS</maven.profiling.product>
        <node.install.skip>false</node.install.skip>
        <npm.build.script>build</npm.build.script>
        <npm.build.skip>true</npm.build.skip>
        <npm.cmd>${scriptsdir}/npm.sh</npm.cmd>
        <npm.install.skip>true</npm.install.skip>
        <npm.test.skip>true</npm.test.skip>
        <npm.workingDirectory>${project.basedir}</npm.workingDirectory>

        <platform.version>8.0.0-m17</platform.version>

        <plexus-utils.version>4.0.2</plexus-utils.version>

        <rest.doc.generation.skip>true</rest.doc.generation.skip>
        <rest.java.client.version>7.0.1</rest.java.client.version>
        <restrict-imports-enforcer-rule.version>2.6.1</restrict-imports-enforcer-rule.version>

        <!-- sbom properties -->
        <scriptsdir>${maven.multiModuleProjectDirectory}/scripts</scriptsdir>

        <server>localhost</server>
        <skip.formatting.check>true</skip.formatting.check>
        <skip.js.enforcement>true</skip.js.enforcement>
        <skipCopyCodeStyle>true</skipCopyCodeStyle>
        <skipCopyLicense>false</skipCopyLicense>

        <!-- JACOCO Changes -->
        <skipJacocoReport>true</skipJacocoReport>
        <sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
        <sonar.exclusions>**/META-INF/**,
            **/*.test.*,
            **/__tests__/**,
            **/*.stories.*,
            **/__stories__/**,
            **/*.spec.*,
            **/mocks/**,
            **/__mocks__/**,
            **/*-tests.js*,
            **/shim/**,
            **/*.css</sonar.exclusions>
        <sonar.links.ci>${project.ciManagement.url}</sonar.links.ci>
        <sonar.links.issue>${project.issueManagement.url}</sonar.links.issue>
        <!-- For multiple modules -->
        <sonar.moduleKey>${project.artifactId}</sonar.moduleKey>

        <!-- SonarQube properties (these are inherited for each module) -->
        <sonar.projectName>Confluence DC ${project.artifactId}</sonar.projectName>
        <sonarITReportPath>${project.build.directory}/site/jacoco-integration/${jacoco.report.name}</sonarITReportPath>
        <sonarUTReportPath>${project.build.directory}/site/jacoco-unit/${jacoco.report.name}</sonarUTReportPath>

        <!-- for Karma profile -->
        <spotless-maven-plugin.version>2.46.1</spotless-maven-plugin.version>
        <!-- failsafe 2.20.1 or newer required for rerun support. Double check the version from the parent-pom -->
        <surefire.version>3.5.4</surefire.version>
        <test-coverage.check-integration-test-coverage-timeout>300</test-coverage.check-integration-test-coverage-timeout>
        <test-coverage.integration-test-directory>${project.basedir}</test-coverage.integration-test-directory>
        <test-coverage.skip-copy-integration-test-report>true</test-coverage.skip-copy-integration-test-report>
        <testkit.version>11.0.4</testkit.version>

        <!-- override the versions of the listed plugins in amps -->
        <version.override.set>maven-surefire-plugin,maven-failsafe-plugin</version.override.set>
        <yuicompressor-maven-plugin.version>0.7.1</yuicompressor-maven-plugin.version>
    </properties>

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

            <dependency>
                <groupId>com.atlassian.functest</groupId>
                <artifactId>functest-plugin</artifactId>
                <version>${functest.plugin.version}</version>
            </dependency>

            <dependency>
                <groupId>com.atlassian.integration.jira</groupId>
                <artifactId>jira-integration-plugin</artifactId>
                <version>${jira.integration.plugin.version}</version>
            </dependency>

            <!-- maven dependency -->
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-utils</artifactId>
                <version>${plexus-utils.version}</version>
            </dependency>

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

            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-functestrpc-plugin</artifactId>
                <version>${confluence.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-scriptsfinished-plugin</artifactId>
                <version>${confluence.version}</version>
            </dependency>

            <dependency>
                <groupId>com.atlassian.jira</groupId>
                <artifactId>jira-api</artifactId>
                <version>${jira.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.atlassian.cache</groupId>
                        <artifactId>atlassian-cache-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.atlassian.cache</groupId>
                        <artifactId>atlassian-cache-memory</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.atlassian.sal</groupId>
                        <artifactId>sal-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>commons-httpclient</groupId>
                        <artifactId>commons-httpclient</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.inject</groupId>
                        <artifactId>javax.inject</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.codehaus.jackson</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.atlassian.jira.tests</groupId>
                <artifactId>jira-testkit-client</artifactId>
                <version>${testkit.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.sun.jersey</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.sun.jersey.contribs</groupId>
                        <artifactId>jersey-apache-client</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.sun.jersey.contribs</groupId>
                        <artifactId>jersey-multipart</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>commons-httpclient</groupId>
                        <artifactId>commons-httpclient</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit-dep</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.codehaus.jackson</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <!-- This conflicts with jersey-media-json-jackson as required by Confluence -->
                    <exclusion>
                        <groupId>org.glassfish.jersey.media</groupId>
                        <artifactId>jersey-media-json-binding</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-library</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.json</groupId>
                        <artifactId>org.json</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-simple</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.atlassian.jira</groupId>
                <artifactId>atlassian-jira-pageobjects</artifactId>
                <version>${jira.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.atlassian.jira</groupId>
                        <artifactId>jira-func-tests</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.atlassian.selenium</groupId>
                        <artifactId>atlassian-pageobjects-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.inject</groupId>
                        <artifactId>javax.inject</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.codehaus.jackson</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-all</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
            </dependency>

            <dependency>
                <groupId>com.atlassian</groupId>
                <artifactId>flaky-test-reporter</artifactId>
                <version>${flaky-test-reporter.version}</version>
            </dependency>

            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-osgi-testrunner-bundle</artifactId>
                <version>2.0.16</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.ws.rs</groupId>
                        <artifactId>jsr311-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.wink</groupId>
                        <artifactId>wink-client</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.codehaus.jackson</groupId>
                        <artifactId>jackson-core-asl</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.codehaus.jackson</groupId>
                        <artifactId>jackson-mapper-asl</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>atlassian-antisamy-support</artifactId>
                <version>${atlassian-antisamy-support.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-functest-rest-plugin</artifactId>
                <version>${confluence.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
                <version>4.0.0-jakarta-m001</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.extensions</groupId>
                    <artifactId>incremental-build-plugin</artifactId>
                    <version>${incremental-build-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>com.atlassian.confluence.maven-enforcer-rules</groupId>
                            <artifactId>confluence-maven-enforcer-rules</artifactId>
                            <version>${confluence.maven-enforcer-rules.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>de.skuzzle.enforcer</groupId>
                            <artifactId>restrict-imports-enforcer-rule</artifactId>
                            <version>${restrict-imports-enforcer-rule.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>check-banned-import-class</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <phase>process-sources</phase>
                            <configuration>
                                <rules>
                                    <RestrictImports>
                                        <!-- Define an explanatory reason why these imports are prohibited -->
                                        <reason>Use org.assertj.core.api.Assertions#assertThat from assertj instead</reason>
                                        <!-- Specify a single pattern to be banned -->
                                        <bannedImports>
                                            <bannedImport>junit.framework.Assert.**</bannedImport>
                                            <bannedImport>junit.framework.Assert</bannedImport>
                                            <bannedImport>org.hamcrest.MatcherAssert.**</bannedImport>
                                            <bannedImport>org.hamcrest.MatcherAssert</bannedImport>
                                            <bannedImport>org.junit.Assert.**</bannedImport>
                                            <bannedImport>org.junit.Assert</bannedImport>
                                            <bannedImport>org.mockito.hamcrest.MockitoHamcrest.**</bannedImport>
                                            <bannedImport>org.mockito.hamcrest.MockitoHamcrest</bannedImport>
                                            <bannedImport>org.hamcrest.Matcher</bannedImport>
                                            <bannedImport>org.junit.jupiter.api.Assertions.**</bannedImport>
                                            <bannedImport>org.junit.jupiter.api.Assertions</bannedImport>
                                        </bannedImports>
                                    </RestrictImports>
                                    <RestrictImports>
                                        <!-- Define an explanatory reason why these imports are prohibited -->
                                        <reason>Use org.assertj.core.api.Assertions#assertThat from assertj instead</reason>
                                        <!-- Specify a single pattern to be banned -->
                                        <bannedImports>
                                            <bannedImport>org.assertj.core.api.AssertionsForClassTypes.assertThat</bannedImport>
                                        </bannedImports>
                                    </RestrictImports>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>confluence-maven-plugin</artifactId>
                    <version>${amps8.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <containerId>${containerId}</containerId>
                        <productVersion>${confluence.version}</productVersion>
                        <productDataVersion>${confluence.data.version}</productDataVersion>

                        <!-- Disable the various bits of dev junk that AMPS activates by default -->
                        <enableAchoo>false</enableAchoo>
                        <enableDevToolbox>false</enableDevToolbox>
                        <enablePde>false</enablePde>
                        <enableQuickReload>false</enableQuickReload>
                        <enablePluginViewer>false</enablePluginViewer>
                        <enableWebConsole>false</enableWebConsole>
                        <platformVersion>${platform.version}</platformVersion>
                        <output>${project.build.directory}/confluence.log</output>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>amps-maven-plugin</artifactId>
                    <version>${amps8.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <containerId>${containerId}</containerId>
                        <productVersion>${confluence.version}</productVersion>
                        <productDataVersion>${confluence.data.version}</productDataVersion>

                        <!-- Start conf+jira in parallel to save time -->
                        <parallel>true</parallel>

                        <!-- Disable the various bits of dev junk that AMPS activates by default -->
                        <enableAchoo>false</enableAchoo>
                        <enableDevToolbox>false</enableDevToolbox>
                        <enablePde>false</enablePde>
                        <enableQuickReload>false</enableQuickReload>
                        <enablePluginViewer>false</enablePluginViewer>
                        <enableWebConsole>false</enableWebConsole>
                        <platformVersion>${platform.version}</platformVersion>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>jira-maven-plugin</artifactId>
                    <version>${amps8.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.plugin</groupId>
                    <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                    <version>${atlassian-spring-scanner.version}</version>
                    <configuration>
                        <verbose>false</verbose>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>atlassian-spring-scanner</goal>
                            </goals>
                            <phase>process-classes</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.drs</groupId>
                    <artifactId>dependency-report-maven-plugin</artifactId>
                    <version>${dependency-report-maven-plugin.version}</version>
                    <configuration>
                        <gracefulFailure>true</gracefulFailure>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>upload</goal>
                            </goals>
                            <phase>post-integration-test</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <doclint>none</doclint>
                        <failOnError>false</failOnError>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.version}</version>
                    <configuration>
                        <excludes>
                            <exclude>it/**</exclude>
                        </excludes>
                        <trimStackTrace>false</trimStackTrace>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${surefire.version}</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                    </configuration>
                </plugin>
                <plugin>
                    <!-- Compress JS/CSS -->
                    <groupId>net.sf.alchim</groupId>
                    <artifactId>yuicompressor-maven-plugin</artifactId>
                    <version>${yuicompressor-maven-plugin.version}</version>
                    <configuration>
                        <jswarn>false</jswarn>
                        <excludes>
                            <exclude>**/*-min*</exclude>
                            <exclude>**/*.min*</exclude>
                        </excludes>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-utils</artifactId>
                            <version>${plexus-utils.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compress</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.googlecode.maven-download-plugin</groupId>
                    <artifactId>download-maven-plugin</artifactId>
                    <version>${download.maven.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>download-flaky-configuration</id>
                            <goals>
                                <goal>wget</goal>
                            </goals>
                            <phase>process-test-resources</phase>
                            <configuration>
                                <url>https://s3-ap-southeast-2.amazonaws.com/confluence-server/bamboo/issuecreator_plugins_config.json</url>
                                <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
                                <overwrite>true</overwrite>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>copy-license</id>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <phase>process-sources</phase>
                            <configuration>
                                <skip>${skipCopyLicense}</skip>
                                <outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory>
                            </configuration>
                        </execution>
                        <execution>
                            <id>copy-checkstyle-suppressions</id>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <phase>process-resources</phase>
                            <configuration>
                                <skip>${skipCopyCodeStyle}</skip>
                                <outputDirectory>${project.basedir}/target/codestyle</outputDirectory>
                                <overwrite>true</overwrite>
                                <resources>
                                    <resource>
                                        <directory>src/codestyle</directory>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <configuration>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.atlassian.codestyle</groupId>
                            <artifactId>confluence-codestyle</artifactId>
                            <version>${atlassian.codestyle.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <!-- Spotless Plugin with integrated SortPom -->
                <plugin>
                    <groupId>com.diffplug.spotless</groupId>
                    <artifactId>spotless-maven-plugin</artifactId>
                    <version>${spotless-maven-plugin.version}</version>
                    <configuration>
                        <pom>
                            <sortPom>
                                <nrOfIndentSpace>4</nrOfIndentSpace>
                                <sortModules>true</sortModules>
                                <expandEmptyElements>false</expandEmptyElements>
                                <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
                                <sortDependencies>scope</sortDependencies>
                                <sortDependencyManagement>scope</sortDependencyManagement>
                                <sortDependencyExclusions>groupId,artifactId</sortDependencyExclusions>
                                <sortProperties>true</sortProperties>
                            </sortPom>
                        </pom>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <!-- pre-install the required versions of node and npm, before any child modules need it -->
                    <!-- avoids partial installs being used and breaking multi-threaded builds -->
                    <execution>
                        <id>node-install</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <skip>${node.install.skip}</skip>
                            <executable>${npm.cmd}</executable>
                            <arguments>
                                <!-- just a dummy command to ensure npm is installed -->
                                <argument>--version</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>frontend-install</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <skip>${npm.install.skip}</skip>
                            <executable>${npm.cmd}</executable>
                            <arguments>
                                <argument>install</argument>
                                <argument>--no-save</argument>
                                <argument>--no-audit</argument>
                                <argument>--prefer-offline</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>frontend-build</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <skip>${npm.build.skip}</skip>
                            <executable>${npm.cmd}</executable>
                            <arguments>
                                <argument>run</argument>
                                <argument>${npm.build.script}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>frontend-checks</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                            <skip>${npm.test.skip}</skip>
                            <workingDirectory>${project.basedir}</workingDirectory>
                            <executable>${npm.cmd}</executable>
                            <arguments>
                                <argument>run</argument>
                                <argument>checks</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>amps-maven-plugin</artifactId>
                <extensions>false</extensions>
                <executions>
                    <execution>
                        <id>js-enforcement</id>
                        <goals>
                            <goal>verify-fe-manifest-associations</goal>
                        </goals>
                        <phase>verify</phase>
                        <configuration>
                            <skipVerifyFeManifestAssociations>${skip.js.enforcement}</skipVerifyFeManifestAssociations>
                            <verifyFeManifestAssociationsInputEntrypoint>${project.build.directory}/${project.build.finalName}.jar</verifyFeManifestAssociationsInputEntrypoint>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <!--
                        Forces the evaluation of testBatchRunner parameters, so they are visible to Maven build cache extension.
                        This prevents different test batches from overwriting other batches in the cache.
                        -->
                        <id>evaluate-test-batch-runner-parameters</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>pre-integration-test</phase>
                        <configuration>
                            <target>
                                <echo message="Test batch runner batch ${testBatchRunner.currentBatchNumber} of ${testBatchRunner.numberOfBatches}" />
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <configuration>
                    <skip>${skip.formatting.check}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>spotless-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>ban_platform_dependencies_version_override</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>ban_platform_dependencies_version_override</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <rules>
                                        <myCustomRule implementation="com.atlassian.confluence.maven.enforcer.rules.PlatformDependencyVersionEnforcerRule">
                                            <platformGroupId>com.atlassian.platform</platformGroupId>
                                            <platformArtifactId>dc-platform</platformArtifactId>
                                            <version>${platform.version}</version>
                                            <modules>
                                                <module>platform-system-classpath</module>
                                                <module>platform-framework-bundles</module>
                                                <module>platform-bundled-plugins</module>
                                                <module>platform-internal-api</module>
                                                <module>platform-deprecated-public-api</module>
                                                <module>platform-public-api</module>
                                                <module>platform-test-resources</module>
                                                <module>platform-spring-bundle</module>
                                            </modules>
                                            <excludes>
                                                <exclude>opensymphony:propertyset</exclude>
                                            </excludes>
                                        </myCustomRule>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>test-coverage</id>
            <properties>
                <jacoco.it.argLine>-javaagent:${project.build.directory}/jacoco.agent-runtime.jar=includes=com/atlassian/**/*,output=tcpserver</jacoco.it.argLine>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>jacoco</id>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jacoco</groupId>
                                            <artifactId>org.jacoco.agent</artifactId>
                                            <classifier>runtime</classifier>
                                            <version>${jacoco.version}</version>
                                            <destFileName>jacoco.agent-runtime.jar</destFileName>
                                            <outputDirectory>${project.build.directory}</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <exclude>**/META-INF/**</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <id>parse-jacoco-it-report</id>
                                <goals>
                                    <goal>report-integration</goal>
                                </goals>
                                <phase>none</phase>
                                <configuration>
                                    <skip>${skipJacocoReport}</skip>
                                    <includes>
                                        <include>com/atlassian/**</include>
                                    </includes>
                                    <outputDirectory>${project.reporting.outputDirectory}/jacoco-integration</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>parse-jacoco-aggregated-report</id>
                                <goals>
                                    <goal>report-aggregate</goal>
                                </goals>
                                <phase>none</phase>
                                <configuration>
                                    <skip>${skipJacocoReport}</skip>
                                    <!-- as we are going to run in only for the plugin, then we have to include the current project -->
                                    <includeCurrentProject>true</includeCurrentProject>
                                    <includes>
                                        <include>com/atlassian/**</include>
                                    </includes>
                                </configuration>
                            </execution>
                            <execution>
                                <id>agent-for-ut</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <propertyName>jacoco.agent.argLine</propertyName>
                                    <includes>
                                        <include>com/atlassian/**</include>
                                    </includes>
                                </configuration>
                            </execution>
                            <execution>
                                <id>parse-jacoco-ut-report</id>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.reporting.outputDirectory}/jacoco-unit</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.atlassian.drs</groupId>
                        <artifactId>dependency-report-maven-plugin</artifactId>
                        <configuration>
                            <projectId>d74f4cde-5873-49f5-9c66-0b3292f81956</projectId>
                            <unitTestCodeCoveragePaths>${project.build.directory}/jacoco.exec</unitTestCodeCoveragePaths>
                            <integrationTestCodeCoveragePaths>${jacocoItDestinationFile}</integrationTestCodeCoveragePaths>
                            <gracefulFailure>true</gracefulFailure>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <!-- Copy an integration test code coverage report from integration test module to current module -->
                                <id>copy-jacoco-it-report</id>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <phase>none</phase>
                                <configuration>
                                    <skip>${test-coverage.skip-copy-integration-test-report}</skip>
                                    <outputDirectory>${project.basedir}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${test-coverage.integration-test-directory}</directory>
                                            <includes>
                                                <include>target/jacoco-it.exec</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>@{jacoco.agent.argLine}</argLine>
                            <!-- Ignoring integration tests on test phase so they just run in integration-test phase.-->
                            <!-- This configuration is necessary when using AMPS together with a parent POM.-->
                            <excludes>
                                <exclude>it/**</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>confluence-maven-plugin</artifactId>
                        <configuration>
                            <testCoverage>
                                <enabled>true</enabled>
                                <destFile>${jacocoItDestinationFile}</destFile>
                            </testCoverage>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>amps-maven-plugin</artifactId>
                        <configuration>
                            <testCoverage>
                                <enabled>true</enabled>
                                <destFile>${jacocoItDestinationFile}</destFile>
                            </testCoverage>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>windows</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <npm.cmd>${scriptsdir}/npm.cmd</npm.cmd>
            </properties>
        </profile>
        <profile>
            <id>npm-test-skip-with-maven-test-skip</id>
            <activation>
                <property>
                    <name>maven.test.skip</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <npm.test.skip>true</npm.test.skip>
            </properties>
        </profile>
        <profile>
            <id>npm-test-skip-with-skipTests</id>
            <activation>
                <property>
                    <name>skipTests</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <npm.test.skip>true</npm.test.skip>
            </properties>
        </profile>
        <profile>
            <id>flaky</id>
            <properties>
                <ci.tests.rerunFailingTestsCount>0</ci.tests.rerunFailingTestsCount>
                <ci.tests.skipAfterFailureCount>10</ci.tests.skipAfterFailureCount>
                <junitflakylistener.branchName>${env.bamboo_planRepository_1_branchName}</junitflakylistener.branchName>
                <junitflakylistener.failAnyBranchOnAnyFlake>false</junitflakylistener.failAnyBranchOnAnyFlake>
                <junitflakylistener.failBranchWithNewFlakes>false</junitflakylistener.failBranchWithNewFlakes>
                <junitflakylistener.flakyTestFilePath>target/failsafe-reports/flakey-tests.txt</junitflakylistener.flakyTestFilePath>
                <junitflakylistener.jiraPassword>${env.bamboo_confsrv_flakytst_bot_token}</junitflakylistener.jiraPassword>
                <junitflakylistener.jiraProjectConfigPath>issuecreator_plugins_config.json</junitflakylistener.jiraProjectConfigPath>
                <junitflakylistener.jiraUserName>${env.bamboo_confsrv_flakytst_bot_username}</junitflakylistener.jiraUserName>
                <junitflakylistener.jiraUsesTokenAuth>true</junitflakylistener.jiraUsesTokenAuth>
                <junitflakylistener.reportAllFailures>true</junitflakylistener.reportAllFailures>
                <junitflakylistener.runnerId>${env.bamboo_buildResultKey}</junitflakylistener.runnerId>
                <junitflakylistener.trackFlakyTest>true</junitflakylistener.trackFlakyTest>
                <junitflakylistener.trackFlakyTestOnBranchesRegExp>master|release/.*</junitflakylistener.trackFlakyTestOnBranchesRegExp>
                <junitflakylistener.updateIssueOnBranches>false</junitflakylistener.updateIssueOnBranches>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>com.atlassian</groupId>
                    <artifactId>flaky-test-reporter</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.jira</groupId>
                    <artifactId>jira-rest-java-client-api</artifactId>
                    <version>${rest.java.client.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.jira</groupId>
                    <artifactId>jira-rest-java-client-core</artifactId>
                    <version>${rest.java.client.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-engine</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.googlecode.maven-download-plugin</groupId>
                        <artifactId>download-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <!--suppress MavenModelInspection -->
                            <skipAfterFailureCount>${ci.tests.skipAfterFailureCount}</skipAfterFailureCount>
                            <!--suppress MavenModelInspection -->
                            <rerunFailingTestsCount>${ci.tests.rerunFailingTestsCount}</rerunFailingTestsCount>
                            <properties>
                                <property>
                                    <name>listener</name>
                                    <value>com.atlassian.test.reporting.JUnitFlakyTestListener</value>
                                </property>
                            </properties>
                            <systemPropertyVariables>
                                <junitflakylistener.branchName>${junitflakylistener.branchName}</junitflakylistener.branchName>
                                <!-- Fail the build when we see a flake for any branches (a failure followed by a successful re-run) -->
                                <junitflakylistener.failAnyBranchOnAnyFlake>${junitflakylistener.failAnyBranchOnAnyFlake}</junitflakylistener.failAnyBranchOnAnyFlake>
                                <!--
                                This property is much older than failAnyBranchOnAnyFlake, but it only applies to branches
                                not matching the regex in trackFlakyTestOnBranchesRegExp, so we use failAnyBranchOnAnyFlake instead.
                                -->
                                <junitflakylistener.failBranchWithNewFlakes>${junitflakylistener.failBranchWithNewFlakes}</junitflakylistener.failBranchWithNewFlakes>
                                <junitflakylistener.flakyTestFilePath>${junitflakylistener.flakyTestFilePath}</junitflakylistener.flakyTestFilePath>
                                <junitflakylistener.jiraPassword>${junitflakylistener.jiraPassword}</junitflakylistener.jiraPassword>
                                <junitflakylistener.jiraProjectConfigPath>${junitflakylistener.jiraProjectConfigPath}</junitflakylistener.jiraProjectConfigPath>
                                <junitflakylistener.jiraUsesTokenAuth>${junitflakylistener.jiraUsesTokenAuth}</junitflakylistener.jiraUsesTokenAuth>
                                <junitflakylistener.jiraUserName>${junitflakylistener.jiraUserName}</junitflakylistener.jiraUserName>
                                <!-- A test cannot be officially "flaky" with reruns = 0, so we could report all failures -->
                                <junitflakylistener.reportAllFailures>${junitflakylistener.reportAllFailures}</junitflakylistener.reportAllFailures>
                                <junitflakylistener.runnerId>${junitflakylistener.runnerId}</junitflakylistener.runnerId>
                                <!-- issue creation kill switch; by default, issues will be created on branch builds as well -->
                                <junitflakylistener.trackFlakyTest>${junitflakylistener.trackFlakyTest}</junitflakylistener.trackFlakyTest>
                                <junitflakylistener.trackFlakyTestOnBranchesRegExp>${junitflakylistener.trackFlakyTestOnBranchesRegExp}</junitflakylistener.trackFlakyTestOnBranchesRegExp>
                                <!-- Comment on existing Jira ticket with flakes for other branches (branches not matching the regex in trackFlakyTestOnBranchesRegExp)  -->
                                <junitflakylistener.updateIssueOnBranches>${junitflakylistener.updateIssueOnBranches}</junitflakylistener.updateIssueOnBranches>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>checkstyle</id>
            <properties>
                <atlassian.codestyle>confluence-codestyle:${atlassian.codestyle.version}</atlassian.codestyle>
                <atlassian.codestyle.version>4.0.2</atlassian.codestyle.version>
                <checkstyle.version>10.26.1</checkstyle.version>
                <skipCopyCodeStyle>false</skipCopyCodeStyle>
            </properties>
        </profile>
        <!-- Mac-specific formatting profile -->
        <profile>
            <id>configure-githooks</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
                <property>
                    <name>!env.CONF_GIT_HOOKS_DISABLE</name>
                </property>
                <file>
                    <missing>.git/hooks/post-checkout</missing>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>${exec-maven-plugin.version}</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>install-git-hooks</id>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <executable>${project.basedir}/scripts/install-githooks.sh</executable>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>formatting-on-mac</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <properties>
                <skip.formatting.check>false</skip.formatting.check>
            </properties>
        </profile>
    </profiles>
</project>
