re-compile hadoop failed on mac : An Ant BuildException has occured: exec returned: 2

Viewed 746

prepare:

macOS Sierra 10.12.5
hadoop-2.8.0-src

and I've read BUILDING.txt

Requirements as follow:

* Unix System
* JDK 1.7+
* Maven 3.0 or later
* Findbugs 1.3.9 (if running findbugs)
* ProtocolBuffer 2.5.0
* CMake 2.6 or newer (if compiling native code), must be 3.0 or newer on Mac
* Zlib devel (if compiling native code)
* openssl devel (if compiling native hadoop-pipes and to get the best HDFS encryption performance)
* Linux FUSE (Filesystem in Userspace) version 2.6 or above (if compiling fuse_dfs)
* Internet connection for first build (to fetch all Maven and Hadoop dependencies)

on my machine:

 MMMMMCCLXXVII ⮀ hadoop-2.8.0-src ⮀  mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.5", arch: "x86_64", family: "mac"




MMMMMCCLXXVII ⮀ hadoop-2.8.0-src ⮀ java -version                                                                              
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)


 MMMMMCCLXXVII ⮀ hadoop-2.8.0-src ⮀ protoc --version                                                                           
libprotoc 2.5.0


 MMMMMCCLXXVII ⮀ hadoop-2.8.0-src ⮀ cmake -version                                                                             
cmake version 3.8.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

I've been told Zlib can be installed by running xcode-select --install Also, I install openssl by brew. Some reference says I should run brew link openssl --force after brew install openssl, but failed and didn't see it's necessity.

MMMMMCCLXXVII ⮀ hadoop-2.8.0-src ⮀ brew link openssl --force                                                                  
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
  -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

Above is preparation. And I failed in the stage of compiling hadoop common.

....
[INFO] Apache Hadoop Auth ................................. SUCCESS [  3.375 s]
[INFO] Apache Hadoop Auth Examples ........................ SUCCESS [  2.518 s]
[INFO] Apache Hadoop Common ............................... FAILURE [  4.272 s]
[INFO] Apache Hadoop NFS .................................. SKIPPED
[INFO] Apache Hadoop KMS .................................. SKIPPED
....

Reason as follow:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.337 s
[INFO] Finished at: 2017-06-03T11:20:12+08:00
[INFO] Final Memory: 73M/725M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (make) on project hadoop-common: An Ant BuildException has occured: exec returned: 2
[ERROR] around Ant part ...<exec failonerror="true" dir="/Users/Crayon_277/Develop/Project/hadoop/hadoop-2.8.0-src/hadoop-common-project/hadoop-common/target/native" executable="make">... @ 7:160 in /Users/Crayon_277/Develop/Project/hadoop/hadoop-2.8.0-src/hadoop-common-project/hadoop-common/target/antrun/build-main.xml
[ERROR] -> [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 <goals> -rf :hadoop-common

main error is

Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (make) on project hadoop-common: An Ant BuildException has occured: exec returned: 2

around Ant part ...... @ 7:160 in /Users/Crayon_277/Develop/Project/hadoop/hadoop-2.8.0-src/hadoop-common-project/hadoop-common/target/antrun/build-main.xml

Any solution???

0 Answers
Related