<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~    Copyright (C) 2015 Mesosphere, Inc
  ~
  ~ 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mesosphere.mesos.rx.java</groupId>
    <artifactId>mesos-rxjava</artifactId>
    <version>0.2.0</version>
    <packaging>pom</packaging>

    <name>Mesos RxJava</name>
    <url>https://github.com/mesosphere/mesos-rxjava</url>

    <description>
        Rx client on top of Apache Mesos HTTP Api.
    </description>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>
    <organization>
        <name>Mesosphere, Inc</name>
        <url>https://mesosphere.com/</url>
    </organization>

    <developers>
        <developer>
            <name>BenWhitehead</name>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/mesosphere/mesos-rxjava.git</connection>
        <developerConnection>scm:git:https://github.com/mesosphere/mesos-rxjava.git</developerConnection>
        <url>https://github.com/mesosphere/mesos-rxjava</url>
    </scm>
    <issueManagement>
        <system>Github</system>
        <url>${project.scm.url}/issues</url>
    </issueManagement>

    <prerequisites>
        <maven>3.2.0</maven>
    </prerequisites>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.java>1.8</version.java>

        <version.assertj-core>3.5.2</version.assertj-core>
        <version.guava>19.0</version.guava>
        <version.jetbrains.annotations>15.0</version.jetbrains.annotations>
        <version.junit>4.12</version.junit>
        <version.logback-classic>1.1.7</version.logback-classic>
        <version.slf4j>1.7.21</version.slf4j>

        <version.rxJava>1.1.8</version.rxJava>
        <version.rxNetty>0.5.1</version.rxNetty>
        <version.protobuf>2.6.1</version.protobuf>
        <version.netty>4.1.4.Final</version.netty>
        <version.mesos>1.0.0</version.mesos>

        <!-- By default we skip deploy of all modules. Any module that should be deployed is explicitly enabled -->
        <module.deploy.skip>true</module.deploy.skip>
    </properties>

    <modules>
        <module>mesos-rxjava-client</module>
        <module>mesos-rxjava-recordio</module>
        <module>mesos-rxjava-example</module>
        <module>mesos-rxjava-test</module>
        <module>mesos-rxjava-util</module>
        <module>mesos-rxjava-protobuf-client</module>
    </modules>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>

            <!-- project libraries -->
            <dependency>
                <groupId>com.mesosphere.mesos.rx.java</groupId>
                <artifactId>mesos-rxjava-client</artifactId>
                <version>0.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.mesosphere.mesos.rx.java</groupId>
                <artifactId>mesos-rxjava-recordio</artifactId>
                <version>0.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.mesosphere.mesos.rx.java</groupId>
                <artifactId>mesos-rxjava-util</artifactId>
                <version>0.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.mesosphere.mesos.rx.java</groupId>
                <artifactId>mesos-rxjava-test</artifactId>
                <version>0.2.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.mesosphere.mesos.rx.java</groupId>
                <artifactId>mesos-rxjava-protobuf-client</artifactId>
                <version>0.2.0</version>
            </dependency>

            <!-- Rx Libraries -->
            <dependency>
                <groupId>io.reactivex</groupId>
                <artifactId>rxjava</artifactId>                                                    
                <version>${version.rxJava}</version>
            </dependency>
            <dependency>
                <groupId>io.reactivex</groupId>
                <artifactId>rxnetty</artifactId>
                <version>${version.rxNetty}</version>
            </dependency>
            <!--
              Grr, rx sets its transitive dependencies to 'runtime' scope, so maven doesn't add
              them to the compile classpath. Manually including them here.  It also appears that
              gradle and sbt don't respect the scope constraint and so the dependencies end up
              on the classpath despite the specified scope.
            -->
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-codec-http</artifactId>
                <version>${version.netty}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-handler</artifactId>
                <version>${version.netty}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-transport-native-epoll</artifactId>
                <version>${version.netty}</version>
            </dependency>

            <!-- Mesos dependencies -->
            <dependency>
                <groupId>org.apache.mesos</groupId>
                <artifactId>mesos</artifactId>
                <version>${version.mesos}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${version.protobuf}</version>
            </dependency>

            <!-- Libraries that make working in java easier -->
            <dependency>
                <groupId>org.jetbrains</groupId>
                <artifactId>annotations</artifactId>
                <version>${version.jetbrains.annotations}</version>
            </dependency>

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

            <!-- Test Libraries -->
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${version.logback-classic}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${version.junit}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${version.guava}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${version.assertj-core}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- Libraries that make working in java easier -->
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
        </dependency>

        <!-- Test Libraries -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>${project.build.directory}/generated-resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.4.0.Final</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.4</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>ideauidesigner-maven-plugin</artifactId>
                    <version>1.0-beta-1</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>1.8</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>2.9</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${version.java}</source>
                    <target>${version.java}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <deployAtEnd>true</deployAtEnd>
                    <skip>${module.deploy.skip}</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <maven.test.skip>true</maven.test.skip>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <configuration>
                            <excludedScopes>test</excludedScopes>
                            <excludedGroups>${project.groupId}</excludedGroups>
                            <licenseMerges>
                                <licenseMerge>Apache Software License Version 2.0|The Apache Software License, Version 2.0|Apache 2|Apache License, Version 2.0|Apache Software Licenses</licenseMerge>
                                <licenseMerge>CDDL+GPL License|CDDL+GPL</licenseMerge>
                                <licenseMerge>Eclipse Public License 1.0|Eclipse Public License - v 1.0</licenseMerge>
                            </licenseMerges>
                        </configuration>
                        <executions>
                            <execution>
                                <id>download-licenses</id>
                                <goals>
                                    <goal>add-third-party</goal>
                                    <goal>download-licenses</goal>
                                </goals>
                                <phase>generate-resources</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <aggregate>true</aggregate>
                            <author>false</author>
                            <charset>UTF-8</charset>
                            <detectJavaApiLink>true</detectJavaApiLink>
                            <links>
                                <link>http://reactivex.io/RxJava/javadoc/</link>
                                <link>http://netty.io/4.1/api/</link>
                                <link>http://mesos.apache.org/api/latest/java/</link>
                            </links>
                            <show>protected</show>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>aggregate</id>
                                <goals>
                                    <goal>aggregate</goal>
                                    <goal>aggregate-jar</goal>
                                </goals>
                                <phase>package</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <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>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>offline-site</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <includeDependencySources>true</includeDependencySources>
                            <includeTransitiveDependencySources>true</includeTransitiveDependencySources>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
