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

  <parent>
    <groupId>com.mainstreethub</groupId>
    <artifactId>ecs-parent-pom</artifactId>
    <version>1.3.2</version>
  </parent>

  <artifactId>dropwizard-parent-pom</artifactId>
  <version>1.0.5-7</version>
  <packaging>pom</packaging>

  <scm>
    <url>https://github.com/mainstreethub/parent-poms</url>
    <connection>scm:git:git@github.com:mainstreethub/parent-poms</connection>
    <developerConnection>scm:git:git@github.com:mainstreethub/parent-poms</developerConnection>
    <tag>dropwizard-parent-pom-v1.0.5-7</tag>
  </scm>

  <properties>
    <dropwizard.version>1.0.5</dropwizard.version>

    <!--
      This version needs to stay EXACTLY the same as the one that the Dropwizard BOM
      specifies.  Unfortunately when you import a BOM you don't get its properties, only
      its dependencies.
    -->
    <jackson.version>2.7.8</jackson.version>

    <!--
      These versions should remain consistent with the version of Dropwizard being specified.
      Don't just update the version of Dropwizard above and not update the versions of the
      bundles/dependencies.

      Also don't add anything to this pom that isn't directly influenced by dropwizard.  The
      idea is that in the absence of bug fixes these dependencies should only ever change
      versions when we upgrade to a newer version of dropwizard.
    -->
    <dropwizard.api.key.bundle.version>1.0.0</dropwizard.api.key.bundle.version>
    <dropwizard.configurable.assets.bundle.version>1.0.5</dropwizard.configurable.assets.bundle.version>
    <dropwizard.json.log.bundle.version>1.0.2-0</dropwizard.json.log.bundle.version>
    <dropwizard.metrics.datadog.ecs.version>0.4.0</dropwizard.metrics.datadog.ecs.version>
    <dropwizard.redirect.bundle.version>1.0.5</dropwizard.redirect.bundle.version>
    <dropwizard.template.config.version>1.4.0</dropwizard.template.config.version>
    <dropwizard.version.bundle.version>1.0.0</dropwizard.version.bundle.version>
    <dropwizard.webjars.bundle.version>1.0.0</dropwizard.webjars.bundle.version>

    <mainstreethub.dropwizard.config.testing.version>0.1.0</mainstreethub.dropwizard.config.testing.version>
    <mainstreethub.environment.version>0.3.0</mainstreethub.environment.version>
    <mainstreethub.time.version>0.2.0</mainstreethub.time.version>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <executions>
            <execution>
              <id>docker-image</id>
              <phase>package</phase>
              <goals>
                <goal>build</goal>
              </goals>
              <configuration>
                <images>
                  <image>
                    <build>
                      <labels>
                        <archetype>dropwizard</archetype>
                      </labels>
                      <ports>
                        <port>8080</port>
                        <port>8081</port>
                      </ports>
                      <cmd>
                        <arg>server</arg>
                        <arg>classpath://config.yaml</arg>
                      </cmd>
                    </build>
                  </image>
                </images>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <!-- During release, make the tag contain the project name since this is a shared repo. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <tagNameFormat>@{project.artifactId}-v@{project.version}</tagNameFormat>
        </configuration>
        <executions>
          <execution>
            <id>default</id>
            <goals>
              <goal>perform</goal>
            </goals>
            <configuration>
              <pomFileName>dropwizard-parent-pom/pom.xml</pomFileName>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce-rules</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <excludes>
                    <exclude>commons-logging:*:*</exclude>
                    <exclude>org.apache.logging.log4j:*:*</exclude>
                    <exclude>log4j:*:*</exclude>
                  </excludes>
                  <searchTransitive>true</searchTransitive>
                </bannedDependencies>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Execute our pom-test.xml to make sure all dependencies are present and converge. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>2.0.0</version>
        <inherited>false</inherited>
        <configuration>
          <pom>test/pom.xml</pom>
          <properties>
            <dropwizard.parent.pom.version>${project.version}</dropwizard.parent.pom.version>
          </properties>
          <noLog>true</noLog>
          <showErrors>true</showErrors>
          <streamLogs>true</streamLogs>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencyManagement>
    <!-- Dependencies released as part of Dropwizard. -->
    <dependencies>
      <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-bom</artifactId>
        <version>${dropwizard.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- Jackson dependencies that we use but dropwizard doesn't. -->
      <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-parameter-names</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <!-- Main Street Hub authored bundles to use with Dropwizard. -->
      <dependency>
        <groupId>com.mainstreethub</groupId>
        <artifactId>dropwizard-config-testing</artifactId>
        <version>${mainstreethub.dropwizard.config.testing.version}</version>
      </dependency>
      <dependency>
        <groupId>com.mainstreethub</groupId>
        <artifactId>dropwizard-metrics-datadog-ecs</artifactId>
        <version>${dropwizard.metrics.datadog.ecs.version}</version>
      </dependency>
      <dependency>
        <groupId>com.mainstreethub</groupId>
        <artifactId>environment</artifactId>
        <version>${mainstreethub.environment.version}</version>
      </dependency>
      <dependency>
        <groupId>com.mainstreethub</groupId>
        <artifactId>time</artifactId>
        <version>${mainstreethub.time.version}</version>
      </dependency>

      <!-- 3rd-party bundles to use with Dropwizard. -->
      <dependency>
        <groupId>com.mainstreethub</groupId>
        <artifactId>dropwizard-api-key-bundle</artifactId>
        <version>${dropwizard.api.key.bundle.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard-bundles</groupId>
        <artifactId>dropwizard-configurable-assets-bundle</artifactId>
        <version>${dropwizard.configurable.assets.bundle.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard-bundles</groupId>
        <artifactId>dropwizard-redirect-bundle</artifactId>
        <version>${dropwizard.redirect.bundle.version}</version>
      </dependency>
      <dependency>
        <groupId>de.thomaskrille</groupId>
        <artifactId>dropwizard-template-config</artifactId>
        <version>${dropwizard.template.config.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard-bundles</groupId>
        <artifactId>dropwizard-version-bundle</artifactId>
        <version>${dropwizard.version.bundle.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>io.dropwizard-bundles</groupId>
        <artifactId>dropwizard-webjars-bundle</artifactId>
        <version>${dropwizard.webjars.bundle.version}</version>
      </dependency>
      <dependency>
        <groupId>com.mainstreethub</groupId>
        <artifactId>dropwizard-json-log-bundle</artifactId>
        <version>${dropwizard.json.log.bundle.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
</project>
