<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2013 Cloudera 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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <artifactId>kite-tools</artifactId>

  <parent>
    <groupId>org.kitesdk</groupId>
    <artifactId>kite-tools-parent</artifactId>
    <version>1.0.0-cdh5.12.1</version>
  </parent>

  <name>Kite Tools Runtime Module</name>
  <description>
    The Kite Tools module provides command-line tools for performing common
    tasks with Kite.
  </description>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <!-- commented out due to org.apache.hadoop.filecache.DistributedCache deprecations in Hadoop 2 -->
            <!-- <arg>-Werror</arg> --> <!-- fail on warnings -->
            <!-- <arg>-Xlint:-options</arg> --> <!-- ignore cross-compilation warning -->
            <arg>-Xlint:unchecked</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal> <!-- publish test-jar for other modules -->
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <configuration>
          <excludeFilterFile>${project.basedir}/findbugs-exclude.xml</excludeFilterFile>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptor>src/main/assembly/runtime.xml</descriptor>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- make a chmod +x style executable from the jar -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <executable>/bin/sh</executable>
          <arguments>
            <argument>src/main/sh/build-executable.sh</argument>
            <argument>src/main/sh/dataset.sh</argument>
            <argument>target/${project.artifactId}-${project.version}-runtime.jar</argument>
            <argument>target/kite-dataset</argument>
          </arguments>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.directory}/kite-dataset</file>
                  <classifier>binary</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.avro</groupId>
        <artifactId>avro-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>schema</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <!--
    Seems like these reporting plugins aren't properly inherited from the parent
    pom's pluginManagement. The docs say it's supposed to work.
  -->
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${vers.maven-project-info-reports-plugin}</version>
        <configuration>
          <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>index</report>
              <report>summary</report>
              <report>dependency-info</report>
              <report>dependencies</report>
              <report>license</report>
              <report>project-team</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${vers.maven-javadoc-plugin}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <dependencies>

    <!-- The Hadoop and HBase dependency bundles are not inherited -->

    <dependency>
      <groupId>org.kitesdk</groupId>
      <artifactId>${artifact.hadoop-deps}</artifactId>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.kitesdk</groupId>
      <artifactId>${artifact.hbase-deps}</artifactId>
      <type>pom</type>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>

  </dependencies>

</project>
