<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2014 meltmedia (christian.trimble@meltmedia.com)

    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>com.meltmedia</groupId>
    <artifactId>meltmedia-oss</artifactId>
    <version>2.0.0</version>
  </parent>
  <groupId>com.meltmedia.dropwizard</groupId>
  <artifactId>dropwizard-mongo-parent</artifactId>
  <version>0.2.0</version>
  <packaging>pom</packaging>
  <name>Dropwizard Mogno Parent</name>
  <description>A Dropwizard Bundle for accessing Mongo.</description>
  <url>http://github.com/meltmedia/dropwizard-mongo</url>
  <inceptionYear>2014</inceptionYear>
  <ciManagement>
    <system>Travis</system>
    <url>https://travis-ci.org/meltmedia/dropwizard-mongo</url>
  </ciManagement>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/meltmedia/dropwizard-mongo/issues</url>
  </issueManagement>
  <scm>
    <connection>scm:git:git://github.com/meltmedia/dropwizard-mongo.git</connection>
    <developerConnection>scm:git:git@github.com:meltmedia/dropwizard-mongo.git</developerConnection>
    <url>https://github.com/meltmedia/dropwizard-mongo</url>
    <tag>v0.2.0</tag>
  </scm>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <io.dropwizard.version>0.7.1</io.dropwizard.version>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>
  <repositories>
    <repository>
      <id>sonatype-snapshots-repo</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <dependencyManagement>
    <dependencies>
    <dependency>
      <groupId>org.mongodb</groupId>
      <artifactId>mongo-java-driver</artifactId>
      <version>2.11.3</version>
    </dependency>
      <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-configuration</artifactId>
        <version>${io.dropwizard.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-core</artifactId>
        <version>${io.dropwizard.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-testing</artifactId>
        <version>${io.dropwizard.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.10.8</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
          <artifactId>maven-java-formatter-plugin</artifactId>
          <version>0.4</version>
          <configuration>
            <configFile>${root.directory}/eclipse-formatter-config.xml</configFile>
            <overrideConfigCompilerVersion>true</overrideConfigCompilerVersion>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.eclipse.text</groupId>
              <artifactId>org.eclipse.text</artifactId>
              <version>3.5.101</version>
            </dependency>
            <dependency>
              <groupId>org.eclipse.tycho</groupId>
              <artifactId>org.eclipse.jdt.core</artifactId>
              <version>3.10.0.v20140604-1726</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <phase>format</phase>
              <goals>
                <goal>format</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.jsonschema2pojo</groupId>
          <artifactId>jsonschema2pojo-maven-plugin</artifactId>
          <version>0.4.4</version>
          <configuration>
            <sourceDirectory>${basedir}/src/main/jsonschema</sourceDirectory>
            <outputDirectory>${project.build.directory}/generated-sources/jsonschema</outputDirectory>
            <sourceType>jsonschema</sourceType>
            <generateBuilders>true</generateBuilders>
            <includeHashcodeAndEquals>true</includeHashcodeAndEquals>
            <includeToString>true</includeToString>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>generate</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>2.1</version>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>shade</goal>
              </goals>
              <configuration>
                <createDependencyReducedPom>false</createDependencyReducedPom>
                <filters>
                  <filter>
                    <artifact>*:*</artifact>
                    <excludes>
                      <exclude>META-INF/*.SF</exclude>
                      <exclude>META-INF/*.DSA</exclude>
                      <exclude>META-INF/*.RSA</exclude>
                    </excludes>
                  </filter>
                </filters>
                <transformers>
                  <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                    <mainClass>${main.class}</mainClass>
                  </transformer>
                  <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                </transformers>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.skife.maven</groupId>
          <artifactId>really-executable-jar-maven-plugin</artifactId>
          <version>1.0.5</version>
          <configuration>
            <programFile>${program.file}</programFile>
            <flags>-Djava.net.preferIPv4Stack=true</flags>
          </configuration>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>really-executable-jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.commonjava.maven.plugins</groupId>
        <artifactId>directory-maven-plugin</artifactId>
        <version>0.1</version>
        <executions>
          <execution>
            <id>directories</id>
            <goals>
              <goal>directory-of</goal>
            </goals>
            <phase>pre-format</phase>
            <configuration>
              <property>root.directory</property>
              <project>
                <groupId>com.meltmedia.dropwizard</groupId>
                <artifactId>dropwizard-mongo-parent</artifactId>
              </project>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <modules>
    <module>bundle</module>
    <module>example</module>
  </modules>
  <profiles>
    <profile>
      <id>integration-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.15</version>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>integration-test</goal>
                </goals>
              </execution>
              <execution>
                <id>verify</id>
                <goals>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
              <execution>
                <id>up-vagrant</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <commandlineArgs>up</commandlineArgs>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <executable>vagrant</executable>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
