<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <modules>
        <module>api</module>
        <module>cli</module>
        <module>common</module>
        <module>store</module>
        <module>service</module>
        <module>plugin</module>
        <module>plugin-tests</module>
        <module>acceptance-tests</module>
        <module>sonar-aggregator</module>
    </modules>
    <repositories>
        <repository>
            <id>public-maven-atlassian-com</id>
            <name>Public Atlassian Maven</name>
            <url>https://packages.atlassian.com/maven-public/</url>
        </repository>
    </repositories>

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

    <groupId>com.atlassian.secrets</groupId>
    <artifactId>atlassian-secrets</artifactId>
    <version>5.1.6</version>
    <packaging>pom</packaging>

    <scm>
        <connection>scm:git:ssh://git@bitbucket.org/atlassian/atlassian-secrets.git</connection>
        <developerConnection>scm:git:ssh://git@bitbucket.org/atlassian/atlassian-secrets.git
        </developerConnection>
        <url>https://bitbucket.org/atlassian/atlassian-secrets</url>
        <tag>atlassian-secrets-5.1.6</tag>
    </scm>

    <licenses>
        <license>
            <name>Atlassian Software License Agreement</name>
            <url>https://www.atlassian.com/legal/software-license-agreement/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <amps.version>9.1.1</amps.version>
        <atlassian-osgi-javaconfig.version>0.6.0</atlassian-osgi-javaconfig.version>
        <atlassian-secrets.version>${project.version}</atlassian-secrets.version>
        <atlassian-secrets.plugin.key>${project.groupId}.${project.artifactId}</atlassian-secrets.plugin.key>
        <commons-logging.version>1.3.3</commons-logging.version>
        <javax-annotation-api.version>1.3.2</javax-annotation-api.version>
        <jvmHeap>-Xmx1536m -Xms512m -XX:ReservedCodeCacheSize=256m -XX:MaxMetaspaceSize=1024m</jvmHeap>
        <!-- Following jvm17.opens params need to be on the same line, otherwise it will not be parsed correctly by amps and fails with java execution error -->
        <jvm17.opens>--add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.temporal=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED</jvm17.opens>
        <log4j.version>2.24.1</log4j.version>
        <maven.compiler.release>17</maven.compiler.release>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <platform.version>7.3.3</platform.version>
        <refapp.version>${platform.version}</refapp.version>
        <spring.vault.version>2.3.4</spring.vault.version>
        <swagger.version>2.2.24</swagger.version>
        <tomcat.version>[8.5.87,9.0.102]</tomcat.version>

        <!--   Testing   -->
        <assertj.version>3.26.3</assertj.version>
        <junit.version>5.10.3</junit.version>
        <mockito.version>5.14.2</mockito.version>
        <rest.assured.version>4.5.1</rest.assured.version>
        <testcontainers.version>1.20.2</testcontainers.version>

        <!--   Static analysis    -->
        <jacoco.report.file>sonar-aggregator/target/site/jacoco-aggregate/jacoco.xml</jacoco.report.file>
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>

        <!--   Product   -->
        <product>refapp</product>

        <!-- Latest Bitbucket milestone release see: https://server-syd-bamboo.internal.atlassian.com/browse/BSERV-RELEASE -->
        <bitbucket.run.version>9.5.0-rc1</bitbucket.run.version>
        <bitbucket.http.port>7990</bitbucket.http.port>

        <!-- Latest Milestone used see: https://server-syd-bamboo.internal.atlassian.com/browse/CONFREL-CDMR -->
        <confluence.run.version>9.3.0-m101</confluence.run.version>
        <confluence.http.port>8090</confluence.http.port>

        <!-- Latest QR release used see: https://server-gdn-bamboo.internal.atlassian.com/browse/JIRA-QR -->
        <jira.run.version>10.4.0-QR-20241217114827</jira.run.version>
        <jira.http.port>2990</jira.http.port>

        <refapp.http.port>5990</refapp.http.port>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.1</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.10</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.1.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.diffplug.spotless</groupId>
                    <artifactId>spotless-maven-plugin</artifactId>
                    <version>2.43.0</version>
                    <configuration>
                        <java>
                            <replaceRegex>
                                <name>Remove wildcard imports</name>
                                <searchRegex>import\s+[^\*\s]+\*;(\r\n|\r|\n)</searchRegex>
                                <replacement>$1</replacement>
                            </replaceRegex>
                            <palantirJavaFormat>
                                <version>2.47.0</version>
                            </palantirJavaFormat>
                            <importOrder>
                                <wildcardsLast>true</wildcardsLast>
                            </importOrder>
                            <removeUnusedImports />
                        </java>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <executions>
                    <execution>
                        <id>validate-javadocs</id>
                        <goals>
                            <goal>javadoc</goal>
                        </goals>
                        <phase>verify</phase>
                        <configuration>
                            <doclint />
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencyManagement>
        <dependencies>
            <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>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.vault</groupId>
                <artifactId>spring-vault-core</artifactId>
                <version>${spring.vault.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- TestContainers -->
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>localstack</artifactId>
                <version>${testcontainers.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>vault</artifactId>
                <version>${testcontainers.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>toxiproxy</artifactId>
                <version>${testcontainers.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers</artifactId>
                <version>${testcontainers.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${testcontainers.version}</version>
            </dependency>
            <!-- Platform -->
            <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-bundled-plugins</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.platform.dependencies</groupId>
                <artifactId>platform-internal-api</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>

            <!-- Internal -->
            <dependency>
                <groupId>com.atlassian.secrets</groupId>
                <artifactId>secrets-manager-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Products -->

            <!-- Atlassian -->
            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-osgi-javaconfig</artifactId>
                <version>${atlassian-osgi-javaconfig.version}</version>
            </dependency>

            <!-- Provided -->
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>${javax-annotation-api.version}</version>
            </dependency>

            <dependency>
                <groupId>io.swagger.core.v3</groupId>
                <artifactId>swagger-annotations</artifactId>
                <version>${swagger.version}</version>
            </dependency>

            <!-- Tests Dependencies -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${mockito.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>io.rest-assured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>${rest.assured.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j2-impl</artifactId>
                <version>${log4j.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito.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.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>jacoco</id>
            <properties>
                <jacoco.include.pattern>com/atlassian/secrets/**</jacoco.include.pattern>
                <!-- To be overridden at build time -->
                <sonar.branch.name />
                <sonar.host.url>https://sonar-enterprise.internal.atlassian.com</sonar.host.url>
                <sonar.login />
                <sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
                <sonar.projectKey>atlassian-secrets</sonar.projectKey>
                <sonar.scm.provider>git</sonar.scm.provider>
            </properties>
            <build>
                <plugins>
                    <!-- Code coverage -->
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <configuration>
                            <destFile>${sonar.jacoco.reportPath}</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>
                                <goals>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                                <phase>initialize</phase>
                                <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>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <argLine>@{jacoco.agent.it.argLine}</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
