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

  <packaging>pom</packaging>

  <groupId>com.hotels.styx</groupId>
  <artifactId>styx-parent</artifactId>
  <version>1.0.0.beta3</version>
  <url>https://github.com/HotelsDotCom/styx</url>
  <name>Styx</name>

  <description>
    Programmable, asynchronous, event-based reverse proxy for JVM.
  </description>

  <inceptionYear>2013</inceptionYear>

  <organization>
    <name>Hotels.com</name>
    <url>http://www.hotels.com</url>
  </organization>

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

  <scm>
    <connection>scm:git:git@github.com:HotelsDotCom/styx.git</connection>
    <developerConnection>scm:git:git@github.com:HotelsDotCom/styx.git</developerConnection>
    <url>https://github.com/HotelsDotCom/styx</url>
    <tag>HEAD</tag>
  </scm>

  <developers>
    <developer>
      <id>styx.developers</id>
      <name>The Styx Project Committers</name>
      <url>https://github.com/orgs/HotelsDotCom/teams/styx-committers</url>
      <organization>Hotels.com</organization>
      <organizationUrl>https://github.com/HotelsDotCom</organizationUrl>
    </developer>
  </developers>

  <distributionManagement>
    <repository>
      <id>central</id>
      <name>libs-release</name>
      <url>${libs.release.url}</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <name>libs-snapshot</name>
      <url>${libs.snapshot.url}</url>
    </snapshotRepository>
    <site>
      <id>Styx-Site</id>
      <url>${site.url}</url>
    </site>
  </distributionManagement>

  <modules>
    <module>bom</module>
    <module>components</module>
    <module>support</module>
    <module>system-tests</module>
  </modules>

  <properties>

    <!-- common build properties -->
    <wiki.url>${project.url}</wiki.url>
    <maven.build.timestamp.format>yyyy-MM-dd|HH\:mm\:ss</maven.build.timestamp.format>
    <timestamp>${maven.build.timestamp}</timestamp>

    <build.timestamp>${maven.build.timestamp}</build.timestamp>
    <main.basedir>${project.basedir}</main.basedir>

    <release.label>STYX.${project.version}</release.label>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.source>1.8</java.source>
    <java.target>1.8</java.target>
    <java.testSource>1.8</java.testSource>
    <java.testTarget>1.8</java.testTarget>

    <!-- Build defaults to linux platform: -->
    <netty-tcnative.classifier>linux-x86_64</netty-tcnative.classifier>

    <!-- General Versions -->
    <guava.version>18.0</guava.version>
    <guice.version>3.0</guice.version>
    <jackson.version>2.9.7</jackson.version>
    <jackson.dataformat.version>2.5.1</jackson.dataformat.version>
    <jackson.module.scala.version>2.9.7</jackson.module.scala.version>
    <metrics.version>3.2.6</metrics.version>
    <antlr.version>4.5.1-1</antlr.version>
    <netty.version>4.1.15.Final</netty.version>
    <netty-tcnative.version>2.0.6.Final</netty-tcnative.version>
    <rxjava.version>1.1.6</rxjava.version>
    <reactive-streams.version>1.0.2</reactive-streams.version>
    <reactor.version>3.2.0.RELEASE</reactor.version>

    <!--Kotlin -->
    <kotlin.version>1.2.51</kotlin.version>
    <kotlin.compiler.incremental>true</kotlin.compiler.incremental>

    <java-uuid-generator.version>3.1.5</java-uuid-generator.version>

    <!-- Logging Versions -->
    <logback.version>1.1.2</logback.version>
    <slf4j.version>1.6.1</slf4j.version>

    <scala.version>2.12</scala.version>
    <scala-compiler.version>2.12.7</scala-compiler.version>

    <!-- Testing Versions -->
    <hamcrest.all.version>1.3</hamcrest.all.version>
    <mockito.version>1.9.5</mockito.version>
    <testng.version>6.8</testng.version>


    <scalatest.version>3.0.5</scalatest.version>
    <scalacheck.version>1.14.0</scalacheck.version>
    <scala.java8.compat.version>0.8.0</scala.java8.compat.version>

    <!-- apache plugin versions and configurations, please sort alphabetically -->
    <maven-antrun-plugin.version>1.7</maven-antrun-plugin.version>
    <maven-assembly-plugin.version>2.4</maven-assembly-plugin.version>
    <maven-checkstyle-plugin.version>2.16</maven-checkstyle-plugin.version>
    <maven-compiler-plugin.version>3.0</maven-compiler-plugin.version>
    <maven-dependency-plugin.version>2.8</maven-dependency-plugin.version>
    <maven-deploy-plugin.version>2.7</maven-deploy-plugin.version>
    <maven-enforcer-plugin.version>1.2</maven-enforcer-plugin.version>
    <maven-failsafe-plugin.version>2.13</maven-failsafe-plugin.version>
    <maven-install-plugin.version>2.5.1</maven-install-plugin.version>
    <maven-jar-plugin.version>2.4</maven-jar-plugin.version>
    <maven-pmd-plugin.version>3.5</maven-pmd-plugin.version>
    <maven-javadoc-plugin.version>3.0.0-M1</maven-javadoc-plugin.version>
    <maven-project-info-reports-plugin.version>2.6</maven-project-info-reports-plugin.version>
    <maven-release-plugin.version>2.4</maven-release-plugin.version>
    <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
    <maven-site-plugin.version>3.3</maven-site-plugin.version>
    <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
    <maven-surefire-plugin.version>2.19</maven-surefire-plugin.version>

    <!-- non apache plugin versions and configurations, please sort alphabetically -->
    <animal-sniffer-maven-plugin.version>1.0</animal-sniffer-maven-plugin.version>
    <build-helper-maven-plugin.version>1.9.1</build-helper-maven-plugin.version>
    <jacoco-maven-plugin.version>0.7.5.201505241946</jacoco-maven-plugin.version>

    <!-- code quality -->
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>

    <!-- The destination file for the code coverage report has to be set to the same value
      in the parent pom and in each module pom. Then JaCoCo will add up information in
      the same report, so that, it will give the cross-module code coverage. -->
    <sonar.jacoco.itReportPath>${project.build.directory}/jacoco-it.exec</sonar.jacoco.itReportPath>
    <sonar.language>java</sonar.language>

    <jacoco.classRatio>91</jacoco.classRatio>
    <jacoco.instructionRatio>80</jacoco.instructionRatio>
    <jacoco.methodRatio>90</jacoco.methodRatio>
    <jacoco.branchRatio>58</jacoco.branchRatio>
    <jacoco.complexityRatio>72</jacoco.complexityRatio>
    <jacoco.lineRatio>86</jacoco.lineRatio>
    <jacoco.excludes />

    <!-- Checkstyle -->
    <checkstyle.maxAllowedViolations>2</checkstyle.maxAllowedViolations>
    <checkstyle.basedir>codequality</checkstyle.basedir>
    <checkstyle.violationSeverity>error</checkstyle.violationSeverity>
    <checkstyle.skip>false</checkstyle.skip>

    <surefire.skip.tests>false</surefire.skip.tests>

    <netty-transport-native-epoll.classifier />
    <rxjava-reactive-streams.version>1.1.1</rxjava-reactive-streams.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.hotels.styx</groupId>
        <artifactId>styx-api</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.hotels.styx</groupId>
        <artifactId>styx-common</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.hotels.styx</groupId>
        <artifactId>styx-client</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.hotels.styx</groupId>
        <artifactId>styx-server</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.hotels.styx</groupId>
        <artifactId>styx-proxy</artifactId>
        <version>${project.version}</version>
      </dependency>

      <!-- Netty -->
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>${netty.version}</version>
      </dependency>

      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-transport-native-epoll</artifactId>
        <version>${netty.version}</version>
        <classifier>${netty-transport-native-epoll.classifier}</classifier>
      </dependency>

      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-tcnative-boringssl-static</artifactId>
        <version>${netty-tcnative.version}</version>
        <classifier>${netty-tcnative.classifier}</classifier>
      </dependency>

      <!-- RxJava -->
      <dependency>
        <groupId>io.reactivex</groupId>
        <artifactId>rxjava</artifactId>
        <version>${rxjava.version}</version>
      </dependency>

      <dependency>
        <groupId>io.reactivex</groupId>
        <artifactId>rxjava-reactive-streams</artifactId>
        <version>${rxjava-reactive-streams.version}</version>
      </dependency>

      <dependency>
        <groupId>org.reactivestreams</groupId>
        <artifactId>reactive-streams</artifactId>
        <version>${reactive-streams.version}</version>
      </dependency>

      <dependency>
        <groupId>io.projectreactor</groupId>
        <artifactId>reactor-core</artifactId>
        <version>${reactor.version}</version>
      </dependency>

      <dependency>
        <groupId>io.projectreactor</groupId>
        <artifactId>reactor-test</artifactId>
        <version>${reactor.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.uuid</groupId>
        <artifactId>java-uuid-generator</artifactId>
        <version>${java-uuid-generator.version}</version>
      </dependency>

      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-scala_${scala.version}</artifactId>
        <version>${jackson.module.scala.version}</version>
      </dependency>

      <!-- Metrics -->
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-core</artifactId>
        <version>${metrics.version}</version>
      </dependency>

      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-jvm</artifactId>
        <version>${metrics.version}</version>
      </dependency>

      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-json</artifactId>
        <version>${metrics.version}</version>
      </dependency>

      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-graphite</artifactId>
        <version>${metrics.version}</version>
      </dependency>

      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-healthchecks</artifactId>
        <version>${metrics.version}</version>
      </dependency>

      <dependency>
        <groupId>org.hdrhistogram</groupId>
        <artifactId>HdrHistogram</artifactId>
        <version>2.1.4</version>
      </dependency>

      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-runtime</artifactId>
        <version>${antlr.version}</version>
      </dependency>

      <!-- Logging -->
      <dependency>
        <artifactId>slf4j-api</artifactId>
        <groupId>org.slf4j</groupId>
        <version>${slf4j.version}</version>
        <scope>compile</scope>
      </dependency>

      <dependency>
        <artifactId>jul-to-slf4j</artifactId>
        <groupId>org.slf4j</groupId>
        <version>${slf4j.version}</version>
        <scope>compile</scope>
      </dependency>

      <dependency>
        <artifactId>logback-classic</artifactId>
        <groupId>ch.qos.logback</groupId>
        <version>${logback.version}</version>
      </dependency>

      <dependency>
        <artifactId>logback-core</artifactId>
        <groupId>ch.qos.logback</groupId>
        <version>${logback.version}</version>
      </dependency>

      <dependency>
        <groupId>org.codehaus.janino</groupId>
        <artifactId>janino</artifactId>
        <version>2.6.1</version>
      </dependency>

      <dependency>
        <groupId>org.codehaus.janino</groupId>
        <artifactId>commons-compiler</artifactId>
        <version>2.6.1</version>
      </dependency>

      <dependency>
        <groupId>org.scala-lang.modules</groupId>
        <artifactId>scala-java8-compat_${scala.version}</artifactId>
        <version>${scala.java8.compat.version}</version>
      </dependency>

      <!-- YAML -->

      <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-yaml</artifactId>
        <version>${jackson.dataformat.version}</version>
      </dependency>

      <!-- findbugs -->
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>2.0.1</version>
        <scope>provided</scope>
        <optional>true</optional>
      </dependency>

      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>annotations</artifactId>
        <version>2.0.1</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>com.hotels.styx</groupId>
        <artifactId>styx-testsupport</artifactId>
        <version>${project.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>com.hotels.styx</groupId>
        <artifactId>styx-api-testsupport</artifactId>
        <version>${project.version}</version>
        <scope>test</scope>
      </dependency>

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

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- Scala -->
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-compiler</artifactId>
        <version>${scala-compiler.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest_${scala.version}</artifactId>
        <version>${scalatest.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.scalacheck</groupId>
        <artifactId>scalacheck_${scala.version}</artifactId>
        <version>${scalacheck.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-actor_${scala.version}</artifactId>
        <version>2.5.17</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-testkit_${scala.version}</artifactId>
        <version>2.5.17</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>com.github.tomakehurst</groupId>
        <artifactId>wiremock</artifactId>
        <version>1.54</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit-dep</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib-jdk8</artifactId>
        <version>${kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-test</artifactId>
        <version>${kotlin.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>


  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.0.1</version>
        </plugin>
        <plugin>
          <groupId>org.jetbrains.kotlin</groupId>
          <artifactId>kotlin-maven-plugin</artifactId>
          <version>${kotlin.version}</version>
          <executions>
            <execution>
              <id>compile</id>
              <phase>compile</phase>
              <goals>
                <goal>compile</goal>
              </goals>
              <configuration>
              <sourceDirs>
                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                <sourceDir>${project.basedir}/src/main/java</sourceDir>
              </sourceDirs>
            </configuration>

            </execution>
            <execution>
              <id>test-compile</id>
              <phase>test-compile</phase>
              <goals>
                <goal>test-compile</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <jvmTarget>1.8</jvmTarget>
            <sourceDirs>
              <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
              <sourceDir>${project.basedir}/src/test/java</sourceDir>
            </sourceDirs>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.3</version>
          <configuration>
            <source>${java.source}</source>
            <target>${java.target}</target>
            <!--<showDeprecation>true</showDeprecation>-->
            <!--<showWarnings>true</showWarnings>-->
            <!--<compilerArgument>-Xlint:all</compilerArgument>-->
          </configuration>
          <executions>
            <!-- Replacing default-compile as it is treated specially by maven -->
            <execution>
              <id>default-compile</id>
              <phase>none</phase>
            </execution>
            <!-- Replacing default-testCompile as it is treated specially by maven -->
            <execution>
              <id>default-testCompile</id>
              <phase>none</phase>
            </execution>
            <execution>
              <id>java-compile</id>
              <phase>compile</phase>
              <goals> <goal>compile</goal> </goals>
            </execution>
            <execution>
              <id>java-test-compile</id>
              <phase>test-compile</phase>
              <goals> <goal>testCompile</goal> </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>net.alchim31.maven</groupId>
          <artifactId>scala-maven-plugin</artifactId>
          <version>3.2.1</version>
          <executions>
            <execution>
              <id>scala-compile-first</id>
              <phase>process-resources</phase>
              <goals>
                <goal>add-source</goal>
                <goal>compile</goal>
              </goals>
            </execution>
            <execution>
              <id>scala-test-compile</id>
              <phase>process-test-resources</phase>
              <goals>
                <goal>testCompile</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <scalaVersion>${scala-compiler.version}</scalaVersion>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.antlr</groupId>
          <artifactId>antlr4-maven-plugin</artifactId>
          <version>${antlr.version}</version>
          <executions>
            <execution>
              <id>antlr4</id>
              <goals>
                <goal>antlr4</goal>
              </goals>
              <configuration>
                <arguments>
                  <argument>-visitor</argument>
                </arguments>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
          <configuration>
            <skipTests>${surefire.skip.tests}</skipTests>
            <argLine>
              -Xmx300m
              -XX:+HeapDumpOnOutOfMemoryError
              -XX:HeapDumpPath=${project.build.directory}/surefire-reports
            </argLine>
            <forkCount>1</forkCount>
            <reuseForks>true</reuseForks>
          </configuration>
        </plugin>


        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven-failsafe-plugin.version}</version>
          <configuration>
            <forkMode>always</forkMode>
            <argLine>
              -Xmx300m
              -XX:+HeapDumpOnOutOfMemoryError
              -XX:HeapDumpPath=${project.build.directory}/failsafe-reports
            </argLine>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
            <execution>
              <id>failsafe-integration-tests</id>
              <phase>integration-test</phase>
              <goals>
                <goal>integration-test</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.scalatest</groupId>
          <artifactId>scalatest-maven-plugin</artifactId>
          <version>1.0</version>
        </plugin>

        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>${maven-antrun-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.ant</groupId>
              <artifactId>ant-launcher</artifactId>
              <version>1.8.0</version>
            </dependency>
          </dependencies>
        </plugin>

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

        <!-- CODE COVERAGE -->
        <plugin>
          <!-- jacoco: see http://www.eclemma.org/jacoco/trunk/doc/check-mojo.html -->
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco-maven-plugin.version}</version>
          <executions>
            <execution>
              <id>prepare-agent</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>report</id>
              <phase>prepare-package</phase>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
            <execution>
              <id>check</id>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <rules>
                  <rule>
                    <element>BUNDLE</element>
                    <limits>
                      <limit>
                        <counter>INSTRUCTION</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>0.72</minimum>
                      </limit>
                      <limit>
                        <counter>COMPLEXITY</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>0.64</minimum>
                      </limit>
                      <limit>
                        <counter>LINE</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>0.75</minimum>
                      </limit>
                      <limit>
                        <counter>CLASS</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>0.88</minimum>
                      </limit>
                      <limit>
                        <counter>METHOD</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>0.73</minimum>
                      </limit>
                      <limit>
                        <counter>BRANCH</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>0.60</minimum>
                      </limit>
                      <limit>
                        <counter>CLASS</counter>
                        <value>MISSEDCOUNT</value>
                        <maximum>80</maximum>
                      </limit>
                    </limits>
                  </rule>
                </rules>
                <includes>
                  <include>com/hotels/styx/**</include>
                </includes>
                <haltOnFailure>false</haltOnFailure>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>animal-sniffer-maven-plugin</artifactId>
          <configuration>
            <signature>
              <groupId>org.codehaus.mojo.signature</groupId>
              <artifactId>java17</artifactId>
              <version>${animal-sniffer-maven-plugin.version}</version>
            </signature>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${build-helper-maven-plugin.version}</version>
        </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>verify</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <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-install-plugin</artifactId>
          <version>${maven-install-plugin.version}</version>
          <configuration>
            <skip>false</skip>
          </configuration>
        </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-resources-plugin</artifactId>
          <version>${maven-resources-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
          <configuration>
            <doclint>none</doclint>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven-enforcer-plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-environment</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <fail>true</fail>
              <rules>
                <requireMavenVersion>
                  <version>[3.2.1,)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[1.8,)</version>
                  <message>java 1.8 needed</message>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>

          <execution>
            <id>enforce-dependencies</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <fail>true</fail>
              <rules>
                <bannedDependencies>
                  <searchTransitive>true</searchTransitive>
                  <excludes>
                    <!--
                    Conflicts with slf4j.
                    -->
                    <!--<exclude>commons-logging:*</exclude>-->

                    <!--
                    Security hazard: osvdb-68314
                    -->
                    <exclude>xmlrpc:*</exclude>

                    <!--
                    Ban apis which are part of Java 6.
                    -->
                    <exclude>*:activation</exclude>
                    <exclude>*:stax-api</exclude>
                    <exclude>*:jaxb-api</exclude>
                    <exclude>*:xml-apis</exclude>

                    <!--
                    Ban junit which includes old, or improper hamcrest.
                    -->
                    <exclude>junit:junit:(,4.10]</exclude>
                    <exclude>junit:junit-dep</exclude>

                    <!--
                    Ban uber mockito.
                    -->
                    <!--<exclude>org.mockito:mockito-all</exclude>-->

                    <!--
                    Ban hamcrest so we can require compatible version (see includes).
                    -->
                    <exclude>org.hamcrest:*</exclude>

                    <!--
                    Ban uber hamcrest.
                    -->
                    <exclude>org.hamcrest:hamcrest-all:*</exclude>

                  </excludes>

                  <!--
                  Exceptions to excludes.
                  -->
                  <includes>
                    <!--
                    Allow hamcrest 1.3
                    -->
                    <include>org.hamcrest:*:1.3</include>
                  </includes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>${maven-site-plugin.version}</version>
        <dependencies>
          <dependency>
            <groupId>org.kohsuke</groupId>
            <artifactId>doxia-module-markdown</artifactId>
            <version>1.0</version>
          </dependency>
          <dependency>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ssh</artifactId>
            <version>1.0</version>
          </dependency>
        </dependencies>
      </plugin>

      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <header>file:///${main.basedir}/src/license/templates/APACHE-2.txt</header>
          <headerDefinitions>
            <headerDefinition>file:///${main.basedir}/src/license/header-definitions.xml</headerDefinition>
          </headerDefinitions>
          <properties>
            <owner>Expedia Inc.</owner>
            <currentYear>${current.year}</currentYear>
          </properties>
          <excludes>
            <exclude>**/README</exclude>
            <exclude>src/test/resources/**</exclude>
            <exclude>src/main/resources/**</exclude>
            <exclude>**/*.xml</exclude>
            <exclude>**/*.yaml</exclude>
            <exclude>**/*.yml</exclude>
            <exclude>**/*.md</exclude>
            <exclude>**/*.txt</exclude>
            <exclude>**/*.css</exclude>
            <exclude>**/Dockerfile</exclude>
            <exclude>default.properties</exclude>
            <exclude>**/GraphiteReporter.java</exclude>
            <exclude>**/ServerCookieEncoder.java</exclude>
            <exclude>**/MultithreadedStressTester.java</exclude>
            <exclude>**/RelationshipTester.java</exclude>
            <exclude>**/EqualsTester.java</exclude>
            <exclude>**/URLEncoder.java</exclude>
            <exclude>**/DeltaQueue.java</exclude>
          </excludes>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin-git</artifactId>
            <version>3.0</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <goals>
              <goal>format</goal>
            </goals>
            <phase>process-sources</phase>
          </execution>
        </executions>
      </plugin>

    </plugins>

  </build>

  <profiles>
    <!-- profile for linux -->
    <profile>
      <id>linux</id>
      <properties>
        <netty-transport-native-epoll.classifier>linux-x86_64</netty-transport-native-epoll.classifier>
        <netty-tcnative.classifier>linux-x86_64</netty-tcnative.classifier>
      </properties>
    </profile>

    <!-- profile for mac os -->
    <profile>
      <id>macosx</id>
      <properties>
        <netty-tcnative.classifier>osx-x86_64</netty-tcnative.classifier>
      </properties>
    </profile>

    <profile>
      <id>release</id>
      <modules>
        <module>distribution</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>quality</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <forkMode>always</forkMode>
              <argLine>
                -Xmx300m
                -XX:+HeapDumpOnOutOfMemoryError
                -XX:HeapDumpPath=${project.build.directory}/failsafe-reports
                ${argLine}
              </argLine>
              <excludes>
                <exclude>**/Abstract*</exclude>
                <exclude>**/*$*</exclude>
              </excludes>
            </configuration>
          </plugin>

          <!--CHECKSTYLE-->
          <plugin>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>${maven-checkstyle-plugin.version}</version>
            <dependencies>
              <dependency>
                <groupId>com.puppycrawl.tools</groupId>
                <artifactId>checkstyle</artifactId>
                <version>6.9</version>
              </dependency>
            </dependencies>
            <configuration>
              <configLocation>${checkstyle.basedir}/checkstyle_rules.xml</configLocation>
              <suppressionsLocation>${checkstyle.basedir}/checkstyle_suppressions.xml</suppressionsLocation>
              <excludes>config/sun_checks.xml</excludes>
              <maxAllowedViolations>${checkstyle.maxAllowedViolations}</maxAllowedViolations>
              <skip>${checkstyle.skip}</skip>
              <violationSeverity>${checkstyle.violationSeverity}</violationSeverity>
              <consoleOutput>true</consoleOutput>
              <failOnViolation>true</failOnViolation>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- PMD -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>${maven-pmd-plugin.version}</version>
            <configuration>
              <targetJdk>${java.target}</targetJdk>
              <aggregate>true</aggregate>
              <format>xml</format>
              <!-- CPD options -->
              <minimumTokens>20</minimumTokens>
              <!--<ignoreIdentifiers>true</ignoreIdentifiers>-->
              <failOnViolation>true</failOnViolation>
              <failurePriority>2</failurePriority>
            </configuration>
          </plugin>

          <!-- JACOCO -->
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
          </plugin>

        </plugins>
      </build>
    </profile>
    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <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-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <properties>
        <libs.release.url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</libs.release.url>
        <libs.snapshot.url>https://oss.sonatype.org/content/repositories/snapshots/</libs.snapshot.url>
      </properties>
    </profile>
  </profiles>

</project>
