<?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>public-pom</artifactId>
        <version>6.3.1</version>
    </parent>
    <groupId>com.atlassian.cache</groupId>
    <artifactId>atlassian-cache</artifactId>
    <version>7.0.2</version>
    <packaging>pom</packaging>
    <name>Atlassian Cache</name>
    <url>http://docs.atlassian.com/${project.artifactId}/${project.version}</url>
    <modules>
        <module>atlassian-cache-api</module>
        <module>atlassian-cache-common-impl</module>
        <module>atlassian-cache-core-test</module>
        <module>atlassian-cache-memory</module>
        <module>atlassian-cache-ehcache</module>
        <module>atlassian-cache-hazelcast</module>
        <module>atlassian-cache-vcache</module>
        <module>sonar-aggregator</module>
        <module>atlassian-cache-integration-tests</module>
    </modules>
    <scm>
        <connection>scm:git:git@bitbucket.org:atlassian/dc-platform.git</connection>
        <developerConnection>scm:git:git@bitbucket.org:atlassian/dc-platform.git</developerConnection>
        <url>https://bitbucket.org/atlassian/dc-platform</url>
        <tag>atlassian-cache-7.0.2</tag>
    </scm>
    <issueManagement>
        <system>Jira</system>
        <url>https://ecosystem.atlassian.net/browse/CACHE</url>
    </issueManagement>
    <ciManagement>
        <system>Bamboo</system>
        <url>https://ecosystem-bamboo.internal.atlassian.com/browse/CACHE</url>
    </ciManagement>
    <properties>
        <!-- Direct dependencies -->
        <platform.version>7.0.10</platform.version>
        <atl.hazelcast.extras.version>5.0.0</atl.hazelcast.extras.version>
        <ehcache.version>2.10.9.4.10</ehcache.version>
        <!--IMPORTANT:
        In hazelcast 3.8 PER_NODE cache capacity calculation algorithm has changed. That requires adjusting the
        requested capacity for the cache maps with PER_NODE capacity settings.
        (https://github.com/hazelcast/hazelcast/issues/11646)

        In Hazelcast 3.9 a new way of map settings replication was introduced. It should allow dynamic map config
        changes, but in fact it broke existent "home-made" way of map config replications. Unfortunately there is no
        way to turn it off, so we cannot update to any version higher 3.9 until it's fixed.
        (https://github.com/hazelcast/hazelcast/pull/12073)
        When dynamic map configuration is fixed in a way that it also allows reconfiguration, we may get rid of our
        custom map configuration mechanism in HazelcastCacheManager.
        -->
        <hazelcast.version>5.2.1</hazelcast.version>
        <javax.annotation.version>1.3.2</javax.annotation.version>
        <vcache.version>0.7.0</vcache.version>
        <!-- Test dependencies -->
        <hamcrest.version>2.2</hamcrest.version>
        <junit.version>4.13.2</junit.version>
        <mockito.version>3.12.4</mockito.version>
        <unit-test-toolkit.version>2.5.2</unit-test-toolkit.version>
        <jacoco.report.file>sonar-aggregator/target/site/jacoco-aggregate/jacoco.xml</jacoco.report.file>
        <sonar.coverage.exclusions>atlassian-cache-core-test/**</sonar.coverage.exclusions>
        <jvm.reflective.access />
    </properties>
    <dependencyManagement>
        <dependencies>
            <!-- Internal -->
            <dependency>
                <groupId>com.atlassian.cache</groupId>
                <artifactId>atlassian-cache-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.cache</groupId>
                <artifactId>atlassian-cache-common-impl</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.cache</groupId>
                <artifactId>atlassian-cache-core-test</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.cache</groupId>
                <artifactId>atlassian-cache-ehcache</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.cache</groupId>
                <artifactId>atlassian-cache-hazelcast</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.cache</groupId>
                <artifactId>atlassian-cache-memory</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.cache</groupId>
                <artifactId>atlassian-cache-vcache</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!-- Platform -->
            <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>
            <!-- External -->
            <dependency>
                <groupId>com.atlassian.hazelcast</groupId>
                <artifactId>atlassian-hazelcast-extras-osgi</artifactId>
                <version>${atl.hazelcast.extras.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.hazelcast</groupId>
                <artifactId>hazelcast-test-util</artifactId>
                <version>${atl.hazelcast.extras.version}</version>
            </dependency>
            <dependency>
                <groupId>com.hazelcast</groupId>
                <artifactId>hazelcast</artifactId>
                <version>${hazelcast.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.vcache</groupId>
                <artifactId>atlassian-vcache-internal-api</artifactId>
                <version>${vcache.version}</version>
            </dependency>
            <dependency>
                <groupId>com.hazelcast</groupId>
                <artifactId>hazelcast</artifactId>
                <version>${hazelcast.version}</version>
                <classifier>tests</classifier>
            </dependency>
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>${javax.annotation.version}</version>
            </dependency>
            <dependency>
                <groupId>net.sf.ehcache</groupId>
                <artifactId>ehcache</artifactId>
                <version>${ehcache.version}</version>
            </dependency>
            <!-- Test -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.utt</groupId>
                <artifactId>toolkit</artifactId>
                <version>${unit-test-toolkit.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.vcache</groupId>
                <artifactId>atlassian-vcache-internal-legacy</artifactId>
                <version>${vcache.version}</version>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>4.5.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <argLine>${jvm.reflective.access}</argLine>
                        <rerunFailingTestsCount>3</rerunFailingTestsCount>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>2.43.0</version>
                <configuration>
                    <java>
                        <palantirJavaFormat>
                            <version>2.28.0</version>
                        </palantirJavaFormat>
                        <importOrder>
                            <wildcardsLast>true</wildcardsLast>
                            <order>java|javax,lombok,org.spring|org|com|io,,com.atlassian,com.atlassian.beacon|\#,\#com.atlassian</order>
                        </importOrder>
                        <removeUnusedImports />
                    </java>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>it</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                            <rerunFailingTestsCount>3</rerunFailingTestsCount>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jacoco</id>
            <properties>
                <jacoco.include.pattern>com/atlassian/cache/**</jacoco.include.pattern>
            </properties>
            <build>
                <plugins>
                    <!-- Code coverage -->
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <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>
                            <rerunFailingTestsCount>3</rerunFailingTestsCount>
                        </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>
        <profile>
            <id>jvm-reflective-access</id>
            <activation>
                <jdk>[16,)</jdk>
            </activation>
            <properties>
                <!-- This should be no more than the overlap of what all products distribute otherwise we'll find issues
                        later than we should -->
                <jvm.reflective.access>--add-opens=java.base/java.lang=ALL-UNNAMED</jvm.reflective.access>
            </properties>
        </profile>
    </profiles>
</project>
