<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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.apache</groupId>
      <artifactId>apache</artifactId>
      <version>21</version>
    </parent>

    <groupId>org.apache.nemo</groupId>
    <artifactId>nemo-project</artifactId>
    <version>0.1</version>
    <packaging>pom</packaging>
    <name>Nemo Project</name>

    <scm>
        <connection>scm:git:https://gitbox.apache.org/repos/asf/incubator-nemo.git</connection>
        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/incubator-nemo.git</developerConnection>
        <url>https://github.com/apache/incubator-nemo/tree/${project.scm.tag}</url>
        <tag>nemo-project-0.1</tag>
    </scm>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <auto-service.version>1.0-rc2</auto-service.version>
        <beam.version>2.6.0</beam.version>
        <spark.version>2.2.0</spark.version>
        <scala.version>2.11.8</scala.version>
        <kryo.version>4.0.1</kryo.version>
        <reef.version>0.16.0</reef.version>
        <protobuf.version>2.5.0</protobuf.version>
        <hadoop.version>2.7.2</hadoop.version>
        <log4j.configuration>file://log4j.properties</log4j.configuration>
        <netty.version>4.1.16.Final</netty.version>
        <guava.version>19.0</guava.version>
        <grpc.version>1.7.0</grpc.version>
        <jackson.version>2.8.8</jackson.version>
        <netlib.version>1.1.2</netlib.version>
        <netty.version>4.1.16.Final</netty.version>
        <jetty-server.version>9.4.10.v20180503</jetty-server.version>
        <jetty-servlet.version>9.4.10.v20180503</jetty-servlet.version>
        <commons-math.version>3.6.1</commons-math.version>
        <slf4j.version>1.7.20</slf4j.version>
        <!-- Tests -->
        <mockito.version>2.13.0</mockito.version>
        <powermock.version>2.0.0-beta.5</powermock.version>
        <surefire.version>3.0.0-M1</surefire.version>
        <junit.version>4.12</junit.version>
    </properties>

    <modules>
        <module>conf</module>
        <module>client</module>
        <module>common</module>
        <module>compiler</module>
        <module>examples</module>
        <module>runtime</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${protobuf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.xerial.snappy</groupId>
            <artifactId>snappy-java</artifactId>
            <version>1.1.1.3</version>
        </dependency>
        <!--tests-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito2</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <!-- Follow netty version of grpc which is more later than the netty version of reef-wake -->
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-all</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <!-- Follow guava version of grpc -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.5.0.Final</version>
            </extension>
        </extensions>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>checkstyle.xml</configLocation>
                            <headerLocation>checkstyle.license</headerLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <excludes>**/org/apache/reef/**/*</excludes>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                            <goal>checkstyle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <version>${surefire.version}</version>
              <executions>
                <execution>
                  <goals>
                    <goal>integration-test</goal>
                    <goal>verify</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/target/generated-sources/</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>0.5.0</version>
                <configuration>
                    <pluginId>grpc-java</pluginId>
                    <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>compile-custom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                  <excludePackageNames>*.org.apache.nemo.runtime.common.comm</excludePackageNames>
                  <outputDirectory>docs/apidocs</outputDirectory>
                  <reportOutputDirectory>docs/apidocs</reportOutputDirectory>
                </configuration>
                <executions>
                    <execution>
                      <id>aggregate</id>
                      <goals>
                          <goal>aggregate</goal>
                      </goals>
                      <phase>site</phase>
                    </execution>
                    <execution>
                      <id>test-javadoc</id>
                      <goals>
                        <goal>javadoc</goal>
                      </goals>
                      <phase>validate</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <version>0.12</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <!-- Markdown files such as README.md -->
                        <exclude>**/*.md</exclude>
                        <!-- Git files -->
                        <exclude>.gitattributes</exclude>
                        <exclude>.gitignore</exclude>
                        <exclude>.git/**</exclude>
                        <!-- Intellij idea project files -->
                        <exclude>**/.idea/**</exclude>
                        <exclude>**/*.iml</exclude>
                        <!-- Maven build files -->
                        <exclude>**/target/**</exclude>
                        <!-- REEF run files -->
                        <exclude>**/REEF_LOCAL_RUNTIME/**</exclude>
                        <!-- Resources -->
                        <exclude>**/resources/**</exclude>
                        <!-- Logs -->
                        <exclude>**/*.log</exclude>
                        <!-- EditorConfig -->
                        <exclude>.editorconfig</exclude>
                        <!-- formatter.xml -->
                        <exclude>formatter.xml</exclude>
                        <!-- javadoc -->
                        <exclude>**/docs/**</exclude>
                        <!-- dag files -->
                        <exclude>**/dag/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
