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

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.basepom</groupId>
    <artifactId>basepom-minimal</artifactId>
    <version>27</version>
    <relativePath />
  </parent>

  <groupId>com.opentable</groupId>
  <artifactId>otj-parent-spring</artifactId>
  <packaging>pom</packaging>
  <version>174</version>
  <name>OpenTable Spring base pom</name>

  <description>This is the Base POM for internal OpenTable Spring Maven projects.</description>

  <properties>
    <!-- tweak basepom settings -->
    <basepom.check.skip-checkstyle>${basepom.check.skip-extended}</basepom.check.skip-checkstyle>
    <basepom.check.checkstyle-severity>warning</basepom.check.checkstyle-severity>
    <dep.plugin.dependency-versions-check.version>2.0.2</dep.plugin.dependency-versions-check.version>

    <project.build.generated-resources>${basedir}/target/generated-resources</project.build.generated-resources>

    <basepom.release.push-changes>true</basepom.release.push-changes>
    <basepom.test.timeout>600</basepom.test.timeout>
    <basepom.test.fork-count>0.5C</basepom.test.fork-count>

    <!-- basepom-oss picks -->
    <!-- License checker for OSS deployments. -->
    <basepom.check.skip-license>${basepom.check.skip-extended}</basepom.check.skip-license>
    <basepom.check.fail-license>${basepom.check.fail-extended}</basepom.check.fail-license>
    <!-- Some plugins can run early ("validate") or late ("verify") -->
    <basepom.check.phase-license>validate</basepom.check.phase-license> <!-- this is overriding basepom default -->
    <basepom.license.skip-existing>true</basepom.license.skip-existing>
    <!-- release profiles -->
    <basepom.release.profiles>basepom.oss-release,oss-build</basepom.release.profiles>

    <!-- Plugin versions, ordered like http://maven.apache.org/plugins/ -->
    <dep.plugin.gpg.version>1.6</dep.plugin.gpg.version>
    <!-- https://github.com/mycila/license-maven-plugin/releases -->
    <dep.plugin.license.version>2.11</dep.plugin.license.version>

    <dep.plugin.build-helper.version>3.0.0</dep.plugin.build-helper.version>
    <dep.plugin.echo.version>1.2.0</dep.plugin.echo.version>
    <!--
      Findbugs is no longer enabled by default, but the dependencies of findbugs-annotations, etc is still supported
      and child poms may reference this value
    -->
    <dep.findbugs.version>3.0.1</dep.findbugs.version>
    <!-- They often don't release in lockstep sigh -->
    <dep.plugin.spotbugs.version>3.1.7</dep.plugin.spotbugs.version>
    <dep.spotbugs.version>${dep.plugin.spotbugs.version}</dep.spotbugs.version>
    <!-- PMD versions -->
    <dep.plugin.pmd.ruleset.version>1.2.3</dep.plugin.pmd.ruleset.version>

    <!-- Dependency Versions -->
    <dep.spring.version>5.0.7.RELEASE</dep.spring.version>
    <dep.spring-boot.version>2.0.3.RELEASE</dep.spring-boot.version>
    <dep.spring-security.version>5.0.6.RELEASE</dep.spring-security.version>

    <!-- logging versions -->
    <dep.logback.version>1.2.3</dep.logback.version>
    <dep.slf4j.version>1.7.25</dep.slf4j.version>
    <dep.otj-otl.version>0.8.7</dep.otj-otl.version>

    <dep.scala.version>2.12.6</dep.scala.version>

    <!-- validator implementation -->
    <dep.validator.version>6.0.11.Final</dep.validator.version>
    <dep.el.version>3.0.1-b09</dep.el.version>

    <!-- http versions -->
    <dep.jetty.version>9.4.12.v20180830</dep.jetty.version>
    <dep.resteasy.version>4.0.0.Beta5</dep.resteasy.version>

    <!-- instrumentation versions -->
    <!--
      NB: There is a related version in otj-metrics for
      com.ryantenney.metrics:metrics-spring.
    -->
    <dep.metrics.version>3.1.2</dep.metrics.version>

    <!-- library versions -->
    <dep.jackson.version>2.9.7</dep.jackson.version>
    <dep.kafka.version>1.1.1</dep.kafka.version>
    <dep.jdbi3.version>3.5.1</dep.jdbi3.version>
    <dep.bytebuddy.version>1.8.13</dep.bytebuddy.version>
    <dep.flyway.version>5.0.7</dep.flyway.version>
    <dep.asm.version>5.2</dep.asm.version>
    <dep.javamail.version>1.4.5</dep.javamail.version>
    <dep.snakeyaml.version>1.19</dep.snakeyaml.version>
    <dep.jna.version>4.5.1</dep.jna.version>
    <dep.guava.version>23.5-jre</dep.guava.version>
    <dep.hikari.version>3.2.0</dep.hikari.version>

    <!-- OT module dependency versions -->
    <dep.otj-rest-template.version>1.0.8</dep.otj-rest-template.version>
    <dep.otj-sql.version>2.3.0</dep.otj-sql.version>
    <dep.otj-logging.version>2.7.5</dep.otj-logging.version>
    <dep.otj-jaxrs.version>2.9.2</dep.otj-jaxrs.version>
    <dep.otj-spring.version>1.3.2</dep.otj-spring.version>
    <dep.otj-server.version>2.12.5</dep.otj-server.version>
    <dep.discovery.version>0.99.73</dep.discovery.version>
    <dep.otj-metrics.version>2.6.11</dep.otj-metrics.version>
    <dep.otj-kafka.version>2.8.3</dep.otj-kafka.version>
    <dep.otj-jackson.version>2.1.3</dep.otj-jackson.version>

    <!-- Conditional bans -->
    <ot.build.allow-spring>true</ot.build.allow-spring>
    <ot.build.allow-guice>false</ot.build.allow-guice>
    <ot.build.allow-resteasy>true</ot.build.allow-resteasy>
    <ot.build.allow-joda-time>false</ot.build.allow-joda-time>
    <!-- https://medium.com/@cowtowncoder/on-jackson-cves-dont-panic-here-is-what-you-need-to-know-54cd0d6e8062 -->
    <ot.build.allow-codehaus-jackson>false</ot.build.allow-codehaus-jackson>
    <ot.build.allow-jersey>false</ot.build.allow-jersey>
    <ot.build.allow-apache-httpclient>true</ot.build.allow-apache-httpclient>
    <ot.build.allow-spring-security-oauth2>false</ot.build.allow-spring-security-oauth2>

    <!-- hic sunt dracones -->
    <ot.build.allow-circular-dependencies>false</ot.build.allow-circular-dependencies>

    <!-- enable otpl to be used in sub-directories -->
    <otpl.project.dir>${basedir}</otpl.project.dir>

    <!-- allow to override docker TAG -->
    <otpl.docker.tag>${project.build.finalName}</otpl.docker.tag>
  </properties>

  <build>
    <!-- Make the artifacts contain the build number for snapshot builds. -->
    <finalName>${ot.build.name}</finalName>

    <resources>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
      </resource>
      <resource>
        <directory>${basedir}/src/main/java</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>${project.build.generated-resources}</directory>
      </resource>
    </resources>

    <testResources>
      <testResource>
        <directory>${basedir}/src/test/resources</directory>
      </testResource>
      <testResource>
        <directory>${basedir}/src/test/java</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </testResource>
    </testResources>

    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions combine.children="append">
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <versionRange>[0,)</versionRange>
                    <goals>
                      <goal>enforce</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>com.ning.maven.plugins</groupId>
                    <artifactId>maven-dependency-versions-check-plugin</artifactId>
                    <versionRange>[0,)</versionRange>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>com.nesscomputing.mojo</groupId>
                    <artifactId>numbers-maven-plugin</artifactId>
                    <versionRange>[0,)</versionRange>
                    <goals>
                      <goal>get</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <versionRange>[0,)</versionRange>
                    <goals>
                      <goal>revision</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <versionRange>[0,)</versionRange>
                    <goals>
                      <goal>analyze-dep-mgt</goal>
                      <goal>analyze-duplicate</goal>
                      <goal>analyze-only</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>com.ning.maven.plugins</groupId>
                    <artifactId>maven-duplicate-finder-plugin</artifactId>
                    <versionRange>[0,)</versionRange>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>

        <!--
            MAVEN-ENFORCER-PLUGIN (The Loving Iron Fist of Maven™)
            Global banhammer

            Why?  These artifacts are considered hazardous to your health.  Each has its own rationale,
            descibed below inline.
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${dep.plugin.enforcer.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>extra-enforcer-rules</artifactId>
              <version>1.0-beta-6</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>default</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${basepom.check.skip-enforcer}</skip>
                <fail>${basepom.check.fail-enforcer}</fail>
                <rules>
                  <bannedDependencies>
                    <!-- Now here is an arcane trick. See http://www.sonatype.com/people/2007/06/how-to-merge-sub-items-from-parent-pom-to-child-pom-in-a-maven-plugin-configuration-2/ for details... -->
                    <excludes combine.children="append">
                      <!-- clashes with commons-logging:commons-logging -->
                      <exclude>commons-logging:commons-logging-api</exclude>
                      <!-- replaced by org.apache.httpcomponents -->
                      <exclude>commons-httpclient</exclude>
                      <!-- logback implements slf4j directly.  No need for slf4j -->
                      <exclude>org.slf4j:slf4j</exclude>
                      <!-- slf4j-simple only allowed for tests -->
                      <exclude>org.slf4j:slf4j-simple:*:*:compile</exclude>
                      <!-- We don't use log4j, use log4j-over-slf4j instead -->
                      <exclude>org.slf4j:slf4j-log4j12</exclude>
                      <!-- junit-dep used to avoid a classless repackaging, but it is now obsoleted -->
                      <exclude>junit:junit-dep</exclude>

                      <!-- No Ness components, port them over. -->
                      <exclude>ness.components:*</exclude>
                      <exclude>com.nesscomputing.components:*</exclude>
                      <exclude>com.nesscomputing.testing:*</exclude>
                      <!-- Trumpet was the code-name for Ness, don't allow that to creep in. -->
                      <exclude>io.trumpet.components:*</exclude>

                      <!-- use Spring JMX instead -->
                      <exclude>org.weakref:jmxutils</exclude>
                      <!-- only the jsr305 jar is allowed, for @SuppressWarnings use findbugs-annotations -->
                      <exclude>com.google.code.findbugs:annotations</exclude>
                      <exclude>net.jcip:jcip-annotations</exclude>
                      <!-- replaced with org.kitei.testing:kitei-lessio -->
                      <exclude>ness.kawala:*</exclude>
                      <exclude>com.nesscomputing.testing:testing-lessio</exclude>
                      <!-- OpenTable transitional bans -->
                      <exclude>log4j:log4j</exclude>
                      <exclude>commons-logging:commons-logging</exclude>
                      <exclude>org.jboss.resteasy:jaxrs-api</exclude>
                      <exclude>org.jboss.spec.javax.annotation:*</exclude>
                      <exclude>javax.annotation:jsr250-api</exclude>
                      <exclude>com.opentable.components:otj-tracking</exclude>
                      <exclude>com.opentable.components:otj-server-templates</exclude>
                      <exclude>com.opentable.components:otj-config</exclude>
                      <exclude>com.opentable.components:otj-lifecycle</exclude>
                      <exclude>com.opentable.components:otj-jaxrs</exclude>
                      <exclude>com.opentable.components:otj-metrics:(,0.7.0)</exclude>
                      <exclude>com.opentable.components:otj-requestid</exclude>
                      <exclude>com.opentable.components:otj-httpclient</exclude>
                      <!-- Spring killed these.  die die die -->
                      <exclude>com.opentable.components:otj-config</exclude>
                      <exclude>com.opentable.components:otj-httpserver</exclude>
                      <exclude>com.opentable.components:otj-integration-testing</exclude>
                      <exclude>com.opentable.components:otj-jmx</exclude>
                      <exclude>com.opentable.components:otj-lifecycle</exclude>
                      <exclude>com.opentable.components:otj-migratory</exclude>
                      <exclude>com.opentable.components:otj-serverinfo</exclude>
                      <exclude>com.opentable.components:otj-service-packaging</exclude>
                      <exclude>com.opentable.components:otj-tinyhttp</exclude>
                      <exclude>com.opentable.components:otj-uuid</exclude>
                      <exclude>org.springframework:spring-jcl</exclude>
                      <!-- Shitty repackaged versions, use the real ones -->
                      <exclude>org.jboss.spec.javax.ws.rs</exclude>
                      <exclude>org.jboss.spec.javax.annotation</exclude>
                      <exclude>org.jboss.spec.javax.xml.bind</exclude>
                      <exclude>org.jboss.spec.javax.servlet</exclude>
                    </excludes>
                  </bannedDependencies>
                  <requireFilesDontExist>
                    <files>
                      <file>${basedir}/src/main/resources/log4j.xml</file>
                      <file>${basedir}/src/test/resources/log4j.xml</file>
                    </files>
                  </requireFilesDontExist>
                </rules>
              </configuration>
            </execution>
            <!-- Allow optional banning of resteasy jackson2 provider -->
            <execution>
              <id>ban-resteasy-jackson2-provider</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-resteasy-jackson2-provider}</skip>
                <rules>
                  <bannedDependencies combine.children="append">
                    <excludes combine.children="append">
                      <exclude>org.jboss.resteasy:resteasy-jackson2-provider</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
              </configuration>
            </execution>
            <!-- Allow optional banning of joda-time, supplanted by JSR310 time in Java 8 -->
            <execution>
              <id>ban-joda-time</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-joda-time}</skip>
                <rules>
                  <bannedDependencies combine.children="append">
                    <excludes combine.children="append">
                      <exclude>joda-time:joda-time</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
              </configuration>
            </execution>
            <!-- Spring Security OAuth2 is no longer supported with Spring Security 5 -->
            <execution>
              <id>ban-spring-security-oauth2</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-spring-security-oauth2}</skip>
                <rules>
                  <bannedDependencies combine.children="append">
                    <excludes combine.children="append">
                      <exclude>org.springframework.security.oauth:spring-security-oauth2</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
              </configuration>
            </execution>
            <!-- Allow optional banning of old org.codehaus.jackson artifacts -->
            <execution>
              <id>ban-codehaus-jackson</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-codehaus-jackson}</skip>
                <rules>
                  <bannedDependencies combine.children="append">
                    <excludes combine.children="append">
                      <exclude>org.codehaus.jackson:*</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
              </configuration>
            </execution>
            <!-- Allow optional banning of Spring, for writing modules which are DI-independent -->
            <execution>
              <id>ban-spring</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-spring}</skip>
                <rules>
                  <bannedDependencies combine.children="append">
                    <excludes combine.children="append">
                      <exclude>org.springframework</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
              </configuration>
            </execution>
            <!-- Allow optional banning of Guice, for writing modules which are DI-independent -->
            <execution>
              <id>ban-guice</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-guice}</skip>
                <rules>
                  <bannedDependencies combine.children="append">
                    <excludes combine.children="append">
                      <exclude>com.google.inject</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
              </configuration>
            </execution>
            <!-- Allow optional banning of RESTeasy, for when you're building Jersey stuff -->
            <execution>
              <id>ban-resteasy</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-resteasy}</skip>
                <rules>
                  <bannedDependencies combine.children="append">
                    <excludes combine.children="append">
                      <exclude>org.jboss.resteasy</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
              </configuration>
            </execution>
            <!-- Allow optional banning of Jersey, which we replaced with RESTeasy but
                 some external components still use
              -->
            <execution>
              <id>ban-jersey</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-jersey}</skip>
                <rules>
                  <bannedDependencies combine.children="append">
                    <excludes combine.children="append">
                      <exclude>com.sun.jersey:jersey-core</exclude>
                      <exclude>org.glassfish.jersey.core:jersey-common</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
              </configuration>
            </execution>
            <!-- Allow optional banning of Apache HttpClient, for migrating to Jetty HttpClient -->
            <execution>
              <id>ban-apache-httpclient</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-apache-httpclient}</skip>
                <rules>
                  <bannedDependencies combine.children="append">
                    <excludes combine.children="append">
                      <exclude>org.apache.httpcomponents</exclude>
                    </excludes>
                  </bannedDependencies>
                </rules>
              </configuration>
            </execution>
            <!-- Ban circular dependencies by default, as they are generally a design smell -->
            <execution>
              <id>ban-circular-dependencies</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <skip>${ot.build.allow-circular-dependencies}</skip>
                <rules>
                  <banCircularDependencies />
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <compilerArgs combine.children="append">
              <arg>-parameters</arg>
            </compilerArgs>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${dep.plugin.surefire.version}</version>
          <configuration>
            <!-- Make sure we run all tests including those that do not have 'Test' in the name
                 (default includes *Test and Test* only) -->
            <includes>
              <include>**/*.java</include>
            </includes>
            <!-- And static nested classes ('$' in the name excluded by default) -->
            <excludes>
              <exclude />
            </excludes>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>

        <plugin>
          <groupId>com.nesscomputing.mojo</groupId>
          <artifactId>numbers-maven-plugin</artifactId>
          <version>2.0</version>
          <executions>
            <execution>
              <id>default-validate</id>
              <phase>validate</phase>
              <goals>
                <goal>get</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <activeGroups>
              <activeGroup>snapshot</activeGroup>
              <activeGroup>release</activeGroup>
            </activeGroups>
            <propertyGroups>
              <propertyGroup>
                <id>snapshot</id>
                <!-- This group is used for the snapshot builds.
                     It generates artifact names with a date
                -->
                <activeOnRelease>false</activeOnRelease>
                <onMissingProperty>ignore</onMissingProperty>
                <properties>
                  <property>
                    <name>ot.build.name</name>
                    <value>${project.artifactId}-${project.version}-#{ot.build.timestamp}_${user.name}</value>
                  </property>
                  <property>
                    <name>ot.build.number</name>
                    <value>#{ot.build.timestamp}_${user.name}</value>
                  </property>
                </properties>
              </propertyGroup>
              <propertyGroup>
                <id>release</id>
                <!-- This group is used for the release builds.
                     It generates normal artifact names
                -->
                <activeOnSnapshot>false</activeOnSnapshot>
                <properties>
                  <property>
                    <name>ot.build.name</name>
                    <value>${project.artifactId}-${project.version}</value>
                  </property>
                  <property>
                    <name>ot.build.number</name>
                    <value>release_${user.name}</value>
                  </property>
                </properties>
              </propertyGroup>
            </propertyGroups>
            <dates>
              <date>
                <export>true</export>
                <id>ot.build.timestamp</id>
                <format>yyyyMMdd_HHmmss</format>
                <timezone>UTC</timezone>
              </date>
            </dates>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <configuration>
            <linkXRef>false</linkXRef>
            <rulesets>
              <ruleset>otj-pmd-rulesets/ot-pmd.xml</ruleset>
            </rulesets>
            <excludeRoots>
              <excludeRoot>target/generated-sources</excludeRoot>
            </excludeRoots>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.opentable</groupId>
              <artifactId>otj-pmd-rulesets</artifactId>
              <version>${dep.plugin.pmd.ruleset.version}</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.basepom.maven</groupId>
          <artifactId>duplicate-finder-maven-plugin</artifactId>
          <configuration combine.children="append">
            <exceptions>
              <exception>
                <conflictingDependencies>
                  <dependency>
                    <groupId>com.opentable.components</groupId>
                    <artifactId>otj-logging-kafka</artifactId>
                  </dependency>
                  <dependency>
                    <groupId>org.apache.kafka</groupId>
                    <artifactId>kafka-clients</artifactId>
                  </dependency>
                </conflictingDependencies>
                <resources>
                  <resource>kafka/kafka-version.properties</resource>
                </resources>
              </exception>
            </exceptions>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!-- Provide a build number -->
      <plugin>
        <groupId>com.nesscomputing.mojo</groupId>
        <artifactId>numbers-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

  <!-- Contains a number of "global" dependencies that should never change across our code base. -->
  <dependencyManagement>
    <dependencies>
      <!-- OT module dependencies -->
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-core</artifactId>
        <version>1.6.0</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-spring</artifactId>
        <version>${dep.otj-spring.version}</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-quartz</artifactId>
        <version>2.0.2</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-pausedetector</artifactId>
        <version>2.0.1</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.logging</groupId>
        <artifactId>otj-otl</artifactId>
        <version>${dep.otj-otl.version}</version>
      </dependency>
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-logging</artifactId>
        <version>${dep.otj-logging.version}</version>
      </dependency>
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-logging-kafka</artifactId>
        <version>${dep.otj-logging.version}</version>
      </dependency>
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-logging-jetty</artifactId>
        <version>${dep.otj-logging.version}</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-executors</artifactId>
        <version>2.1.1</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-conservedheaders</artifactId>
        <version>2.2.1</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-scopes</artifactId>
        <version>2.0.2</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-rest-template</artifactId>
        <version>${dep.otj-rest-template.version}</version>
      </dependency>
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-rest-template-boot</artifactId>
        <version>${dep.otj-rest-template.version}</version>
      </dependency>
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-jaxrs-shared</artifactId>
        <version>${dep.otj-jaxrs.version}</version>
      </dependency>
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-jaxrs-client</artifactId>
        <version>${dep.otj-jaxrs.version}</version>
      </dependency>
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-jaxrs-clientfactory-resteasy</artifactId>
        <version>${dep.otj-jaxrs.version}</version>
      </dependency>
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-jaxrs-clientfactory-jersey</artifactId>
        <version>${dep.otj-jaxrs.version}</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-jackson</artifactId>
        <version>${dep.otj-jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-metrics</artifactId>
        <version>${dep.otj-metrics.version}</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-kafka</artifactId>
        <version>${dep.otj-kafka.version}</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-server</artifactId>
        <version>${dep.otj-server.version}</version>
      </dependency>
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-server</artifactId>
        <version>${dep.otj-server.version}</version>
        <classifier>tests</classifier>
      </dependency>

      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-jvm</artifactId>
        <version>1.1.4</version>
      </dependency>

      <dependency>
        <groupId>com.opentable.service.discovery</groupId>
        <artifactId>discovery-client</artifactId>
        <version>${dep.discovery.version}</version>
      </dependency>

      <!-- TODO: There are newer versions, but a fair amount of breaking changes -->
      <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna</artifactId>
        <version>${dep.jna.version}</version>
      </dependency>

      <!-- SnakeYml -->
      <dependency>
        <groupId>org.yaml</groupId>
        <artifactId>snakeyaml</artifactId>
        <version>${dep.snakeyaml.version}</version>
      </dependency>


      <!-- jackson -->
      <!-- Core BOM to manage dependencies -->
      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${dep.jackson.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <!-- The BOM pins to 2.9.0, saying annotation is unchanged etc. I think that's confusing -->
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${dep.jackson.version}</version>
      </dependency>

      <!-- Jetty -->
      <!-- Core BOM to manage dependencies -->
      <!-- Ahead of spring and spring boot to get priority -->
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-bom</artifactId>
        <version>${dep.jetty.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-server</artifactId>
        <version>${dep.jetty.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.eclipse.jetty.orbit</groupId>
            <artifactId>javax.servlet</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- Spring -->
      <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-bom</artifactId>
        <version>${dep.spring-security.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-framework-bom</artifactId>
        <version>${dep.spring.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${dep.spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${dep.spring.version}</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jcl</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${dep.spring.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.ibm.websphere</groupId>
            <artifactId>uow</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- 23/22 have issues in Java 8 - this build supports 8,9,10 -->
      <dependency>
        <groupId>org.javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.23.1-GA</version>
      </dependency>

      <!-- Guava -->
      <!-- TODO: Post 23.5 switched to CheckerFramework, and false positives may occur -->
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${dep.guava.version}</version>
      </dependency>

      <!-- RESTeasy -->
      <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-spring</artifactId>
        <version>${dep.resteasy.version}</version>
        <exclusions>
          <exclusion>
            <groupId>javax.annotation</groupId>
            <artifactId>jsr250-api</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.1_spec</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.spec.javax.ws.rs</groupId>
            <artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.spec.javax.annotation</groupId>
            <artifactId>jboss-annotations-api_1.2_spec</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jettison-provider</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jackson2-provider</artifactId>
        <version>${dep.resteasy.version}</version>
        <exclusions>
          <exclusion>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jaxrs</artifactId>
        <version>${dep.resteasy.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.jboss.spec.javax.ws.rs</groupId>
            <artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.spec.javax.annotation</groupId>
            <artifactId>jboss-annotations-api_1.2_spec</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.spec.javax.xml.bind</groupId>
            <artifactId>jboss-jaxb-api_2.3_spec</artifactId>
	      </exclusion>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
          <exclusion>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-client</artifactId>
        <version>${dep.resteasy.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.jboss.spec.javax.ws.rs</groupId>
            <artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.spec.javax.annotation</groupId>
            <artifactId>jboss-annotations-api_1.2_spec</artifactId>
          </exclusion>
          <exclusion>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-client-jetty</artifactId>
        <version>${dep.resteasy.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.jboss.spec.javax.ws.rs</groupId>
            <artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <!-- RESTeasy Bean Validation Provider - integrates with Bean Validation API -->
      <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-validator-provider-11</artifactId>
        <version>${dep.resteasy.version}</version>
        <exclusions>
          <!-- don't import the old group -->
          <exclusion>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- Bean Validation -->
      <!-- The validation API itself -->
      <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>2.0.1.Final</version>
      </dependency>
      <!--
        Implementation of BV API
        Hibernate changed the maven groupId in Hibernate 6 (not even the first release).
        We double maintain for the foreseeable future.
      -->
      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>${dep.validator.version}</version>
      </dependency>
      <dependency>
        <groupId>org.hibernate.validator</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>${dep.validator.version}</version>
      </dependency>

      <!-- "unified EL" as opposed to "spring EL". -->
      <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.el</artifactId>
        <version>${dep.el.version}</version>
      </dependency>

      <!-- Kafka -->
      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka_2.12</artifactId>
        <version>${dep.kafka.version}</version>
        <exclusions>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka_2.12</artifactId>
        <classifier>test</classifier>
        <version>${dep.kafka.version}</version>
        <exclusions>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>${dep.kafka.version}</version>
        <exclusions>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>${dep.kafka.version}</version>
        <classifier>test</classifier>
        <exclusions>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-streams</artifactId>
        <version>${dep.kafka.version}</version>
        <exclusions>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>connect-api</artifactId>
        <version>${dep.kafka.version}</version>
        <exclusions>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>connect-json</artifactId>
        <version>${dep.kafka.version}</version>
        <exclusions>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.xerial.snappy</groupId>
        <artifactId>snappy-java</artifactId>
        <version>1.1.7.2</version>
      </dependency>

      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${dep.scala.version}</version>
      </dependency>

      <dependency>
        <groupId>com.zaxxer</groupId>
        <artifactId>HikariCP</artifactId>
        <version>${dep.hikari.version}</version>
      </dependency>

      <!-- Quartz -->
      <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>2.3.0</version>
        <exclusions>
          <exclusion>
            <groupId>com.mchange</groupId>
            <artifactId>mchange-commons-java</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.mchange</groupId>
            <artifactId>c3p0</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP-java6</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
        <version>3.4.13</version>
        <exclusions>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
          <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- logging -->
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${dep.logback.version}</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>${dep.logback.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${dep.slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jul-to-slf4j</artifactId>
        <version>${dep.slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${dep.slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>log4j-over-slf4j</artifactId>
        <version>${dep.slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${dep.slf4j.version}</version>
      </dependency>

      <!-- Apache commons components -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.7</version>
      </dependency>
      <!-- ask steven where this came from? -->
      <dependency>
        <groupId>commons-configuration</groupId>
        <artifactId>commons-configuration</artifactId>
        <version>1.10</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.11</version>
      </dependency>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.2</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>4.2</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.6</version>
      </dependency>
      <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils</artifactId>
        <version>1.9.3</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- Codahale Metrics -->
      <!-- TODO: Investigate updating -->
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-core</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-annotation</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-servlet</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-servlets</artifactId>
        <version>${dep.metrics.version}</version>
        <!--
        used only in dropwizard 3.2.3+, and only for cpuServlet/adminServlet, this
       pulls in joda time if not excluded. Started to be an issue with abtest-client recently
       -->
        <exclusions>
          <exclusion>
            <groupId>com.papertrail</groupId>
            <artifactId>profiler</artifactId>
          </exclusion>
          <exclusion>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-logback</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-json</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-jetty9</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-jersey</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-jdbi</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-httpclient</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-graphite</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-healthchecks</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-jvm</artifactId>
        <version>${dep.metrics.version}</version>
      </dependency>

      <!-- Apache httpclient -->
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5.5</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.4.9</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>


      <!-- Java APIs -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
      </dependency>
      <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.1</version>
      </dependency>
      <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>1.3.2</version>
      </dependency>
      <!-- TODO: Will need to be updated as well as including JAF dep for Java 11 -->
      <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>${dep.javamail.version}</version>
      </dependency>
      <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
      </dependency>

      <!-- Database related -->
      <dependency>
        <groupId>com.opentable.components</groupId>
        <artifactId>otj-sql</artifactId>
        <version>${dep.otj-sql.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jdbi</groupId>
        <artifactId>jdbi3-core</artifactId>
        <version>${dep.jdbi3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jdbi</groupId>
        <artifactId>jdbi3-guava</artifactId>
        <version>${dep.jdbi3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jdbi</groupId>
        <artifactId>jdbi3-sqlobject</artifactId>
        <version>${dep.jdbi3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jdbi</groupId>
        <artifactId>jdbi3-spring</artifactId>
        <version>${dep.jdbi3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jdbi</groupId>
        <artifactId>jdbi3-postgres</artifactId>
        <version>${dep.jdbi3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>42.2.4</version>
      </dependency>
      <dependency>
        <groupId>com.mchange</groupId>
        <artifactId>c3p0</artifactId>
        <version>0.9.5.2</version>
      </dependency>
      <!-- TODO: Breaking changes prevent in this rev -->
      <dependency>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-core</artifactId>
        <version>${dep.flyway.version}</version>
      </dependency>

      <!-- TODO: Known incompatibilities in Java 9+. Used by Hibernate, so
      best path is probably updating to Hibernate 5.3 come Spring 5.1
      -->
      <dependency>
        <groupId>org.ow2.asm</groupId>
        <artifactId>asm</artifactId>
        <version>${dep.asm.version}</version>
      </dependency>

      <!-- Testing -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
      </dependency>
      <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>3.6</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>2.19.0</version>
      </dependency>
      <!-- TODO: many newer versions -->
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>1.3</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
      </dependency>
      <!-- Update to J9/10 supported -->
      <!-- Note: ByteBuddy still has some EA J 11 issues -->
      <dependency>
        <groupId>net.bytebuddy</groupId>
        <artifactId>byte-buddy</artifactId>
        <version>${dep.bytebuddy.version}</version>
      </dependency>
      <dependency>
        <groupId>net.bytebuddy</groupId>
        <artifactId>byte-buddy-agent</artifactId>
        <version>${dep.bytebuddy.version}</version>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.9.1</version>
      </dependency>
      <dependency>
        <groupId>org.objenesis</groupId>
        <artifactId>objenesis</artifactId>
        <version>2.6</version>
      </dependency>
      <dependency>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-annotations</artifactId>
        <version>${dep.spotbugs.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>findbugs-annotations</artifactId>
        <version>${dep.findbugs.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>3.0.2</version>
      </dependency>
      <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.1</version>
        <exclusions>
          <exclusion>
            <groupId>javax.activation</groupId>
            <artifactId>javax.activation-api</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <!-- Disable git usage when sous is running -->
    <profile>
      <id>sous-build-is-running</id>
      <activation>
        <property>
          <name>env.BUILD_SOUS</name>
          <value>1</value>
        </property>
      </activation>
      <properties>
        <basepom.git-id.fail-no-info>false</basepom.git-id.fail-no-info>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.ekryd.echo-maven-plugin</groupId>
            <artifactId>echo-maven-plugin</artifactId>
            <version>${dep.plugin.echo.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>echo</goal>
                </goals>
                <phase>process-sources</phase>
              </execution>
            </executions>
            <configuration>
              <message>Sous build is running...</message>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!--
     We use maven profiles (see
https://maven.apache.org/guides/introduction/introduction-to
-profiles.html) to set the compiler configuration options of
source, target, and release (see
https://docs.oracle.com/javase/9/tools/javac.htm) based on
the JDK that is installed in your build environment, the
presence of signal files, and configuration properties that
are defined in the parent pom (but may be overridden in your
project's pom file).

If Java 8 is the installed JDK: We'll set source and target
to the value defined in the project.build.targetJdk property
(currently set in the parent pom to 1.8). Java 8 doesn't
have a release compiler option, so it won't be set.

If Java 9 or above is the installed JDK : We'll set
source and target to whatever is defined in
project.build.targetJdk (currently, 1.8) and we'll set
release to project.build.targetJdk as well, except we'll
drop whatever comes before the first decimal (if anything),
so 1.8 becomes 8 (which is the format that field requires),
and 9 will remain 9.

Notes: If the JDK in your build environment is of a lower
version than what you are targeting, the maven enforcer
plugin will fail the build.

Whatever version you target will need to be installed on the
machines of all team members who may build this project and
any CI build agents you are using (e.g. TeamCity or
Jenkins). So, if you set Java 9 as a target you'll need to
be OK with that.

Very old Maven compiler plugins have OR logic instead of AND
when evaluating conditions for profile activation. This can
cause problems here.
    -->
    <profile>
      <id>using-java-8-jdk</id>
      <activation>
        <jdk>[1.8,9.0)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.ekryd.echo-maven-plugin</groupId>
            <artifactId>echo-maven-plugin</artifactId>
            <version>${dep.plugin.echo.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>echo</goal>
                </goals>
                <phase>process-sources</phase>
              </execution>
            </executions>
            <configuration>
              <message>Using Java 8 (Full) SDK</message>
            </configuration>
          </plugin>
          <!-- Use default inheritance from basePOM for now -->
        </plugins>
      </build>
    </profile>
    <profile>
      <id>using-java-9-or-higher</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <build>
        <plugins>
          <!-- The entire purpose of this plugin is to convert 1.8 => 8 or more
      accurately simply strip pre decimal (including decimal point). This is used
      to build a correct release variable, since JavaC understands 8, 9, 10, etc
      but not 1.8 for the release argument -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>${dep.plugin.build-helper.version}</version>
            <executions>
              <execution>
                <id>fix-release-version</id>
                <phase>validate</phase>
                <goals>
                  <goal>regex-property</goal>
                </goals>
                <configuration>
                  <name>project.build.release</name>
                  <regex>^(\d*\.)</regex><!-- any numbers before and including decimal -->
                  <value>${project.build.targetJdk}</value>
                  <failIfNoMatch>false</failIfNoMatch>
                  <replacement /> <!-- replace with empty string -->
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.github.ekryd.echo-maven-plugin</groupId>
            <artifactId>echo-maven-plugin</artifactId>
            <version>${dep.plugin.echo.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>echo</goal>
                </goals>
                <phase>process-sources</phase>
              </execution>
            </executions>
            <configuration>
              <message>Using Java 9+ SDK (target ${project.build.targetJdk}, release ${project.build.release})</message>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${dep.plugin.compiler.version}</version>
            <configuration>
              <!-- Here we let the user decide -->
              <source>${project.build.targetJdk}</source>
              <target>${project.build.targetJdk}</target>
              <release>${project.build.release}</release>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>


    <!--
        This is activated for nearly all projects (ones missing the market file below
        and simply sets up a default logback config for tests
    -->
    <profile>
      <id>test-log-config</id>
      <activation>
        <file>
          <missing>.no-test-log-config</missing>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.opentable.testing</groupId>
          <artifactId>otj-test-log-config</artifactId>
          <version>1.1.2</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

   <!--
    Normally we want to include otj-spring to get a nice MBean clean up
    However doing so globally makes otj-spring itself have a cyclic dependency.
    This lets otj-spring avoid this trap. Clumsy, I will admit!
   -->
   <profile>
    <id>test-spring-otj</id>
    <activation>
      <file>
        <missing>.no-otj-spring</missing>
      </file>
    </activation>
     <dependencies>
       <dependency>
         <groupId>com.opentable.components</groupId>
         <artifactId>otj-spring</artifactId>
         <version>${dep.otj-spring.version}</version>
         <classifier>tests</classifier>
         <scope>test</scope>
       </dependency>
     </dependencies>
  </profile>

    <!-- ======================================================================== -->
    <!-- =                                                                      = -->
    <!-- = Service profile. Builds a tarball which is a deployable unit.        = -->
    <!-- =                                                                      = -->
    <!-- ======================================================================== -->
    <profile>
      <id>build-service</id>
      <activation>
        <file>
          <exists>.build-service</exists>
        </file>
      </activation>
      <properties>
      </properties>
      <build>
        <plugins>
          <!-- add in git.properties. We already add to manifest fwiw some of this -->
          <plugin>
            <groupId>pl.project13.maven</groupId>
            <artifactId>git-commit-id-plugin</artifactId>
            <version>${dep.plugin.git-commit-id.version}</version>
            <configuration>
              <generateGitPropertiesFile>true</generateGitPropertiesFile>
              <!-- Renamed so there aren't conflicts -->
              <generateGitPropertiesFilename>${project.build.outputDirectory}/${project.build.finalName}.git.properties</generateGitPropertiesFilename>
            </configuration>
          </plugin>
          <!-- Make shaded JAR. -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${dep.spring-boot.version}</version>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <id>assemble-app</id>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <transformers combine.self="override">
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/spring.handlers</resource>
                </transformer>
                <transformer implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
                  <resource>META-INF/spring.factories</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/spring.schemas</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer implementation="org.basepom.maven.shade.CollectingManifestResourceTransformer">
                  <mainClass>${ot.mainclass}</mainClass>
                  <collectSections>true</collectSections>
                  <manifestEntries>
                    <X-BasePOM-Build-Id>${basepom.shaded.id}</X-BasePOM-Build-Id>
                    <X-BasePOM-Name>${project.name}</X-BasePOM-Name>
                    <X-BasePOM-Git-Commit-Id>${git.commit.id}</X-BasePOM-Git-Commit-Id>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </plugin>

          <!-- Require main class property. -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>check-service-build</id>
                <phase>validate</phase>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireProperty>
                      <property>ot.mainclass</property>
                      <message>You must specify "ot.mainclass" as a Maven property for a service-enabled build.</message>
                    </requireProperty>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!-- Build a Docker image -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.3.2</version>
            <executions>
              <execution>
                <id>build-docker</id>
                <phase>deploy</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>otpl-package-docker</executable>
                  <arguments>
                    <argument>${project.artifactId}</argument>
                    <argument>${otpl.docker.tag}</argument>
                    <argument>${project.build.directory}/${project.build.finalName}.jar</argument>
                    <argument>${project.version}</argument>
                  </arguments>
                  <workingDirectory>${otpl.project.dir}</workingDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- This profile is active when *not* building for OSS -->
    <profile>
      <id>internal-build</id>
      <activation>
        <file>
          <missing>.oss-build</missing>
        </file>
      </activation>

      <!-- use ot repos to upload jars, images -->
      <distributionManagement>
        <snapshotRepository>
          <id>opentable.snapshot</id>
          <name>opentable-snapshots</name>
          <uniqueVersion>true</uniqueVersion>
          <url>https://artifactory.otenv.com/snapshots</url>
        </snapshotRepository>
        <repository>
          <id>opentable</id>
          <name>opentable-internal</name>
          <url>https://artifactory.otenv.com/internal</url>
          <uniqueVersion>false</uniqueVersion>
        </repository>
      </distributionManagement>
    </profile>

    <!-- This profile ports basepom-oss into our spring pom
         It is typically used for our open source projects.
     -->
    <profile>
      <id>oss-build</id>
      <activation>
        <file>
          <exists>.oss-build</exists>
        </file>
      </activation>

      <!-- note the main difference is released artifacts go to oss.sonatype instead of internal -->
      <distributionManagement>
        <snapshotRepository>
          <id>opentable.snapshot</id>
          <name>opentable-snapshots</name>
          <uniqueVersion>true</uniqueVersion>
          <url>https://artifactory.otenv.com/snapshots</url>
        </snapshotRepository>
        <repository>
          <id>sonatype-nexus-staging</id>
          <name>Nexus Release Repository</name>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
      </distributionManagement>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-release-plugin</artifactId>
              <configuration>
                <!-- activate some basepom stuff, this binds the profile below -->
                <releaseProfiles>${basepom.release.profiles}</releaseProfiles>
              </configuration>
            </plugin>

            <!-- checks for valid OSS license stuff and headers -->
            <plugin>
              <groupId>com.mycila</groupId>
              <artifactId>license-maven-plugin</artifactId>
              <version>${dep.plugin.license.version}</version>
              <dependencies>
                <dependency>
                  <groupId>org.basepom</groupId>
                  <artifactId>basepom-policy</artifactId>
                  <version>${dep.basepom-policy.version}</version>
                </dependency>
              </dependencies>
              <configuration>
                <skip>${basepom.check.skip-license}</skip>
                <skipExistingHeaders>${basepom.license.skip-existing}</skipExistingHeaders>
                <failIfMissing>${basepom.check.fail-license}</failIfMissing>
                <header>license/basepom-apache-license-header.txt</header>
                <headerDefinitions>
                  <headerDefinition>license/xml-prefix.xml</headerDefinition>
                </headerDefinitions>
                <mapping>
                  <xml>XML_PREFIX</xml>
                  <java>SLASHSTAR_STYLE</java>
                  <yaml>SCRIPT_STYLE</yaml>
                </mapping>
                <strictCheck>true</strictCheck>
                <aggregate>true</aggregate>
                <useDefaultExcludes>true</useDefaultExcludes>
                <encoding>${project.build.sourceEncoding}</encoding>
                <excludes>
                  <exclude>.*/**</exclude>
                  <exclude>**/*.md</exclude>
                  <exclude>**/*.rst</exclude>
                  <exclude>**/*.adoc</exclude>
                  <exclude>**/*.sh</exclude>
                  <exclude>**/*.txt</exclude>
                  <exclude>**/*.thrift</exclude>
                  <exclude>**/*.proto</exclude>
                  <exclude>**/*.g</exclude>
                  <exclude>**/*.releaseBackup</exclude>
                  <exclude>**/*.vm</exclude>
                  <exclude>**/*.st</exclude>
                  <exclude>**/*.raw</exclude>
                  <exclude>**/*.ser</exclude>
                  <exclude>**/src/license/**</exclude>
                </excludes>
                <includes>
                  <include>src/**</include>
                  <include>**/pom.xml</include>
                </includes>
              </configuration>
            </plugin>

            <!-- sign with gpg -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-gpg-plugin</artifactId>
              <version>${dep.plugin.gpg.version}</version>
              <configuration>
                <useAgent>true</useAgent>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>

        <!-- more license checking. One day I'll know why both of these -->
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>default</id>
                <phase>${basepom.check.phase-license}</phase>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Active during OSS release:perform -->
    <profile>
      <id>basepom.oss-release</id>
      <properties>
        <!-- tests run in the preparation step of the release -->
        <skipTests>true</skipTests>
      </properties>
      <build>
        <plugins>
          <!-- oss requires a javadoc jar. Build one when releasing. -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- if necessary, build a scaladoc jar. Disabled by default. -->
          <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-scaladocs</id>
                <phase>package</phase>
                <configuration>
                  <skip>${basepom.oss.skip-scala-doc}</skip>
                </configuration>
                <goals>
                  <goal>doc-jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- Sign artifacts using gpg for oss upload -->
          <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>
      </build>
    </profile>
  </profiles>
</project>
