<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<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>de.acosix.alfresco.maven</groupId>
        <artifactId>de.acosix.alfresco.maven.project.parent-6.1.2</artifactId>
        <version>1.3.2</version>
    </parent>

    <groupId>org.aldica</groupId>
    <artifactId>aldica-parent</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <name>Alternative/Alfresco Distributed Cache - Parent</name>
    <description>Addon providing distributed caching and data grid capabilities to Alfresco Content Services and Share</description>

    <url>https://github.com/aldica/aldica</url>

    <licenses>
        <license>
            <name>Mozilla Public License, Version 2.0</name>
            <url>https://www.mozilla.org/en-US/MPL/2.0/</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:aldica/aldica.git</connection>
        <developerConnection>scm:git:git@github.com:aldica/aldica.git</developerConnection>
        <url>git@github.com:aldica/aldica.git</url>
    </scm>

    <developers>
        <developer>
            <id>AFaust</id>
            <name>Axel Faust</name>
            <email>axel.faust@acosix.de</email>
            <organization>Acosix GmbH</organization>
            <roles>
                <role>Founder</role>
                <role>Architect</role>
                <role>Developer</role>
            </roles>
            <properties>
                <twitter>twitter.com/ReluctantBird83</twitter>
            </properties>
        </developer>
        <developer>
            <id>andreaskring</id>
            <name>Andreas Kring</name>
            <email>andreas@magenta.dk</email>
            <organization>Magenta ApS</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <id>skeen</id>
            <name>Emil Madsen</name>
            <email>emil@magenta.dk</email>
            <organization>Magenta ApS</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>

    <properties>
        <messages.path>aldica</messages.path>
        <messages.packageId>aldica</messages.packageId>
        <moduleId>aldica</moduleId>

        <project.longName>Alternative/Alfresco Distributed Cache</project.longName>
        <project.longNameNoWs>AlternativeAlfrescoDistributedCache</project.longNameNoWs>
        <project.basePackage>org.aldica</project.basePackage>

        <maven.shade.version>3.2.3</maven.shade.version>

        <aldica.ignite-common.artifactId>aldica-common-ignite</aldica.ignite-common.artifactId>
        <aldica.ignite-common.basePackage>org.aldica.common.ignite</aldica.ignite-common.basePackage>
        <aldica.ignite-repo.artifactId>aldica-repo-ignite</aldica.ignite-repo.artifactId>

        <acosix.utility.version>1.2.2</acosix.utility.version>
        <ootbee.support-tools.version>1.1.0.0</ootbee.support-tools.version>
        <apache.ignite.version>2.8.1</apache.ignite.version>
        <easymock.version>4.2</easymock.version>

        <!-- Note: IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK is hopefully temporary until https://github.com/aldica/aldica/issues/39 is fixed upstream -->
        <docker.tests.igniteCommonJavaOpts><![CDATA[
            --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED
            --add-exports=java.base/sun.nio.ch=ALL-UNNAMED
            --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED
            --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
            --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED
            --illegal-access=permit
            -XX:+UseG1GC
            -XX:+ParallelRefProcEnabled
            -XX:+UseStringDeduplication
            -XX:+ScavengeBeforeFullGC
            -XX:+DisableExplicitGC
            -XX:+AlwaysPreTouch
            -Dfile.encoding=UTF-8
            -Djava.net.preferIPv4Stack=true
            -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true
            -DIGNITE_QUIET=true
            -DIGNITE_NO_ASCII=true
            -DIGNITE_UPDATE_NOTIFIER=false
            -DIGNITE_JVM_PAUSE_DETECTOR_DISABLED=true
            -DIGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK=true
        ]]></docker.tests.igniteCommonJavaOpts>
        <docker.tests.repositoryCommonJavaOpts><![CDATA[
            ${docker.tests.igniteCommonJavaOpts}
            ${docker.tests.repositoryVersionSpecificJavaOpts}
            -Ddb.driver=org.postgresql.Driver
            -Ddb.username=alfresco
            -Ddb.password=alfresco
            -Ddb.url=jdbc:postgresql://postgres:5432/alfresco
            -Dsolr.host=search
            -Dsolr.port=${docker.tests.internalSearchPort}
            -Dsolr.secureComms=none
            -Dsolr.base.url=${docker.tests.searchBaseUrl}
            -Dindex.subsystem.name=${docker.tests.searchSubsystem}
            -Dcsrf.filter.enabled=false
            -D${moduleId}.caches.remoteSupport.enabled=true
            -D${moduleId}.core.storage.defaultStorageRegion.initialSize=268935456
            -D${moduleId}.core.storage.defaultStorageRegion.maxSize=536870912
            -Xms2g -Xmx2g
        ]]></docker.tests.repositoryCommonJavaOpts>
        <docker.tests.shareCommonJavaOpts><![CDATA[
            ${docker.tests.igniteCommonJavaOpts}
            -Xms512m -Xmx512m
        ]]></docker.tests.shareCommonJavaOpts>
        
        <!-- override the inherited default ports to align with ports we previously used -->
        <docker.tests.repositoryPort>8180</docker.tests.repositoryPort>
        <docker.tests.repositoryDebugPort>8185</docker.tests.repositoryDebugPort>
        <docker.tests.repositoryPort2>8280</docker.tests.repositoryPort2>
        <docker.tests.repositoryDebugPort2>8285</docker.tests.repositoryDebugPort2>
        <docker.tests.repositoryPort3>8380</docker.tests.repositoryPort3>
        <docker.tests.repositoryDebugPort3>8385</docker.tests.repositoryDebugPort3>

        <docker.tests.sharePort>8181</docker.tests.sharePort>
        <docker.tests.shareDebugPort>8186</docker.tests.shareDebugPort>
        <docker.tests.sharePort2>8281</docker.tests.sharePort2>
        <docker.tests.shareDebugPort2>8286</docker.tests.shareDebugPort2>
    </properties>

    <repositories>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.ignite</groupId>
                <artifactId>ignite-core</artifactId>
                <version>${apache.ignite.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.gridgain</groupId>
                        <artifactId>ignite-shmem</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.apache.ignite</groupId>
                <artifactId>ignite-web</artifactId>
                <version>${apache.ignite.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.tomcat</groupId>
                        <artifactId>tomcat-servlet-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.apache.ignite</groupId>
                <artifactId>ignite-slf4j</artifactId>
                <version>${apache.ignite.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>de.acosix.alfresco.utility</groupId>
                <artifactId>de.acosix.alfresco.utility.common</artifactId>
                <version>${acosix.utility.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>de.acosix.alfresco.utility</groupId>
                <artifactId>de.acosix.alfresco.utility.core.repo</artifactId>
                <version>${acosix.utility.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>de.acosix.alfresco.utility</groupId>
                <artifactId>de.acosix.alfresco.utility.core.repo</artifactId>
                <version>${acosix.utility.version}</version>
                <classifier>installable</classifier>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>de.acosix.alfresco.utility</groupId>
                <artifactId>de.acosix.alfresco.utility.core.share</artifactId>
                <version>${acosix.utility.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>de.acosix.alfresco.utility</groupId>
                <artifactId>de.acosix.alfresco.utility.core.share</artifactId>
                <version>${acosix.utility.version}</version>
                <classifier>installable</classifier>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.orderofthebee.support-tools</groupId>
                <artifactId>support-tools-repo</artifactId>
                <version>${ootbee.support-tools.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.orderofthebee.support-tools</groupId>
                <artifactId>support-tools-share</artifactId>
                <version>${ootbee.support-tools.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>de.thetaphi</groupId>
                    <artifactId>forbiddenapis</artifactId>
                    <configuration>
                        <failOnUnsupportedJava>false</failOnUnsupportedJava>
                        <failOnMissingClasses>false</failOnMissingClasses>
                        <failOnUnresolvableSignatures>false</failOnUnresolvableSignatures>
                        <bundledSignatures>
                            <bundledSignature>jdk-unsafe</bundledSignature>
                            <bundledSignature>jdk-deprecated</bundledSignature>
                            <bundledSignature>jdk-internal</bundledSignature>
                            <bundledSignature>jdk-system-out</bundledSignature>
                            <bundledSignature>jdk-non-portable</bundledSignature>
                            <!-- disabled (compared to inherited default) as we can't avoid setAccessible -->
                            <!-- 
                            <bundledSignature>jdk-reflection</bundledSignature>
                             -->
                        </bundledSignatures>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven.shade.version}</version>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

    <modules>
        <module>common</module>
        <module>repository</module>
        <module>repository-companion</module>
        <module>share</module>
    </modules>
    
    <profiles>
        <profile>
            <id>surefireSuppression</id>

            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <skipTests>true</skipTests>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>
