<!--

    The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
    (the "License"). You may not use this work except in compliance with the License, which is
    available at www.apache.org/licenses/LICENSE-2.0

    This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
    either express or implied, as more fully set forth in the License.

    See the NOTICE file distributed with this work for information regarding copyright ownership.

-->
<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>
  <groupId>org.alluxio</groupId>
  <artifactId>alluxio-parent</artifactId>
  <version>1.2.0</version>
  <packaging>pom</packaging>
  <name>Alluxio Parent</name>
  <description>Parent POM of Alluxio project: a Memory-Speed Virtual Distributed Storage System</description>
  <url>http://alluxio.org/</url>
  <licenses>
    <license>
      <name>Apache License</name>
      <url>https://github.com/alluxio/alluxio/blob/master/LICENSE</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git@github.com:alluxio/alluxio.git</connection>
    <developerConnection>scm:git:git@github.com:alluxio/alluxio.git</developerConnection>
    <url>scm:git:git@github.com:alluxio/alluxio.git</url>
    <tag>v1.2.0</tag>
  </scm>
  <developers>
    <developer>
      <id>haoyuan</id>
      <name>Haoyuan Li</name>
      <email>haoyuan@alluxio.com</email>
      <url>http://www.cs.berkeley.edu/~haoyuan</url>
      <organization>Alluxio Open Foundation</organization>
      <organizationUrl>http://alluxio.org/</organizationUrl>
    </developer>
  </developers>
  <issueManagement>
    <system>jira</system>
    <url>https://alluxio.atlassian.net</url>
  </issueManagement>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <repositories>
    <repository>
      <id>central</id>
      <!-- This should be at top, it makes maven try the central repo first and then others and hence faster dep resolution -->
      <name>Maven Repository</name>
      <url>https://repo1.maven.org/maven2</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>apache-repo</id>
      <name>Apache Repository</name>
      <url>https://repository.apache.org/content/repositories/releases</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>cloudera-repo</id>
      <name>Cloudera Repository</name>
      <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>mapr-repo</id>
      <name>MapR Repository</name>
      <url>http://repository.mapr.com/maven</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <!-- for Pivotal's distribution -->
      <id>spring-releases</id>
      <name>Spring Release Repository</name>
      <url>http://repo.spring.io/libs-release</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>HDPReleases</id>
      <name>HDP Releases</name>
      <url>http://repo.hortonworks.com/content/repositories/releases/</url>
      <layout>default</layout>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
        <checksumPolicy>warn</checksumPolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
        <updatePolicy>never</updatePolicy>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>miredot</id>
      <name>MireDot Releases</name>
      <url>http://nexus.qmino.com/content/repositories/miredot</url>
    </pluginRepository>
  </pluginRepositories>

  <properties>
    <apache.curator.version>2.1.0-incubating</apache.curator.version>
    <aws.amazonaws.version>1.11.7</aws.amazonaws.version>
    <checkstyle.path>build/checkstyle/</checkstyle.path>
    <cxf.version>2.7.0</cxf.version>
    <findbugs.path>build/findbugs</findbugs.path>
    <glusterfs-hadoop.version>2.3.13</glusterfs-hadoop.version>
    <hadoop.version>2.2.0</hadoop.version>
    <java.version>1.7</java.version>
    <jersey.version>2.22</jersey.version>
    <jetty.version>7.6.15.v20140411</jetty.version>
    <junit.version>4.12</junit.version>
    <libthrift.version>0.9.3</libthrift.version>
    <license.header.path>build/license/</license.header.path>
    <log4j.version>1.2.17</log4j.version>
    <metrics.version>3.1.0</metrics.version>
    <powermock.version>1.6.1</powermock.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <slf4j.version>1.7.2</slf4j.version>
    <test.output.redirect>true</test.output.redirect>
    <hadoop-openstack.version>2.6.0</hadoop-openstack.version>
    <surefire.useSystemClassLoader>true</surefire.useSystemClassLoader>
  </properties>

  <modules>
    <module>underfs</module>
    <module>core</module>
    <module>keyvalue</module>
    <module>shell</module>
    <module>examples</module>
    <module>tests</module>
    <module>integration</module>
    <module>assembly</module>
    <module>minicluster</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <!-- using older version to map dependency version from Hadoop -->
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>14.0.1</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.mesos</groupId>
        <artifactId>mesos</artifactId>
        <version>0.23.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-client</artifactId>
        <version>${hadoop.version}</version>
        <exclusions>
          <exclusion>
            <groupId>asm</groupId>
            <artifactId>asm</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.netty</groupId>
            <artifactId>netty</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-minicluster</artifactId>
        <version>${hadoop.version}</version>
        <exclusions>
          <exclusion>
            <groupId>asm</groupId>
            <artifactId>asm</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.jboss.netty</groupId>
            <artifactId>netty</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.thrift</groupId>
        <artifactId>libthrift</artifactId>
        <version>${libthrift.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
          </exclusion>
        </exclusions>
      </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>

      <!-- Test Dependencies -->
      <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-test</artifactId>
        <version>${apache.curator.version}</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-test</artifactId>
        <version>${hadoop.version}</version>
        <scope>test</scope>
      </dependency>

      <!--
          Dependency for FindBugs Plugin. This enables @SuppressFBWarnings.
          Note that this package can be unnecessary for runtime, and the
          'provided' scope makes it available for compilation and test,
          but not be packaged into the jar.
        -->
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>annotations</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <!-- Dependencies to add to all projects. These should all be in the test scope -->
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.10.8</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-core</artifactId>
      <version>${powermock.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-reflect</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.2</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <encoding>UTF-8</encoding>
            <maxmem>1024m</maxmem>
            <compilerArgs>
              <arg>-Xlint:none</arg>
            </compilerArgs>
            <excludes>
              <exclude>**/\${alluxio.hadoop2.impl}</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.14</version>
          <configuration>
            <argLine>-Djava.net.preferIPv4Stack=true -XX:MaxPermSize=512M</argLine>
            <redirectTestOutputToFile>${test.output.redirect}</redirectTestOutputToFile>
            <useSystemClassLoader>${surefire.useSystemClassLoader}</useSystemClassLoader>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.4</version>
          <configuration>
            <excludes>
              <exclude>**/log4j.properties</exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <skipAssembly>true</skipAssembly>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <executions>
          <execution>
            <id>aggregate</id>
            <goals>
              <goal>aggregate</goal>
            </goals>
          </execution>
          <execution>
            <id>attach-javadoc</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Parse Hadoop major version and resolve the compilation conflict between Hadoop 1.x and 2.x -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.10</version>
        <executions>
          <execution>
            <id>parse-hadoop-major-version</id>
            <goals>
              <goal>regex-property</goal>
            </goals>
            <configuration>
              <name>alluxio.hadoop2.impl</name>
              <value>${hadoop.version}</value>
              <regex>^1\..*$</regex>
              <replacement>AlluxioFileSystem.java</replacement>
              <failIfNoMatch>false</failIfNoMatch>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Enforce versions -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4</version>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>${java.version}</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- FindBugs -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <excludeFilterFile>${findbugs.path}/findbugs-exclude.xml</excludeFilterFile>
          <!--
              Enables analysis which takes more memory but finds more bugs.
              If you run out of memory, changes the value of the effort element
              to 'Low'.
            -->
          <effort>Max</effort>
          <failOnError>true</failOnError>
          <threshold>Low</threshold>
          <findbugsXmlOutput>true</findbugsXmlOutput>
          <xmlOutput>true</xmlOutput>
        </configuration>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Checkstyle -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <configLocation>${checkstyle.path}alluxio_checks.xml</configLocation>
          <suppressionsLocation>${checkstyle.path}suppressions.xml</suppressionsLocation>
          <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <excludes>**/org/apache/jsp/**,**/alluxio/thrift/**,**/alluxio/proto/**</excludes>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <linkXRef>false</linkXRef>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- License Plugin -->
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <header>${license.header.path}HEADER.txt</header>
          <failIfMissing>true</failIfMissing>
          <aggregate>false</aggregate>
          <excludes>

            <!-- Code Exclusions -->
            <exclude>**/src/main/java/alluxio/thrift/*</exclude>
            <exclude>**/src/main/java/alluxio/proto/**</exclude>
            <exclude>**/src/main/java/alluxio/perf/thrift/*</exclude>
            <exclude>**/src/main/resources/*</exclude>
            <exclude>**/src/main/webapp/css/*</exclude>
            <exclude>**/src/main/webapp/js/*</exclude>
            <exclude>**/src/thrift/*</exclude>
            <exclude>**/src/proto/**</exclude>
            <exclude>**/src/deb/**/*</exclude>
            <exclude>**/src/test/resources/**</exclude>
            <exclude>**/vagrant/**/*</exclude>

            <!-- Build and Packaging Exclusions -->
            <exclude>build/**/*</exclude>
            <exclude>**/.checkstyle</exclude>
            <exclude>**/src/main/assembly/*</exclude>

            <!-- Documentation Exclusions -->
            <exclude>docs/**/*</exclude>
            <exclude>LICENSE</exclude>
            <exclude>NOTICE</exclude>

            <!-- Default Local File System Exclusions -->
            <exclude>logs/*</exclude>
            <exclude>journal/**/*</exclude>
            <exclude>underFSStorage/**/*</exclude>
          </excludes>
          <mapping>
            <alluxio>SCRIPT_STYLE</alluxio>
            <java>SLASHSTAR_STYLE</java>
            <properties.template>SCRIPT_STYLE</properties.template>
            <sh.template>SCRIPT_STYLE</sh.template>
            <workers>SCRIPT_STYLE</workers>
            <xml.template>XML_STYLE</xml.template>
          </mapping>
          <useDefaultMapping>true</useDefaultMapping>
          <strictCheck>true</strictCheck>
        </configuration>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <show>public</show>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <!-- Turn off doclint for java8 and later -->
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9</version>
            <configuration>
              <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>contractTest</id>
      <properties>
        <hadoop.version>2.6.0</hadoop.version>
      </properties>
    </profile>

    <profile>
      <id>hadoop-1</id>
      <properties>
        <hadoop.version>1.0.4</hadoop.version>
      </properties>
    </profile>

    <profile>
      <id>hadoop-2.2</id>
      <properties>
        <hadoop.version>2.2.0</hadoop.version>
      </properties>
    </profile>

    <profile>
      <id>hadoop-2.3</id>
      <properties>
        <hadoop.version>2.3.0</hadoop.version>
      </properties>
    </profile>

    <profile>
      <id>hadoop-2.4</id>
      <properties>
        <hadoop.version>2.4.0</hadoop.version>
      </properties>
    </profile>

    <profile>
      <id>hadoop-2.6</id>
      <properties>
        <hadoop.version>2.6.0</hadoop.version>
      </properties>
    </profile>

    <profile>
      <id>hadoop-2.7</id>
      <properties>
        <hadoop.version>2.7.0</hadoop.version>
      </properties>
    </profile>

    <!--
        build profile for Apache Spark.
        Empty spark profile to avoid missing profile complaints. Client
        submodules do more interesting things with this profile.
    -->
    <profile>
      <id>spark</id>
    </profile>

    <!--
        build profile for Apache Flink.
        Empty flinkprofile to avoid missing profile complaints. Client
        submodules do more interesting things with this profile.
    -->
    <profile>
      <id>flink</id>
    </profile>

    <profile>
      <id>mesos</id>
      <modules>
        <module>integration/mesos</module>
      </modules>
    </profile>

    <!-- Requires hadoop.version to be 2.4.0 or later -->
    <profile>
      <id>yarn</id>
      <modules>
        <module>integration/yarn</module>
      </modules>
    </profile>

    <!-- profile that Alluxio developers should use -->
    <profile>
      <id>developer</id>
      <modules>
        <module>integration/yarn</module>
        <module>integration/mesos</module>
      </modules>
      <properties>
        <hadoop.version>2.6.0</hadoop.version>
      </properties>
    </profile>

    <!-- profile that compiles jsp files -->
    <profile>
      <id>compileJsp</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.sling</groupId>
              <artifactId>maven-jspc-plugin</artifactId>
              <version>2.0.8</version>
              <executions>
                <execution>
                  <phase>prepare-package</phase>
                  <id>compile-jsp</id>
                  <goals>
                    <goal>jspc</goal>
                  </goals>
                  <configuration>
                    <sourceDirectory>src/main/webapp</sourceDirectory>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <!-- profile that activates alluxio fuse for java8 or newer -->
    <profile>
      <id>fuse</id>
      <activation>
        <jdk>[1.8,)</jdk> <!-- 1.8 or newer -->
      </activation>
      <modules>
        <module>integration/fuse</module>
      </modules>
    </profile>
  </profiles>
</project>
