在mac上重新编译hadoop失败:发生了一个Ant BuildException:exec返回:2

时间:2017-06-03 03:36:24

标签: maven hadoop ant

制备

macOS Sierra 10.12.5
hadoop-2.8.0-src

我读过BUILDING.txt

要求如下:

* 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)

在我的机器上:

 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).

我被告知可以通过运行Zlib来安装xcode-select --install 另外,我通过brew安装openssl。一些参考文献说我应该在brew link openssl --force之后运行brew install openssl,但是失败了并且没有看到它是必要的。

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

以上是准备。 我在编译hadoop共同的阶段失败了。

....
[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
....

原因如下:

[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

主要错误是

无法执行目标org.apache.maven.plugins:maven-antrun-plugin:1.7:在项目上运行(make)hadoop-common:发生了一个Ant BuildException:exec返回:2

围绕Ant部分...... @ 7:160 in /Users/Crayon_277/Develop/Project/hadoop/hadoop-2.8.0-src/hadoop-common-project/hadoop-common/target /antrun/build-main.xml

任何解决方案???

0 个答案:

没有答案