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

    <groupId>com.atlassian.business.insights</groupId>
    <artifactId>atlassian-business-insights</artifactId>
    <version>4.0.0</version>
    <packaging>pom</packaging>

    <modules>
        <module>api</module>
        <module>bitbucket-plugin</module>
        <module>core</module>
        <module>core-plugin</module>
        <module>core-plugin-integration-tests</module>
        <module>jira-plugin</module>
        <module>jira-plugin-performance-tests</module>
        <module>confluence-plugin</module>
        <module>jacoco-aggregator</module>
        <module>test-utils</module>
        <module>it-backdoor</module>
        <module>integration-tests</module>
    </modules>

    <scm>
        <connection>scm:git:ssh://git@stash.atlassian.com:7997/dcq/business-insights.git</connection>
        <developerConnection>scm:git:ssh://git@stash.atlassian.com:7997/dcq/business-insights.git</developerConnection>
        <url>https://stash.atlassian.com/projects/DCQ/repos/business-insights</url>
        <tag>atlassian-business-insights-4.0.0</tag>
    </scm>

    <properties>
        <!-- Build -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.release>21</maven.compiler.release>
        <required.jdk.version>[21,)</required.jdk.version>
        <required.maven.version>3.6</required.maven.version>

        <!-- Platform -->
        <amps.version>9.3.2</amps.version>
        <containerId>tomcat10x</containerId>
        <atlassian.spring.scanner.version>6.0.0</atlassian.spring.scanner.version>
        <osgi.javaconfig.version>0.6.0</osgi.javaconfig.version>
        <platform.version>8.0.0-m11</platform.version>
        <plugin.testrunner.version>2.0.2</plugin.testrunner.version>
        <!-- DCQS-157 remove this custom version once Bitbucket can run on version 8.0 -->
        <atlassian.rest.v2.version>7.2.22</atlassian.rest.v2.version>

        <!-- Products -->
        <bitbucket.version>10.0.0-m5</bitbucket.version>
        <jira.version>11.0.0-QR-20250603104633</jira.version>
        <!-- Do not use jira.version because this will break jira bundled plans -->
        <jira.software.version>11.0.0-int-4891</jira.software.version>
        <jira.plugins.greenhopper>${jira.software.version}</jira.plugins.greenhopper>
        <!-- Do not use jira.version because this will break jira bundled plans -->
        <jira.servicedesk.version>11.0.0-m0002</jira.servicedesk.version>
        <jira.servicedesk.components.version>21.0.0-QR-0108</jira.servicedesk.components.version>
        <jira.servicedesk.internal.version>${jira.servicedesk.components.version}</jira.servicedesk.internal.version>
        <jira.pocketknife.version>1.0.8</jira.pocketknife.version>
        <jira.testkit.version>11.0.3</jira.testkit.version>
        <rest.api.browser.version>3.2.8</rest.api.browser.version>
        <refapp.version>${platform.version}</refapp.version>
        <confluence.version>10.0.0-m85</confluence.version>
        <confluence.test.version>${confluence.version}</confluence.test.version>
        <confluence-test-utils.version>16.2.2</confluence-test-utils.version>

        <!-- Libraries -->
        <assertj.version>3.26.3</assertj.version>
        <checkstyle.version>8.34</checkstyle.version>
        <checkstyle-plugin.version>3.6.0</checkstyle-plugin.version>
        <exec.maven-plugin.version>3.5.0</exec.maven-plugin.version>
        <findbugs.version>3.0.2</findbugs.version>
        <junit-jupiter.version>5.12.2</junit-jupiter.version>
        <mockito.version>4.3.1</mockito.version>
        <mockito-junit.version>4.11.0</mockito-junit.version>
        <rest-assured.version>5.2.0</rest-assured.version>
        <hsqldb.version>1.8.0.10</hsqldb.version>
        <h2db.version>1.4.200</h2db.version>
        <httpclient.version>4.5.14</httpclient.version>
        <commons-codec.version>1.17.1</commons-codec.version>
        <log4j.version>2.17.2</log4j.version>
        <hamcrest.version>1.3</hamcrest.version>

        <!-- Code coverage -->
        <jacoco.version>0.8.12</jacoco.version>
        <jacoco.include.pattern>com/atlassian/**/*</jacoco.include.pattern>
        <jacoco.report.file>jacoco-aggregator/target/site/jacoco-aggregate/jacoco.xml</jacoco.report.file>
        <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../${jacoco.report.file}</sonar.coverage.jacoco.xmlReportPaths>
        <!-- initiate this property so amps' jvmArgs can work outside of coverage profile -->
        <jacoco.agent.it.argLine />

        <!-- Swagger -->
        <swagger.annotations.version>2.2.27</swagger.annotations.version>
        <swagger.maven-plugin.version>2.2.27</swagger.maven-plugin.version>

        <!-- Docker -->
        <docker.fabric8.version>0.45.1</docker.fabric8.version>

        <!-- Nodejs -->
        <node.installdir>${project.basedir}/.node</node.installdir>
        <!--    Remember to update the .nvmrc and package.json files    -->
        <node.version>v20.18.1</node.version>
        <yarn.version>v1.22.22</yarn.version>

        <!-- Release -->
        <artifactory.staging.skip>true</artifactory.staging.skip>

        <!--Confluence dependencies-->
        <confluence.afc.version>18.9.57</confluence.afc.version>

        <!-- Frontend -->
        <frontend.maven.plugin.version>1.15.1</frontend.maven.plugin.version>
        <frontend.maven.plugin.install.directory>${project.build.directory}</frontend.maven.plugin.install.directory>
        <frontend.node.version>${node.version}</frontend.node.version>
        <frontend.yarn.version>${yarn.version}</frontend.yarn.version>
        <frontend.cmd.install>install</frontend.cmd.install>
        <frontend.cmd.build>build</frontend.cmd.build>
        <frontend.cmd.unit.test>test</frontend.cmd.unit.test>
        <kotlin.version>2.1.20</kotlin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <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-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-test-resources</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${httpclient.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>${commons-codec.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-common</artifactId>
                <version>${kotlin.version}</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk7</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence-test-utils</artifactId>
                <version>${confluence-test-utils.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>${findbugs.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-inline</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito-junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest-assured.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>atlassian-mirror</id>
            <url>https://packages.atlassian.com/mvn/maven-external/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>atlassian-mirror</id>
            <url>https://packages.atlassian.com/mvn/maven-external/</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tidy-maven-plugin</artifactId>
                <version>1.3.0</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle-plugin.version}</version>
                <configuration>
                    <consoleOutput>true</consoleOutput>
                    <failOnViolation>true</failOnViolation>
                    <configLocation>resources/checkstyle/checkstyle-rules.xml</configLocation>
                    <suppressionsLocation>resources/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
                    <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <!-- If you update versions for Checkstyle or either of the custom check jars, you need to
                         make matching changes in scripts/git-hooks/pre-commit -->
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>9.3</version>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.bitbucket.server</groupId>
                        <artifactId>bitbucket-checkstyle</artifactId>
                        <version>3.0.4</version>
                        <exclusions>
                            <exclusion>
                                <groupId>checkstyle</groupId>
                                <artifactId>checkstyle</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>org.bouncycastle:bcprov-jdk15on:[1.52]</exclude>
                                    </excludes>
                                    <message>This version has been banned from the project because of the following vulnerabilities reported by SNYK:
&gt; https://snyk.io/vuln/maven:org.bouncycastle:bcprov-jdk15on@1.52
                                    </message>
                                </bannedDependencies>
                                <requireMavenVersion>
                                    <version>${required.maven.version}</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>${required.jdk.version}</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- Kill the hammer rule with fire, because it's pointless noise and a waste of time to
                             continuously update as our milestone and release candidate dependencies change -->
                        <id>ban-milestones-and-release-candidates</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <message>
                                        Exclude log4j because of critical security vulnerability "Deserialization
                                        of Untrusted Data" [CVE-2019-17571] with no fixed version. Library is
                                        deprecated since 2015. If necessary, use org.slf4j:log4j-over-slf4j instead.
                                    </message>
                                    <excludes>
                                        <exclude>log4j:log4j</exclude>
                                    </excludes>
                                </bannedDependencies>
                                <bannedDependencies>
                                    <message>
                                        log4j-over-slf4j.jar and slf4j-log4j12.jar cannot be present simultaneously.
                                        If both are present simultaneously, slf4j calls will be delegated to log4j,
                                        and log4j calls redirected to SLF4j, resulting in an endless loop.
                                    </message>
                                    <excludes>
                                        <exclude>org.slf4j:slf4j-log4j12</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
                    <forkedProcessExitTimeoutInSeconds>500</forkedProcessExitTimeoutInSeconds>
                    <reuseForks>true</reuseForks>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.10.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <source>8</source>
                    <detectJavaApiLink>false</detectJavaApiLink>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <skipIfEmpty>true</skipIfEmpty>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- This profile allows frontend-maven-plugin to download yarn and node directly from PAC instead of using github. -->
            <id>useMavenRestrictedRepoForYarn</id>
            <activation>
                <!-- Activated on bamboo builds.
                     Deactivate it (passing -P -useMavenRestrictedRepoForYarn as a build parameter) if there are issues
                     when building without access to internal maven repo.
                -->
                <property>
                    <name>env.bamboo_planKey</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.github.eirslett</groupId>
                            <artifactId>frontend-maven-plugin</artifactId>
                            <version>${frontend.maven.plugin.version}</version>
                            <configuration>
                                <serverId>maven-atlassian-com</serverId>
                                <nodeDownloadRoot>https://packages.atlassian.com/artifactory/nodejs-dist/</nodeDownloadRoot>
                                <yarnDownloadRoot>https://packages.atlassian.com/artifactory/yarn-dist/</yarnDownloadRoot>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.version}</version>
                        <configuration>
                            <destFile>${project.basedir}/../jacoco-aggregator/merged-jacoco.exec</destFile>
                            <append>true</append>
                        </configuration>
                        <executions>
                            <execution>
                                <id>agent-for-ut</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <propertyName>jacoco.agent.argLine</propertyName>
                                    <includes>
                                        <include>${jacoco.include.pattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                            <execution>
                                <id>agent-for-it</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                                <configuration>
                                    <propertyName>jacoco.agent.it.argLine</propertyName>
                                    <includes>
                                        <include>${jacoco.include.pattern}</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>@{jacoco.agent.argLine}</argLine>
                            <forkedProcessExitTimeoutInSeconds>500</forkedProcessExitTimeoutInSeconds>
                            <reuseForks>true</reuseForks>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <argLine>@{jacoco.agent.it.argLine}</argLine>
                            <forkedProcessExitTimeoutInSeconds>500</forkedProcessExitTimeoutInSeconds>
                            <reuseForks>true</reuseForks>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
