<?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-pom</artifactId>
        <version>6.3.1</version>
    </parent>
    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>confluence-content-plugins</artifactId>
    <version>18.9.23</version>
    <packaging>pom</packaging>
    <name>confluence-content-plugins</name>
    <description>confluence-content-plugins</description>
    <organization>
        <name>Atlassian</name>
        <url>http://www.atlassian.com/</url>
    </organization>
    <modules>
        <module>confluence-advanced-macros-plugin</module>
        <module>confluence-content-report-plugin</module>
        <module>confluence-expand-macro</module>
        <module>confluence-multimedia-macros</module>
        <module>confluence-contributors-plugin</module>
        <module>confluence-tasklist-plugin</module>
        <module>status-macro</module>
        <module>atlassian-playbook-server-blueprints</module>
        <module>confluence-default-space-content-plugin</module>
        <module>confluence-feature-discovery-plugin</module>
        <module>confluence-masterdetail-plugin</module>
        <module>confluence-space-blueprints</module>
        <module>confluence-dialog-wizard</module>
        <module>confluence-widget-connector</module>
        <module>confluence-collaborative-editor-plugin</module>
        <module>collaborative-content-feedback-plugin</module>
        <module>confluence-emoticons-plugin</module>
        <module>confluence-inline-comments</module>
        <module>confluence-mentions-plugin</module>
        <module>confluence-inline-tasks</module>
        <module>confluence-editor</module>
        <module>confluence-drag-and-drop</module>
    </modules>
    <scm>
        <connection>scm:git:ssh://git@stash.atlassian.com:7997/confserver/confluence-content-plugins.git</connection>
        <developerConnection>scm:git:ssh://git@stash.atlassian.com:7997/confserver/confluence-content-plugins.git</developerConnection>
        <url>https://stash.atlassian.com/projects/CONFSERVER/repos/confluence-content-plugins/browse</url>
        <tag>confluence-content-plugins-18.9.23</tag>
    </scm>

    <properties>
        <!-- renovate: depName=com.atlassian.confluence:confluence-plugins-platform-pom -->
        <confluence.version>8.9.0-m44</confluence.version>
        <confluence.data.version>${confluence.version}</confluence.data.version>
        <amps8.version>8.11.4</amps8.version>
        <failOnMilestoneOrReleaseCandidateDeps>false</failOnMilestoneOrReleaseCandidateDeps>

        <!-- Allows to specify custom arguments in build scripts -->
        <jvm.args.custom />
        <jvm.args.xmx>1024m</jvm.args.xmx>
        <!--suppress UnresolvedMavenProperty -->
        <jvm.args>-Xmx${jvm.args.xmx} ${jvm.args.custom} ${jacoco.it.argLine}</jvm.args>
        <containerId>tomcat9x</containerId>
        <webdriver.browser>firefox</webdriver.browser>

        <maven.compiler.release>11</maven.compiler.release>

        <surefire.version>3.0.0-M8</surefire.version>
        <download.maven.plugin.version>1.6.8</download.maven.plugin.version>
        <flaky.test.reporter.version>3.2.2</flaky.test.reporter.version>
        <version.override.set>maven-surefire-plugin,maven-failsafe-plugin</version.override.set>

        <atlassian-spring-scanner.version>3.0.4</atlassian-spring-scanner.version>
        <atlassian-audit.version>1.15.1</atlassian-audit.version>
        <atlassian.product.test-lib.version>3.0.0</atlassian.product.test-lib.version>
        <confluence-extractor-api-plugin.version>1.0</confluence-extractor-api-plugin.version>

        <dependency-report-maven-plugin.version>1.5.19</dependency-report-maven-plugin.version>
        <exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
        <javadoc.version>3.4.1</javadoc.version>
        <lesscss-maven-plugin.version>5.0.3</lesscss-maven-plugin.version>
        <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
        <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
        <maven-artifact.version>3.8.6</maven-artifact.version>
        <unpack-test-jar.version>0.9</unpack-test-jar.version>

        <active-objects-plugin.version>3.0.3</active-objects-plugin.version>
        <fugue.version>4.7.2</fugue.version>
        <jacoco.version>0.8.8</jacoco.version>
        <sonar.version>3.6.1.1688</sonar.version>
        <jaxb-api.version>2.3.1</jaxb-api.version>
        <jaxen.version>1.1.6</jaxen.version>
        <jersey.client.version>1.19.4</jersey.client.version>
        <jsap.version>2.1</jsap.version>
        <jsr311-api.version>1.1.1</jsr311-api.version>
        <gson.version>2.10.1</gson.version>
        <guice.version>5.1.0</guice.version>
        <hamcrest.version>2.2</hamcrest.version>
        <hamcrest-date.version>0.9.5</hamcrest-date.version>
        <nimbus-jose-jwt.version>9.28</nimbus-jose-jwt.version>
        <mockito.version>5.1.1</mockito.version>
        <plexus-utils.version>3.5.0</plexus-utils.version>
        <rest-assured.version>4.4.0</rest-assured.version>
        <servlet.api.version>3.1.0</servlet.api.version>
        <spring.version>4.2.5.RELEASE</spring.version>
        <incrementalbuild.enabled>true</incrementalbuild.enabled>
        <maven.profiling.product>CONFLUENCE_CONTENT_PLUGINS</maven.profiling.product>
    </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.confluence</groupId>
                <artifactId>confluence-plugins-platform-test-pom</artifactId>
                <version>${confluence.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- We need Guice5+ for Java17 runtime compatibility -->
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>${guice.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.plugin</groupId>
                    <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                    <version>${atlassian-spring-scanner.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>confluence-maven-plugin</artifactId>
                    <version>${amps8.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <productVersion>${confluence.version}</productVersion>
                        <productDataVersion>${confluence.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>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>no-test-coverage</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <jacoco.it.argLine><!-- Empty for no-op --></jacoco.it.argLine>
            </properties>
        </profile>
        <profile>
            <id>test-coverage</id>
            <properties>
                <jacoco.it.argLine>
                    -javaagent:${project.build.directory}/jacoco.agent-runtime.jar=destfile=${project.build.directory}/jacoco-it.exec,includes=com/atlassian/**/*
                </jacoco.it.argLine>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.5.0</version>
                        <executions>
                            <execution>
                                <id>jacoco</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <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>
                        <version>${jacoco.version}</version>
                        <executions>
                            <execution>
                                <id>prepare-agent-unit-test</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>post-unit-test</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <!-- Sets the path to the file which contains the execution data. -->
                                    <dataFile>${project.build.directory}/jacoco.exec</dataFile>
                                    <!-- Sets the output directory for the code coverage report. -->
                                    <outputDirectory>target/jacoco-ut</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>post-integration-test</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <!-- Sets the path to the file which contains the execution data. -->
                                    <dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
                                    <!-- Sets the output directory for the code coverage report. -->
                                    <outputDirectory>target/jacoco-it</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                        <version>${sonar.version}</version>
                    </plugin>
                    <plugin>
                        <groupId>com.atlassian.drs</groupId>
                        <artifactId>dependency-report-maven-plugin</artifactId>
                        <version>${dependency-report-maven-plugin.version}</version>
                        <configuration>
                            <project>confluence-content-plugins</project>
                            <unitTestCodeCoveragePaths>${project.build.directory}/jacoco.exec</unitTestCodeCoveragePaths>
                            <integrationTestCodeCoveragePaths>${project.build.directory}/jacoco-it.exec</integrationTestCodeCoveragePaths>
                            <gracefulFailure>true</gracefulFailure>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>upload</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
