<?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. See accompanying LICENSE file.
-->
<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.hadoop</groupId>
    <artifactId>hadoop-project</artifactId>
    <version>2.7.2.0100-cloudtable</version>
    <relativePath>../../hadoop-project</relativePath>
  </parent>
  <groupId>org.apache.hadoop</groupId>
  <artifactId>hadoop-distcp</artifactId>
  <version>2.7.2.0100-cloudtable</version>
  <description>Apache Hadoop Distributed Copy</description>
  <name>Apache Hadoop Distributed Copy</name>
  <packaging>jar</packaging>

  <properties>
    <file.encoding>UTF-8</file.encoding>
    <downloadSources>true</downloadSources>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-annotations</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-mapreduce-client-app</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-mapreduce-client-hs</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-mapreduce-client-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-hdfs</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-hdfs</artifactId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-s3</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <scope>compile</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>always</forkMode>
          <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
          <argLine>-Xmx1024m</argLine>
          <includes>
            <include>**/Test*.java</include>
          </includes>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
          <systemProperties>
            <property>
              <name>test.build.data</name>
              <value>${basedir}/target/test/data</value>
            </property>
            <property>
              <name>hadoop.log.dir</name>
              <value>target/test/logs</value>
            </property>
            <property>
              <name>org.apache.commons.logging.Log</name>
              <value>org.apache.commons.logging.impl.SimpleLog</value>
            </property>
            <property>
              <name>org.apache.commons.logging.simplelog.defaultlog</name>
              <value>warn</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/lib</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <enableRulesSummary>true</enableRulesSummary>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.apache.hadoop.tools.DistCp</mainClass>
            </manifest>
            <manifestEntries>
                <Manifest-Version>1.0</Manifest-Version>
                <Archiver-Version>Plexus Archiver</Archiver-Version>
                <Created-By>Apache Maven</Created-By>
                <Build-Jdk>${java.version}</Build-Jdk>
               <Implementation-Version>${manifest.version}</Implementation-Version>
               <Implementation-Vendor-Id>org.apache.hadoop</Implementation-Vendor-Id>
               <Implementation-Title>${manifest.title}</Implementation-Title>
               <Implementation-Vendor>Huawei</Implementation-Vendor>
             </manifestEntries>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>prepare-jar</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
          <execution>
            <id>prepare-test-jar</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <configuration>
          <attach>true</attach>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>metrics</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.6</version>
            <configuration>
              <instrumentation>
              <ignores>
                 <ignore>org.apache.hadoop.*</ignore>
              </ignores>
              <excludes>
              <exclude>**/org/apache/hadoop/**/*.class</exclude>
              <exclude>com\huawei\hadoop\tools\ConfigurationCredentials.class</exclude>
              <exclude>com\huawei\hadoop\tools\CreateFileInfo.class</exclude>
              <exclude>com\huawei\hadoop\tools\CreateFileMapper.class</exclude>
              <exclude>com\huawei\hadoop\tools\CreateSampleData.class</exclude>
              <exclude>com\huawei\hadoop\tools\Main.class</exclude>
              <exclude>com\huawei\hadoop\tools\MultipartUploadOutputStream.class</exclude>
              <exclude>com\huawei\hadoop\tools\ProgressableResettableBufferedFileInputStream.class</exclude>
              <exclude>com\huawei\hadoop\tools\Utils.class</exclude>
              <exclude>com\huawei\hadoop\tools\ConfigurationCredentials*.class</exclude>
              <exclude>com\huawei\hadoop\tools\CreateFileInfo*.class</exclude>
              <exclude>com\huawei\hadoop\tools\CreateFileMapper*.class</exclude>
              <exclude>com\huawei\hadoop\tools\CreateSampleData*.class</exclude>
              <exclude>com\huawei\hadoop\tools\Main*.class</exclude>
              <exclude>com\huawei\hadoop\tools\MultipartUploadOutputStream*.class</exclude>
              <exclude>com\huawei\hadoop\tools\ProgressableResettableBufferedFileInputStream*.class</exclude>
              <exclude>com\huawei\hadoop\tools\Utils*.class</exclude>
			  <exclude>com\huawei\hadoop\tools\CopyFilesRunable*.class</exclude>
			  <exclude>com\huawei\hadoop\tools\Abortable*.class</exclude>
			  <exclude>com\huawei\hadoop\tools\ManifestEntry*.class</exclude>
			  <exclude>com\huawei\hadoop\tools\SimpleExecutor*.class</exclude>
			  <exclude>com\huawei\hadoop\tools\UDSDistCp$S3DistCpOptions.class</exclude>
              </excludes>
              <ignoreTrivial>true</ignoreTrivial>
              </instrumentation>
              <formats>
                <format>xml</format>
              </formats>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
</profiles>


</project>
