<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2015, Yahoo! Inc.
     Licensed under the terms of the Apache License 2.0.
     See LICENSE file at the project root for terms. -->

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.yahoo.datasketches</groupId>
    <artifactId>sketches-core</artifactId>
    <packaging>jar</packaging> <!-- jar is the default -->
    <version>0.11.1</version>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>Core sketch algorithms used alone and by other repositories in the DataSketches library.</description>
    <url>https://datasketches.github.io/</url>
    <inceptionYear>2015</inceptionYear>

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

    <developers>
        <developer>
            <name>DataSketchesDevelopers</name>
            <organization>DataSketches</organization>
            <organizationUrl>https://github.com/orgs/DataSketches/people</organizationUrl>
        </developer>
        <developer>
            <name>DataSketchesCollaborators</name>
            <organization>DataSketches</organization>
            <organizationUrl>https://github.com/orgs/DataSketches/outside-collaborators</organizationUrl>
        </developer>
    </developers>

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

    <properties>
        <!-- System-wide properties -->
        <argLine>-Xmx1024m -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>
        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        
        <!-- Dependencies -->
        <memory.version>0.10.3</memory.version>
        <testng.version>6.13.1</testng.version>
        
        <!-- Maven Plugins -->
        <maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>
        <maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>3.0.2</maven-dependency-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-help-plugin.version>2.2</maven-help-plugin.version>
        <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
        <maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
        <maven-shade-plugin.version>3.1.0</maven-shade-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version>
        
        <!-- Codehaus.org Plugins -->
        <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
        <license-maven-plugin.version>1.14</license-maven-plugin.version>
        <plexus-compiler-javac-errorprone.version>2.8.2</plexus-compiler-javac-errorprone.version>
        
        <!-- Jacoco.org Plugins -->
        <jacoco-maven-plugin.version>0.7.9</jacoco-maven-plugin.version>
        
        <!-- Sonatype.org Plugins -->
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        
        <!-- Versioneye.com Plugins -->
        <versioneye-maven-plugin.version>3.11.4</versioneye-maven-plugin.version>
    </properties>

    <prerequisites>
        <maven>3.0.4</maven>
    </prerequisites>

    <scm>
        <connection>scm:git:ssh://git@github.com/DataSketches/sketches-core.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/DataSketches/sketches-core.git</developerConnection>
        <url>https://github.com/DataSketches/sketches-core</url>
        <tag>sketches-core-0.11.1</tag>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/DataSketches/sketches-core/issues</url>
    </issueManagement>

    <ciManagement>
        <system>travis</system>
        <url>https://travis-ci.org/DataSketches/sketches-core</url>
    </ciManagement>

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

    <dependencies>
        <dependency>
            <groupId>com.yahoo.datasketches</groupId>
            <artifactId>memory</artifactId>
            <version>${memory.version}</version>
        </dependency>

        <!-- Test Scope -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>jcenter</id>
            <name>bintray</name>
            <url>https://jcenter.bintray.com</url>
        </repository>
    </repositories>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <relocations>
                                <relocation>
                                    <pattern>com.yahoo.memory</pattern>
                                    <shadedPattern>shaded.com.yahoo.memory</shadedPattern>
                                </relocation>
                            </relocations>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>with-shaded-memory</shadedClassifierName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                  <!--
                    <show>private</show>
                  -->
                  <stylesheetfile>src/main/javadoc/stylesheet.css</stylesheetfile>
                  <docfilessubdirs>true</docfilessubdirs>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

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

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus-staging</serverId> <!-- from ~/.m2/settings.xml -->
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <!-- Code coverage plugin, generates coverage report to target/site/jacoco/
                 To skip coverage generation add -Djacoco.skip=true -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

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

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>
                <!-- ORG.APACHE.MAVEN -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                </plugin>

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

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

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

                <plugin>
                    <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-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                </plugin>

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

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

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-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-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>

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

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

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

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

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

                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>com.versioneye</groupId>
                    <artifactId>versioneye-maven-plugin</artifactId>
                    <version>${versioneye-maven-plugin.version}</version>
                </plugin>

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

    <reporting />

    <profiles>
        <profile>
            <id>strict</id>
            <build>
                <pluginManagement>
                    <plugins>

                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <configuration>
                                <source>${maven.compiler.source}</source>
                                <target>${maven.compiler.target}</target>
                                <compilerId>javac-with-errorprone</compilerId>
                                <forceJavacCompilerUse>true</forceJavacCompilerUse>
                            </configuration>
                            <dependencies>
                                <dependency>
                                    <groupId>org.codehaus.plexus</groupId>
                                    <artifactId>plexus-compiler-javac-errorprone</artifactId>
                                    <version>${plexus-compiler-javac-errorprone.version}</version>
                                </dependency>
                            </dependencies>
                        </plugin>

                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>
