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

    <groupId>org.greencheek.caching</groupId>
    <artifactId>herdcache</artifactId>
    <version>1.0.32</version>
    <packaging>jar</packaging>

    <name>herdcache</name>
    <description>A cache that uses futures to prevent thundering herds to your backend service</description>
    <url>https://github.com/tootedom/herdcache</url>
    <!-- Required: license information: -->
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <!-- Required: developer information: -->
    <developers>
        <developer>
            <id>tootedom</id>
            <name>Dominic Tootell</name>
            <email>dominic.tootell@gmail.com</email>
            <organization>greencheek.org</organization>
            <organizationUrl>https://github.com/tootedom</organizationUrl>
            <url>https://github.com/tootedom</url>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git@github.com:tootedom/herdcache.git</connection>
        <url>scm:git:git@github.com:tootedom/herdcache.git</url>
        <developerConnection>scm:git:git@github.com:tootedom/herdcache.git</developerConnection>
        <tag>herdcache-1.0.32</tag>
    </scm>

    <properties>
        <maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
        <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
        <maven-assembly-plugin.version>2.4</maven-assembly-plugin.version>
        <maven-jar-plugin.version>2.4</maven-jar-plugin.version>
        <scala-maven-plugin.version>3.1.6</scala-maven-plugin.version>
        <maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
        <maven-release-plugin.version>2.3.2</maven-release-plugin.version>
        <maven-license-plugin.version>1.10.b1</maven-license-plugin.version>
        <maven-plugin-plugin.version>3.2</maven-plugin-plugin.version>
        <maven-shade-plugin.version>2.2</maven-shade-plugin.version>
        <maven-site-plugin.version>3.3</maven-site-plugin.version>
        <logback.version>1.1.1</logback.version>

        <guava.version>18.0</guava.version>
        <concurrentlinkedhashmap.version>1.4.2</concurrentlinkedhashmap.version>

        <hystrix.version>1.4.5</hystrix.version>
        <spy.version>2.12.0</spy.version>
        <jsr666e.version>1.1.0</jsr666e.version>
        <slf4j.version>1.7.12</slf4j.version>
        <memcachedtest.version>1.0.0</memcachedtest.version>
        <xxhashing.version>1.3.0</xxhashing.version>
        <jsnappy.version>1.1.1.7</jsnappy.version>
        <logback.version>1.1.3</logback.version>
        <junit.version>4.11</junit.version>
        <netty.version>4.0.30.Final</netty.version>
        <fst.version>1.63</fst.version>
        <jmh.version>1.10.4</jmh.version>
        <metrics.version>3.1.0</metrics.version>
    </properties>
    <dependencies>
        <!--<dependency>-->
            <!--<groupId>redis.clients</groupId>-->
            <!--<artifactId>jedis</artifactId>-->
            <!--<version>2.6.2</version>-->
            <!--<type>jar</type>-->
            <!--<scope>compile</scope>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>org.rarefiedredis.redis</groupId>-->
            <!--<artifactId>redis-java</artifactId>-->
            <!--<version>0.0.14</version>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>com.github.kstyrc</groupId>-->
            <!--<artifactId>embedded-redis</artifactId>-->
            <!--<version>0.6</version>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
            <version>${metrics.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
            <version>1.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
            <artifactId>concurrentlinkedhashmap-lru</artifactId>
            <version>${concurrentlinkedhashmap.version}</version>
        </dependency>
        <dependency>
            <groupId>com.netflix.hystrix</groupId>
            <artifactId>hystrix-core</artifactId>
            <version>${hystrix.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.spy</groupId>
            <artifactId>spymemcached</artifactId>
            <version>${spy.version}</version>
        </dependency>
        <dependency>
            <groupId>com.twitter</groupId>
            <artifactId>jsr166e</artifactId>
            <version>${jsr666e.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>net.jpountz.lz4</groupId>
            <artifactId>lz4</artifactId>
            <version>${xxhashing.version}</version>
        </dependency>
        <dependency>
            <groupId>org.xerial.snappy</groupId>
            <artifactId>snappy-java</artifactId>
            <version>${jsnappy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.iq80.snappy</groupId>
            <artifactId>snappy</artifactId>
            <version>0.4</version>
        </dependency>
        <dependency>
            <groupId>de.ruedigermoeller</groupId>
            <artifactId>fst</artifactId>
            <version>${fst.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-all</artifactId>
            <version>${netty.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.spotify</groupId>
            <artifactId>folsom</artifactId>
            <version>0.7.1</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty</artifactId>
            <version>3.9.2.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.thimbleware.jmemcached</groupId>
            <artifactId>jmemcached-core</artifactId>
            <version>${memcachedtest.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.netty</groupId>
                    <artifactId>netty</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-core</artifactId>
            <version>${jmh.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-generator-annprocess</artifactId>
            <version>${jmh.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.5.201505241946</version>
                <executions>
                    <!--
                       Prepares the property pointing to the JaCoCo runtime agent which
                       is passed as VM argument when Maven the Surefire plugin is executed.
                   -->
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <destFile>${project.build.directory}/jacoco-ut.exec</destFile>
                            <!--
                               Sets the name of the property containing the settings
                               for JaCoCo runtime agent.
                           -->
                            <propertyName>surefireArgLine</propertyName>
                            <excludes>
                                <exclude>**com.github.benmanes.caffeine*</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <!--
                       Ensures that the code coverage report for unit tests is created after
                       unit tests have been run.
                   -->
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>**/*IT</exclude>
                            </excludes>

                            <!-- Sets the path to the file which contains the execution data. -->
                            <dataFile>${project.build.directory}/jacoco-ut.exec</dataFile>
                            <!-- Sets the output directory for the code coverage report. -->
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <compilerVersion>1.8</compilerVersion>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.1.2</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-io</artifactId>
                        <version>1.0.1</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <useStandardDocletOptions>true</useStandardDocletOptions>
                    <show>public</show>
                    <charset>UTF-8</charset>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                    <breakiterator>true</breakiterator>
                    <version>true</version>
                    <author>true</author>
                    <keywords>true</keywords>
                    <excludePackageNames>org.osgi.framework.*,com.googlecode.*</excludePackageNames>
                    <links>
                        <link>http://docs.oracle.com/javase/8/docs/api/</link>
                    </links>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${maven-assembly-plugin.version}</version>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <reuseForks>true</reuseForks>
                    <forkCount>2C</forkCount>
                    <!--<parallel>classes</parallel>-->
                    <!--<useUnlimitedThreads>true</useUnlimitedThreads>-->
                    <!--
                    Sets the VM argument line used when unit tests are run.
                    Set by jacoco
                     -->
                    <argLine>${surefireArgLine} -Dio.netty.leakDetectionLevel=paranoid -Dnet.spy.log.LoggerImpl=net.spy.memcached.compat.log.SLF4JLogger -server -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=settings=profile -XX:FlightRecorderOptions=defaultrecording=true,settings=profile,disk=true,repository=target/jfr,maxsize=1g,dumponexit=true,dumponexitpath=target/jfr</argLine>
                    <!-- Skips unit tests if the value of skip.unit.tests property is true -->
                    <skipTests>${skip.unit.tests}</skipTests>
                    <!-- Excludes integration tests when unit tests are run. -->
                    <excludes>
                        <exclude>**/IT*.java</exclude>
                    </excludes>

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

                    <!-- Automated passphrase entry: -->

                    <!-- To pass your passphrase to the build automatically, so avoiding
                        manual interaction, you'll need to put the passphrase into settings.xml.
                        You don't really want that to be in plain text, so you'll want to follow:
                        http://maven.apache.org/guides/mini/guide-encryption.html -->
                    <!-- <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments> -->

                    <!-- Manual passphrase entry: -->

                    <!-- This is the simplest secure solution, but requires you to type
                        your key passphrase in manually when performing a release. No biggie unless
                        you want your CI server to decide when to release for you. -->
                    <mavenExecutorId>forked-path</mavenExecutorId>

                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.1</version>
            </plugin>

            <!-- JMH Here: -->


            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>process-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/src/performance-test/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/performance-test/assembly/test-jar-with-dependencies.xml</descriptor>
                    </descriptors>
                    <archive>
                        <manifest>
                            <mainClass>org.greencheek.caching.herdcache.perf.runner.BenchmarkRunner</mainClass>
                        </manifest>
                    </archive>
                    <finalName>performancetests</finalName>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <distributionManagement>
        <!-- You'll probably want to test this out with a local copy of Nexus OSS. -->
        <!-- Remove these entries and uncomment the Sonatype Nexus repositories
            below when you actually want to release. -->
        <!--
        <snapshotRepository>
            <id>localhost-nexus-snapshots</id>
            <name>Local Nexus snapshot repository</name>
            <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>localhost-nexus-staging</id>
            <name>Local Nexus release repository</name>
            <url>http://localhost:8081/nexus/content/repositories/releases/</url>
        </repository>
        -->
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus snapshot repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus release repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>
    <profiles>
        <!-- GPG Signature on release -->
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>