<?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>

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

    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>confluence-inline-comments-parent</artifactId>
    <version>8.5.9</version>
    <packaging>pom</packaging>

    <name>Confluence Inline Comments Parent</name>
    <description>Enables the addition of inline comment onto Confluence pages</description>
    <organization>
        <name>Atlassian</name>
        <url>http://www.atlassian.com/</url>
    </organization>
    <licenses>
        <license>
            <name>Atlassian 3.0 End User License Agreement</name>
            <url>http://www.atlassian.com/end-user-agreement/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <modules>
        <module>confluence-inline-comments</module>
        <module>confluence-inline-comments-integration-tests</module>
    </modules>

    <scm>
        <connection>scm:git:ssh://git@stash.atlassian.com:7997/confserver/confluence-inline-comments.git</connection>
        <developerConnection>scm:git:ssh://git@stash.atlassian.com:7997/confserver/confluence-inline-comments.git</developerConnection>
        <tag>confluence-inline-comments-parent-8.5.9</tag>
    </scm>

    <properties>
        <confluence.version>7.13.11</confluence.version>
        <confluence.data.version>${confluence.version}</confluence.data.version>

        <failOnMilestoneOrReleaseCandidateDeps>false</failOnMilestoneOrReleaseCandidateDeps>

        <soy.template.version>6.0.5</soy.template.version>
        <jquery.version>2.2.4.11-c72c117</jquery.version>
        <aui.version>5.8.29</aui.version>

        <confluence-webdriver-pageobjects.version>9.0.1</confluence-webdriver-pageobjects.version>

        <highlight-actions.version>1.7.7</highlight-actions.version>
        <confluence-notifications.version>9.0.3</confluence-notifications.version>
        <jaxb.version>2.3.1</jaxb.version>

        <amps8.version>8.9.1</amps8.version>
        <containerId>tomcat8x</containerId>

        <mockito.version>4.10.0</mockito.version>
        <byte-buddy.version>1.12.20</byte-buddy.version>

        <jvm.args.custom /> <!-- Allows to specify custom arguments in build scripts -->
        <jvm.args.xmx>1024m</jvm.args.xmx>
        <jvm.args>-Xmx${jvm.args.xmx} ${jvm.args.custom}</jvm.args>

        <!-- For the flaky test reporter profile. -->
        <!-- override the versions of the listed plugins in amps -->
        <version.override.set>maven-failsafe-plugin</version.override.set>
        <!-- failsafe 2.20.1 or newer required for rerun support. Double check the version from the parent-pom -->
        <surefire.version>3.0.0-M7</surefire.version>
        <download.maven.plugin.version>1.6.8</download.maven.plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-inline-comments</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-inline-comments</artifactId>
                <version>${project.version}</version>
                <classifier>test</classifier>
            </dependency>

            <!-- Notification dependencies -->
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-notifications-spi-plugin</artifactId>
                <version>${confluence-notifications.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-notifications-batch-api</artifactId>
                <version>${confluence-notifications.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-content-notifications-plugin</artifactId>
                <version>${confluence-notifications.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-email-litmus-tests</artifactId>
                <version>${confluence-notifications.version}</version>
                <exclusions>
                    <!-- Cannot find reference to confluence-inline-comments jar, since the local reactor thinks it's an atlassian-plugin only -->
                    <exclusion>
                        <groupId>com.atlassian.confluence.plugins</groupId>
                        <artifactId>confluence-inline-comments</artifactId>
                    </exclusion>

                    <!-- Exclusions in confluence-project pom -->
                    <exclusion>
                        <groupId>com.atlassian.selenium</groupId>
                        <artifactId>atlassian-webdriver-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.atlassian.confluence</groupId>
                        <artifactId>confluence-webdriver-support</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.atlassian.bundles</groupId>
                        <artifactId>jsr305</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit-dep</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>


            <!-- Test Dependencies -->
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence-test-support</artifactId>
                <version>${confluence.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence-acceptance-test</artifactId>
                <version>${confluence.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence-rest-client</artifactId>
                <version>${confluence.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence-webdriver-pageobjects</artifactId>
                <version>${confluence-webdriver-pageobjects.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence-testutils</artifactId>
                <version>${confluence.version}</version>
            </dependency>

            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-highlight-actions</artifactId>
                <version>${highlight-actions.version}</version>
            </dependency>

            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>${jaxb.version}</version>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>

            <!-- TODO remove version override when on Confluence 7.0.1 or higher -->
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${byte-buddy.version}</version>
            </dependency>
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy-agent</artifactId>
                <version>${byte-buddy.version}</version>
            </dependency>
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy-dep</artifactId>
                <version>${byte-buddy.version}</version>
            </dependency>

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

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>confluence-maven-plugin</artifactId>
                    <version>${amps8.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>amps-dispatcher-maven-plugin</artifactId>
                    <version>${amps8.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${surefire.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!-- 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>
                    <skip>${maven.test.unit.skip}</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.8</version>
                <executions>
                    <execution>
                        <id>prepare-agent</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>target/jacoco.exec</dataFile>
                            <!-- Sets the output directory for the code coverage report. -->
                            <outputDirectory>target/jacoco-ut</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.drs</groupId>
                <artifactId>dependency-report-maven-plugin</artifactId>
                <version>1.4.6</version>
                <configuration>
                    <project>confluence-inline-comments</project>
                    <unitTestCodeCoveragePaths>${project.build.outputDirectory}/jacoco.exec</unitTestCodeCoveragePaths>
                    <gracefulFailure>true</gracefulFailure>
                </configuration>
                <executions>
                    <execution>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>upload</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
