<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2014 Higher Frequency Trading
  ~
  ~ https://chronicle.software
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

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

    <groupId>net.openhft</groupId>
    <artifactId>root-parent-pom</artifactId>
    <version>1.25.1</version>
    <packaging>pom</packaging>

    <name>OpenHFT/Root Parent POM</name>
    <description>This root parent pom is used by all of OpenHft</description>
    <url>https://chronicle.software</url>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Peter Lawrey</name>
            <email>peter.lawrey@chronicle.software</email>
        </developer>
        <developer>
            <name>Rob Austin</name>
            <email>rob.austin@chronicle.software</email>
        </developer>
        <developer>
            <name>Roger Simmons</name>
            <email>roger.simmons@chronicle.software</email>
        </developer>
        <developer>
            <name>Jerry Shea</name>
            <email>jerry.shea@chronicle.software</email>
        </developer>
        <developer>
            <name>Ivan Rakov</name>
            <email>ivan.rakov@chronicle.software</email>
        </developer>
        <developer>
            <name>Per Minborg</name>
            <email>per.minborg@chronicle.software</email>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!--
            By default (on Java 8) ${jvm.requiredArgs} is an empty string, on other javas it will
            contain the arguments necessary to run the Chronicle libraries
        -->
        <jvm.requiredArgs />
    </properties>

    <build>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.12.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.13</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-publish-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>5.1.9</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.servicemix.tooling</groupId>
                    <artifactId>depends-maven-plugin</artifactId>
                    <version>1.5.0</version>
                </plugin>

                <plugin>
                    <groupId>com.google.code.maven-replacer-plugin</groupId>
                    <artifactId>replacer</artifactId>
                    <version>1.5.3</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.6.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.6.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>3.9.1.2184</version>
                </plugin>

                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.10</version>
                </plugin>

                <plugin>
                    <groupId>com.github.ferstl</groupId>
                    <artifactId>depgraph-maven-plugin</artifactId>
                    <version>4.0.2</version>
                    <configuration>
                        <classpathScope>compile</classpathScope>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>net.openhft</groupId>
                    <artifactId>binary-compatibility-enforcer-plugin</artifactId>
                    <version>1.0.13</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>

                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <useReleaseProfile>false</useReleaseProfile>
                </configuration>

            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <!--
                            Enforce minimum of maven 3.5.4
                        -->
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.5.4</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-no-snapshots</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireReleaseDeps>
                                    <message>No Snapshots Allowed!</message>
                                    <onlyWhenRelease>true</onlyWhenRelease>
                                </requireReleaseDeps>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!--
                Set argLine to include ${jvm.requiredArgs} (JVM args needed to run Chronicle libraries on the detected JVM)

                If a child POM wants to override the argLine, they must include ${jvm.requiredArgs}
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>@{argLine} ${jvm.requiredArgs}</argLine>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <profiles>
        <profile>
            <id>sign-artifact</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <configuration>
                            <gpgArguments>
                                <arg>--batch</arg>
                            </gpgArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>nexus-staging-maven-plugin</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-nexus-staging</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <stagingProfileId>9b582df0c3cb0</stagingProfileId>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <autoDropAfterRelease>true</autoDropAfterRelease>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>bundled-nexus-staging</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-nexus-staging</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java11</id>
            <activation>
                <jdk>[11,16]</jdk>
            </activation>
            <properties>
                <!-- Required JVM args for Java 11 -> 16 -->
                <jvm.requiredArgs>
                    --illegal-access=permit
                    --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
                    --add-exports java.base/jdk.internal.ref=ALL-UNNAMED
                    --add-exports java.base/jdk.internal.util=ALL-UNNAMED
                    --add-exports java.base/sun.nio.ch=ALL-UNNAMED
                </jvm.requiredArgs>
            </properties>
        </profile>
        <profile>
            <id>java17</id>
            <activation>
                <jdk>[17,</jdk>
            </activation>
            <properties>
                <!-- Required JVM args for Java 17+ -->
                <jvm.requiredArgs>
                    --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED
                    --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
                    --add-exports=java.base/jdk.internal.util=ALL-UNNAMED
                    --add-exports=java.base/sun.nio.ch=ALL-UNNAMED
                    --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
                    --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
                    --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
                    --add-opens=java.base/java.io=ALL-UNNAMED
                    --add-opens=java.base/java.lang=ALL-UNNAMED
                    --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
                    --add-opens=java.base/java.util=ALL-UNNAMED
                    --add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED
                </jvm.requiredArgs>
            </properties>
        </profile>
        <!--
            Only default argLine if it's not set. If we blanket default it, it can't be overriden!?
        -->
        <profile>
            <id>default-argLine</id>
            <activation>
                <property>
                    <name>!argLine</name>
                </property>
            </activation>
            <properties>
                <argLine />
            </properties>
        </profile>

        <profile>
            <id>notnull-instrumenter</id>
            <activation>
                <jdk>[,17]</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>se.eris</groupId>
                        <artifactId>notnull-instrumenter-maven-plugin</artifactId>
                        <version>1.1.1</version>
                        <executions>
                            <execution>
                                <id>instrument</id>
                                <goals>
                                    <goal>instrument</goal>
                                    <goal>tests-instrument</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <notNull>
                                <param>org.jetbrains.annotations.NotNull</param>
                                <param>javax.validation.constraints.NotNull</param>
                            </notNull>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

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

    </distributionManagement>

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

    <scm>
        <url>scm:git:git@github.com:OpenHFT/OpenHFT.git</url>
        <connection>scm:git:git@github.com:OpenHFT/OpenHFT.git</connection>
        <developerConnection>scm:git:git@github.com:OpenHFT/OpenHFT.git</developerConnection>
        <tag>root-parent-pom-1.25.1</tag>
    </scm>

</project>
