<?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-standard-oss</artifactId>
        <version>7</version>
    </parent>

    <groupId>com.groupon.mesos</groupId>
    <artifactId>jesos</artifactId>
    <packaging>jar</packaging>
    <version>1.1</version>

    <scm>
        <connection>scm:git:git://github.com/groupon/jesos.git</connection>
        <developerConnection>scm:git:git@github.com:groupon/jesos.git</developerConnection>
        <url>https://github.com/groupon/jesos</url>
        <tag>jesos-1.1</tag>
    </scm>


    <inceptionYear>2014</inceptionYear>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>hgschmie</id>
            <name>Henning Schmiedehausen</name>
            <email>henning@schmiedehausen.org</email>
            <timezone>-8</timezone>
        </developer>
    </developers>

    <properties>
        <dep.mesos.version>0.21.0</dep.mesos.version>
        <dep.zkclient.version>0.4</dep.zkclient.version>
        <dep.zookeeper.version>3.3.6</dep.zookeeper.version>
        <dep.undertow.version>1.0.16.Final</dep.undertow.version>
        <dep.okhttp.version>2.0.0</dep.okhttp.version>
        <dep.protobuf.version>2.5.0</dep.protobuf.version>
        <dep.leveldb.version>0.7</dep.leveldb.version>
        <dep.guava.version>17.0</dep.guava.version>

        <dep.basepom-policy.version>3</dep.basepom-policy.version>
        <dep.kitei-rules.version>4</dep.kitei-rules.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.mesos</groupId>
            <artifactId>mesos</artifactId>
            <version>${dep.mesos.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- zkclient uses log4j. Oh dear. :-( -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${dep.protobuf.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <version>${dep.zookeeper.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>junit</artifactId>
                    <groupId>junit</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>log4j</artifactId>
                    <groupId>log4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.101tec</groupId>
            <artifactId>zkclient</artifactId>
            <version>${dep.zkclient.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>junit</artifactId>
                    <groupId>junit</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>log4j</artifactId>
                    <groupId>log4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-core</artifactId>
            <version>${dep.undertow.version}</version>
        </dependency>

        <dependency>
            <groupId>com.squareup.okhttp</groupId>
            <artifactId>okhttp</artifactId>
            <version>${dep.okhttp.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
            <optional>true</optional>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.iq80.leveldb</groupId>
            <artifactId>leveldb-api</artifactId>
            <version>${dep.leveldb.version}</version>
        </dependency>

        <dependency>
            <groupId>org.iq80.leveldb</groupId>
            <artifactId>leveldb</artifactId>
            <version>${dep.leveldb.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.comoyo.maven.plugins</groupId>
                    <artifactId>protoc-bundled-plugin</artifactId>
                    <version>1.4.46</version>
                    <configuration>
                        <protobufVersion>${dep.protobuf.version}</protobufVersion>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <configuration>
                        <excludeFilterFile>${project.basedir}/src/build/findbugs-exclude.xml</excludeFilterFile>
                    </configuration>
                </plugin>

                <!-- Load the pmd rules from the kitei-rules jar -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>org.kitei.internal</groupId>
                            <artifactId>kitei-rules</artifactId>
                            <version>${dep.kitei-rules.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <rulesets>
                            <ruleset>pmd/kitei.xml</ruleset>
                        </rulesets>
                        <excludes>
                            <exclude>mesos/internal/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <configuration>
                        <configLocation>checkstyle/checkstyle-basepom.xml</configLocation>
                        <excludes>**/mesos/internal/**.java</excludes>
                    </configuration>
                </plugin>


                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <dependencies>
                        <dependency>    
                            <groupId>org.basepom</groupId>
                            <artifactId>basepom-policy</artifactId>
                            <version>${dep.basepom-policy.version}</version>
                        </dependency>
                    </dependencies>
                    <!-- license header from the rules jar -->
                    <configuration>
                        <header>license/basepom-apache-license-header.txt</header>
                        <excludes>
                            <exclude>src/main/generated-sources/protobuf/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>prebuilt-protobuf</id>
            <activation>
                <file>
                    <exists>${basedir}/src/main/generated-sources/protobuf</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-protobuf-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${basedir}/src/main/generated-sources/protobuf</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>build-protobuf</id>
            <activation>
                <file>
                    <missing>${basedir}/src/main/generated-sources/protobuf</missing>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.comoyo.maven.plugins</groupId>
                        <artifactId>protoc-bundled-plugin</artifactId>
                        <version>1.4.46</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
