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

    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>confluence-daily-summary-email</artifactId>
    <version>7.0.1</version>
    <packaging>atlassian-plugin</packaging>

    <name>Confluence daily summary email</name>
    <description>This is the Confluence Daily Summary Email plugin for Atlassian Confluence.</description>

    <scm>
        <connection>scm:git:ssh://git@stash.atlassian.com:7997/confserver/confluence-daily-summary-email.git</connection>
        <developerConnection>scm:git:ssh://git@stash.atlassian.com:7997/confserver/confluence-daily-summary-email.git</developerConnection>
        <tag>confluence-daily-summary-email-7.0.1</tag>
    </scm>

    <properties>
        <confluence.version>7.0.1-CONFSRVDEV-10801-m13</confluence.version>
        <confluence.data.version>${confluence.version}</confluence.data.version>
        <plugin.key>com.atlassian.confluence.plugins.confluence-daily-summary-email</plugin.key>

        <amps8.version>8.0.2</amps8.version>
        <email-tracker.version>1.2</email-tracker.version>
        <atlassian.product.test-lib.version>2.6</atlassian.product.test-lib.version>

        <failOnMilestoneOrReleaseCandidateDeps>false</failOnMilestoneOrReleaseCandidateDeps>
        <javadoc.additional.params>-Xdoclint:none</javadoc.additional.params>
        <atlassian.dev.mode>false</atlassian.dev.mode>

        <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>
        <containerId>tomcat9x</containerId>
        <webdriver.browser>firefox</webdriver.browser>

        <mockito.version>2.28.2</mockito.version>
        <byte-buddy.version>1.9.13</byte-buddy.version>

        <!-- 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>2.22.2</surefire.version>
        <download.maven.plugin.version>1.3.0</download.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>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>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-hibernate2</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-like</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-edge-index</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.rest</groupId>
            <artifactId>confluence-rest-plugin</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- TWENTY-331 Required for EmailReadEvent, commented until email tracker plugin is released. dT -->
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-email-tracker</artifactId>
            <version>${email-tracker.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.botocss</groupId>
            <artifactId>botocss-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.confluence.plugin</groupId>
            <artifactId>func-test-package</artifactId>
            <version>${atlassian.product.test-lib.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassian.confluence.plugin</groupId>
                    <artifactId>jwebunit-htmlunit-plugin</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>jwebunit-htmlunit-plugin</artifactId>
                    <groupId>net.sourceforge.jwebunit</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-test-support</artifactId>
            <version>${confluence.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.activation</groupId>
                    <artifactId>activation</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.3</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.maven.plugins</groupId>
                <artifactId>confluence-maven-plugin</artifactId>
                <version>${amps8.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${confluence.version}</productVersion>
                    <productDataVersion>${confluence.data.version}</productDataVersion>
                    <systemPropertyVariables>
                        <atlassian.dev.mode>${atlassian.dev.mode}</atlassian.dev.mode>
                        <webdriver.browser>${webdriver.browser}</webdriver.browser>
                    </systemPropertyVariables>
                    <containerId>${containerId}</containerId>
                    <jvmArgs>${jvm.args}</jvmArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>flaky</id>
            <properties>
                <ci.tests.skipAfterFailureCount>10</ci.tests.skipAfterFailureCount>
                <ci.tests.rerunFailingTestsCount>2</ci.tests.rerunFailingTestsCount>
            </properties>
            <build>
                <plugins>
                    <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>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <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-failsafe-plugin</artifactId>
                        <configuration>
                            <skipAfterFailureCount>${ci.tests.skipAfterFailureCount}</skipAfterFailureCount>
                            <rerunFailingTestsCount>${ci.tests.rerunFailingTestsCount}</rerunFailingTestsCount>
                            <properties>
                                <property>
                                    <name>listener</name>
                                    <value>com.atlassian.test.reporting.JUnitFlakyTestListener</value>
                                </property>
                            </properties>
                            <systemPropertyVariables>
                                <junitflakylistener.runnerId>${env.bamboo_buildResultKey}</junitflakylistener.runnerId>
                                <junitflakylistener.branchName>${env.bamboo_planRepository_1_branchName}</junitflakylistener.branchName>
                                <!-- issue creation kill switch; by default, issues will be created on branch builds as well -->
                                <junitflakylistener.trackFlakyTest>true</junitflakylistener.trackFlakyTest>
                                <junitflakylistener.flakyTestFilePath>target/failsafe-reports/flakey-tests.txt</junitflakylistener.flakyTestFilePath>
                                <junitflakylistener.jiraProjectConfigPath>issuecreator_plugins_config.json</junitflakylistener.jiraProjectConfigPath>
                                <junitflakylistener.jiraUserName>${env.bamboo_issuecreator_jiraUserName}</junitflakylistener.jiraUserName>
                                <junitflakylistener.jiraPassword>${env.bamboo_issuecreator_jiraPassword}</junitflakylistener.jiraPassword>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>com.atlassian</groupId>
                    <artifactId>flaky-test-reporter</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>com.googlecode.maven-download-plugin</groupId>
                    <artifactId>download-maven-plugin</artifactId>
                    <version>${download.maven.plugin.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
