title: Ant BuildException error building Hadoop 2.4.1
body: <p>I am trying to install Hadoop 2.4.1 from source on Windows 7, I got the following error on the last stage. I searched for a solution, but to no avail.</p>
  <p>O/S Windows 7: 6.1 (32-bit)<br>
  Java: java version &quot;1.8.0_11&quot;<br>
  protoc 2.5.0 <br>
  Apache Maven 3.2.2</p>
  <p>I use this tutorials: <a href="https://wiki.apache.org/hadoop/Hadoop2OnWindows" rel="nofollow noreferrer">https://wiki.apache.org/hadoop/Hadoop2OnWindows</a> and <a href="https://www.srccodes.com/p/article/38/build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-os" rel="nofollow noreferrer">https://www.srccodes.com/p/article/38/build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-os</a></p>
  <p>Maven command:<code>mvn package -Pdist,native-win -DskipTests -Dtar</code> <br>
  Please help.</p>
  <p>Error code:<br></p>
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] Building Apache Hadoop Distribution 2.4.1
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] --- maven-antrun-plugin:1.7:run (create-testdirs) @ hadoop-dist ---
  [INFO] Executing tasks
  
  main:
  [INFO] Executed tasks
  [INFO]
  [INFO] --- maven-resources-plugin:2.2:resources (default-resources) @ hadoop-dist ---
  [INFO] Using default encoding to copy filtered resources.
  [INFO]
  [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hadoop-dist ---
  [INFO] No sources to compile
  [INFO]
  [INFO] --- maven-resources-plugin:2.2:testResources (default-testResources) @ hadoop-dist ---
  [INFO] Using default encoding to copy filtered resources.
  [INFO]
  [INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ hadoop-dist ---
  [INFO] No sources to compile
  [INFO]
  [INFO] --- maven-surefire-plugin:2.16:test (default-test) @ hadoop-dist ---
  [INFO] Tests are skipped.
  [INFO]
  [INFO] --- maven-antrun-plugin:1.7:run (dist) @ hadoop-dist ---
  [INFO] Executing tasks
  
  main:
       [exec]
       [exec] Current directory /cygdrive/c/hdc/hadoop-dist/target
       [exec]
       [exec] $ rm -rf hadoop-2.4.1
       [exec] $ mkdir hadoop-2.4.1
       [exec] $ cd hadoop-2.4.1
       [exec] $ cp -r /cygdrive/c/hdc/hadoop-common-project/hadoop-common/target/hadoop-common-2.4.1/bin /cygdrive/c/hdc/ha
  doop-common-project/hadoop-common/target/hadoop-common-2.4.1/etc /cygdrive/c/hdc/hadoop-common-project/hadoop-common/targ
  et/hadoop-common-2.4.1/libexec /cygdrive/c/hdc/hadoop-common-project/hadoop-common/target/hadoop-common-2.4.1/sbin /cygdr
  ive/c/hdc/hadoop-common-project/hadoop-common/target/hadoop-common-2.4.1/share .
       [exec] cp.exe: /cygdrive/c/hdc/hadoop-common-project/hadoop-common/target/hadoop-common-2.4.1/bin: No such file or d
  irectory
       [exec] cp.exe: /cygdrive/c/hdc/hadoop-common-project/hadoop-common/target/hadoop-common-2.4.1/etc: No such file or d
  irectory
       [exec] cp.exe: /cygdrive/c/hdc/hadoop-common-project/hadoop-common/target/hadoop-common-2.4.1/libexec: No such file
  or directory
       [exec] cp.exe: /cygdrive/c/hdc/hadoop-common-project/hadoop-common/target/hadoop-common-2.4.1/sbin: No such file or
  directory
       [exec] cp.exe: /cygdrive/c/hdc/hadoop-common-project/hadoop-common/target/hadoop-common-2.4.1/share: No such file or
   directory
       [exec]
       [exec] Failed!
       [exec]
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Summary:
  [INFO]
  [INFO] Apache Hadoop Main ................................. SUCCESS [  4.006 s]
  [INFO] Apache Hadoop Project POM .......................... SUCCESS [  1.592 s]
  [INFO] Apache Hadoop Annotations .......................... SUCCESS [  4.343 s]
  [INFO] Apache Hadoop Assemblies ........................... SUCCESS [  0.233 s]
  [INFO] Apache Hadoop Project Dist POM ..................... SUCCESS [  3.262 s]
  [INFO] Apache Hadoop Maven Plugins ........................ SUCCESS [  4.871 s]
  [INFO] Apache Hadoop MiniKDC .............................. SUCCESS [  4.450 s]
  [INFO] Apache Hadoop Auth ................................. SUCCESS [  3.150 s]
  [INFO] Apache Hadoop Auth Examples ........................ SUCCESS [  3.384 s]
  [INFO] Apache Hadoop Common ............................... SUCCESS [02:26 min]
  [INFO] Apache Hadoop NFS .................................. SUCCESS [  9.297 s]
  [INFO] Apache Hadoop Common Project ....................... SUCCESS [  0.058 s]
  [INFO] Apache Hadoop HDFS ................................. SUCCESS [03:31 min]
  [INFO] Apache Hadoop HttpFS ............................... SUCCESS [ 34.454 s]
  [INFO] Apache Hadoop HDFS BookKeeper Journal .............. SUCCESS [  9.568 s]
  [INFO] Apache Hadoop HDFS-NFS ............................. SUCCESS [  4.962 s]
  [INFO] Apache Hadoop HDFS Project ......................... SUCCESS [  0.071 s]
  [INFO] hadoop-yarn ........................................ SUCCESS [  0.055 s]
  [INFO] hadoop-yarn-api .................................... SUCCESS [ 42.210 s]
  [INFO] hadoop-yarn-common ................................. SUCCESS [ 36.877 s]
  [INFO] hadoop-yarn-server ................................. SUCCESS [  0.048 s]
  [INFO] hadoop-yarn-server-common .......................... SUCCESS [  7.941 s]
  [INFO] hadoop-yarn-server-nodemanager ..................... SUCCESS [ 14.402 s]
  [INFO] hadoop-yarn-server-web-proxy ....................... SUCCESS [  2.625 s]
  [INFO] hadoop-yarn-server-applicationhistoryservice ....... SUCCESS [  4.543 s]
  [INFO] hadoop-yarn-server-resourcemanager ................. SUCCESS [ 16.911 s]
  [INFO] hadoop-yarn-server-tests ........................... SUCCESS [  1.438 s]
  [INFO] hadoop-yarn-client ................................. SUCCESS [  3.495 s]
  [INFO] hadoop-yarn-applications ........................... SUCCESS [  0.042 s]
  [INFO] hadoop-yarn-applications-distributedshell .......... SUCCESS [  2.033 s]
  [INFO] hadoop-yarn-applications-unmanaged-am-launcher ..... SUCCESS [  1.682 s]
  [INFO] hadoop-yarn-site ................................... SUCCESS [  0.051 s]
  [INFO] hadoop-yarn-project ................................ SUCCESS [  3.453 s]
  [INFO] hadoop-mapreduce-client ............................ SUCCESS [  0.117 s]
  [INFO] hadoop-mapreduce-client-core ....................... SUCCESS [ 33.057 s]
  [INFO] hadoop-mapreduce-client-common ..................... SUCCESS [ 23.963 s]
  [INFO] hadoop-mapreduce-client-shuffle .................... SUCCESS [  2.181 s]
  [INFO] hadoop-mapreduce-client-app ........................ SUCCESS [ 13.202 s]
  [INFO] hadoop-mapreduce-client-hs ......................... SUCCESS [  8.889 s]
  [INFO] hadoop-mapreduce-client-jobclient .................. SUCCESS [  7.842 s]
  [INFO] hadoop-mapreduce-client-hs-plugins ................. SUCCESS [  1.379 s]
  [INFO] Apache Hadoop MapReduce Examples ................... SUCCESS [  5.019 s]
  [INFO] hadoop-mapreduce ................................... SUCCESS [  3.700 s]
  [INFO] Apache Hadoop MapReduce Streaming .................. SUCCESS [  3.600 s]
  [INFO] Apache Hadoop Distributed Copy ..................... SUCCESS [ 12.786 s]
  [INFO] Apache Hadoop Archives ............................. SUCCESS [  2.083 s]
  [INFO] Apache Hadoop Rumen ................................ SUCCESS [  6.695 s]
  [INFO] Apache Hadoop Gridmix .............................. SUCCESS [  4.275 s]
  [INFO] Apache Hadoop Data Join ............................ SUCCESS [  1.995 s]
  [INFO] Apache Hadoop Extras ............................... SUCCESS [  2.223 s]
  [INFO] Apache Hadoop Pipes ................................ SUCCESS [  0.042 s]
  [INFO] Apache Hadoop OpenStack support .................... SUCCESS [  4.186 s]
  [INFO] Apache Hadoop Client ............................... SUCCESS [  7.937 s]
  [INFO] Apache Hadoop Mini-Cluster ......................... SUCCESS [  0.158 s]
  [INFO] Apache Hadoop Scheduler Load Simulator ............. SUCCESS [  3.874 s]
  [INFO] Apache Hadoop Tools Dist ........................... SUCCESS [  5.658 s]
  [INFO] Apache Hadoop Tools ................................ SUCCESS [  0.038 s]
  [INFO] Apache Hadoop Distribution ......................... FAILURE [  2.740 s]
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 12:23 min
  [INFO] Finished at: 2014-07-18T17:43:34+04:00
  [INFO] Final Memory: 65M/238M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-dist: An Ant
   BuildException has occured: exec returned: 1
  [ERROR] around Ant part ...&lt;exec failonerror=&quot;true&quot; dir=&quot;C:\hdc\hadoop-dist\target&quot; executable=&quot;sh&quot;&gt;... @ 34:76 in C:\hdc
  \hadoop-dist\target\antrun\build-main.xml
  [ERROR] -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  [ERROR]
  [ERROR] After correcting the problems, you can resume the build with the command
  [ERROR]   mvn &lt;goals&gt; -rf :hadoop-dist
  </code></pre>