<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>org.apache.datasketches</groupId>
  <artifactId>datasketches-memory</artifactId>
  <version>3.0.2</version>
  <packaging>pom</packaging>

  <name>${project.artifactId}</name>
  <description>High-performance native memory access.</description>
  <url>https://datasketches.apache.org/</url>
  <inceptionYear>2015</inceptionYear>

  <mailingLists>
    <mailingList>
      <name>DataSketches Developers</name>
      <subscribe>dev-subscribe@datasketches.apache.org</subscribe>
      <unsubscribe>dev-unsubscribe@datasketches.apache.org</unsubscribe>
      <post>dev@datasketches.apache.org</post>
      <archive>https://mail-archives.apache.org/mod_mbox/datasketches-dev</archive>
    </mailingList>
    <mailingList>
      <name>sketches-user</name>
      <archive>https://groups.google.com/forum/#!forum/sketches-user</archive>
      <subscribe>mailto:sketches-user%2Bsubscribe@googlegroups.com</subscribe>
      <unsubscribe>mailto:sketches-user%2Bunsubscribe@googlegroups.com</unsubscribe>
      <post>mailto:sketches-user@googlegroups.com</post>
    </mailingList>
  </mailingLists>

  <scm>
    <connection>scm:git:ssh://git@github.com/apache/${project.artifactId}.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/apache/${project.artifactId}.git</developerConnection>
    <url>https://github.com/apache/${project.artifactId}</url>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <!-- <system>jira</system> --> 
    <!-- <url>https://issues.apache.org/jira/browse/DATASKETCHES</url> -->
    <system>GitHub</system>
    <url>https://github.com/apache/${project.artifactId}/issues</url>
  </issueManagement>

  <developers>
    <developer>
      <name>The Apache DataSketches Team</name>
      <email>dev@datasketches.apache.org</email>
      <url>https://datasketches.apache.org</url>
      <organization>Apache Software Foundation</organization>
      <organizationUrl>http://www.apache.org</organizationUrl>
    </developer>
  </developers>

  <!--
       NOTICE:
       The datasketches-memory submodule uses the Maven project-aggregation feature and does not inherit
       from this root module as a parent; so that there is no runtime dependency on the parent project (root module).
       As a result, some properties from this POM (including the version) are duplicated in the datasketches-memory
       module for inclusion in the assembled artifacts.  For more information, see:
       https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Aggregation -->


  <properties>
    <!-- Used for xxHash testing -->
    <zero-allocation-hashing.version>0.16</zero-allocation-hashing.version>

    <!-- Test -->
    <testng.version>7.5.1</testng.version>

    <!-- System-wide properties -->
    <maven.version>3.6.3</maven.version>
    <java.version>8</java.version>
    <jdk-toolchain.version>8</jdk-toolchain.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <argLine>-Xmx4g -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8</argLine>
    <charset.encoding>UTF-8</charset.encoding>
    <project.build.sourceEncoding>${charset.encoding}</project.build.sourceEncoding>
    <project.build.resourceEncoding>${charset.encoding}</project.build.resourceEncoding>
    <project.reporting.outputEncoding>${charset.encoding}</project.reporting.outputEncoding>

    <!--  org.apache.maven plugins -->
    <maven-assembly-plugin.version>3.7.1</maven-assembly-plugin.version>
    <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
    <maven-deploy-plugin.version>3.1.2</maven-deploy-plugin.version>
    <maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
    <maven-gpg-plugin.version>3.2.3</maven-gpg-plugin.version>
    <maven-install-plugin.version>3.0.0-M1</maven-install-plugin.version>
    <maven-jar-plugin.version>3.4.1</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
    <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
    <maven-remote-resources-plugin.version>3.2.0</maven-remote-resources-plugin.version>
    <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
    <maven-surefire-failsafe-plugin.version>3.2.5</maven-surefire-failsafe-plugin.version> <!-- for surefire, failsafe and surefire-report -->
    <maven-toolchains-plugin.version>3.2.0</maven-toolchains-plugin.version>
    <!-- com.github plugins -->
    <git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>
    <!-- org.apache.creadur plugins -->
    <apache-rat-plugin.version>0.16.1</apache-rat-plugin.version>
    <!-- org.eluder maven plugins -->
    <coveralls-repo-token></coveralls-repo-token>
    <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
    <!-- org.jacoco maven plugins -->
    <jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
    <!-- org.mojohaus plugins -->
    <versions-maven-plugin.version>2.16.2</versions-maven-plugin.version>
    <exec-maven-plugin.version>3.3.0</exec-maven-plugin.version>
    <!-- other -->
    <lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
    
    <maven.deploy.skip>true</maven.deploy.skip>
    <maven.install.skip>true</maven.install.skip>
    <maven.javadoc.skip>true</maven.javadoc.skip>
  </properties>

  <repositories>
    <repository>
      <id>apache.snapshots</id>
      <name>Apache Snapshot Repository</name>
      <url>https://repository.apache.org/content/groups/snapshots/org/apache/datasketches/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>apache</id>
      <name>Apache Releases Repository</name>
      <url>https://repository.apache.org/content/repositories/releases/org/apache/datasketches/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <!-- Used for xxHash testing -->
        <groupId>net.openhft</groupId>
        <artifactId>zero-allocation-hashing</artifactId>
        <version>${zero-allocation-hashing.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>${versions-maven-plugin.version}</version>
        </plugin>

        <plugin>
          <!-- We want to deploy the artifacts to a staging location for perusal -->
          <!-- Apache Parent pom: apache-release profile -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
          <executions>
            <execution>
              <id>default-jar</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
            <execution>
              <id>default-test-jar</id>
              <phase>package</phase>
              <goals>
                <goal>test-jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
          <configuration>
            <docfilessubdirs>true</docfilessubdirs>
            <doclint>none</doclint>
            <jdkToolchain>
              <version>${jdk-toolchain.version}</version>
            </jdkToolchain>
            <excludePackageNames>org.apache.datasketches.memory.internal</excludePackageNames>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${maven-enforcer-plugin.version}</version>
          <executions>
            <execution>
              <id>enforce-banned-dependencies</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireJavaVersion>
                    <version>[8,9),[11,12)</version>
                  </requireJavaVersion>
                  <requireMavenVersion>
                    <version>[${maven.version},)</version>
                  </requireMavenVersion>
                  <bannedDependencies>
                    <excludes>
                      <!--LGPL licensed library-->
                      <exclude>com.google.code.findbugs:annotations</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
                <fail>true</fail>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>${apache-rat-plugin.version}</version>
          <executions>
            <execution>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <outputDirectory>${project.basedir}/rat</outputDirectory>
            <consoleOutput>true</consoleOutput>
            <useDefaultExcludes>true</useDefaultExcludes>
            <excludes>
              <exclude>**/*.yaml</exclude>
              <exclude>**/*.yml</exclude>
              <exclude>**/toolchains.xml</exclude>
              <exclude>**/.*</exclude>
              <exclude>**/.clover/**/*</exclude>
              <exclude>**/test/resources/**/*.txt</exclude>
              <exclude>**/test-output/**/*</exclude>
              <exclude>**/img/**/*.png</exclude>
              <exclude>**/git.properties</exclude>
              <exclude>**/scripts/assets/LoremIpsum.txt</exclude>
              <exclude>LICENSE</exclude>
              <exclude>NOTICE</exclude>
            </excludes>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>package</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
            <execution>
              <id>attach-test-sources</id>
              <phase>package</phase>
              <goals>
                <goal>test-jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-failsafe-plugin.version}</version>
          <configuration>
            <trimStackTrace>false</trimStackTrace>
            <useManifestOnlyJar>false</useManifestOnlyJar>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
            <jdkToolchain>
              <version>${jdk-toolchain.version}</version>
            </jdkToolchain>
            <reportsDirectory>${project.build.directory}/test-output/${maven.build.timestamp}</reportsDirectory>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-toolchains-plugin</artifactId>
          <version>${maven-toolchains-plugin.version}</version>
          <configuration>
            <toolchains>
              <jdk>
                <version>[8,9),[11,12)</version>
              </jdk>
            </toolchains>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>toolchain</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <!-- Generates code coverage report from website. -->
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco-maven-plugin.version}</version>
          <executions>
            <execution>
              <id>default-prepare-agent</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <!-- Submit code coverage report to Coveralls.io. -->
          <groupId>org.eluder.coveralls</groupId>
          <artifactId>coveralls-maven-plugin</artifactId>
          <version>${coveralls-maven-plugin.version}</version>
          <configuration>
            <!--suppress UnresolvedMavenProperty -->
            <repoToken>${coveralls-repo-token}</repoToken>
            <!--suppress UnresolvedMavenProperty -->
            <jacocoReports>${maven.multiModuleProjectDirectory}/datasketches-memory-java8/target/site/jacoco/jacoco.xml</jacocoReports>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <jdkToolchain>
              <version>${jdk-toolchain.version}</version>
            </jdkToolchain>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>${exec-maven-plugin.version}</version>
        </plugin>

      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- Disable source release assembly for 'apache-release' profile.
             This is performed from a script outside Maven
    -->
    <profile>
      <id>apache-release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>${maven-assembly-plugin.version}</version>
            <executions>
              <execution>
                <id>source-release-assembly</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>only-eclipse</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-remote-resources-plugin</artifactId>
              <version>${maven-remote-resources-plugin.version}</version>
              <executions>
                <execution>
                  <id>process-resource-bundles</id>
                  <phase>none</phase>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

  </profiles>

  <!-- This Maven project is divided into an aggregator project (the root), that manages a group of submodules that
       inherit configuration from this root module.
       A multi-module project is used to target different version-specific features of the Java language APIs.
       Furthermore, it is a structure that is supported in most IDEs allowing minimal disruption to developers that
       contribute to this project -->
  <modules>
    <module>datasketches-memory-java8</module>
    <module>datasketches-memory-java11</module>
  </modules>

</project>