最近想详细学习下hadoop的源码,就想把源码导入到eclipse里,其实如何操作在发布的hadoop源码的build文件里面有详细的介绍,但是还是记录下,防止再踩坑。
准备工作
根据build.txt文件中的描述,安装必要的程序,可以参考http://blog.csdn.net/stormragewang/article/details/50291223中的步骤。
Build instructions for Hadoop
----------------------------------------------------------------------------------
Requirements:
* 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 )
* Jansson C XML parsing library ( if compiling libwebhdfs )
* 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)
----------------------------------------------------------------------------------
配置maven国内库
maven默认的试apache的库,国内有镜像,配置好后能够加速构建的过程,参考http://www.cnblogs.com/errorx/p/3779578.html修改即可
开始构建
参考build.txt文件中的描述,首先在根目录下的hadoop-maven-plugins在执行"mvn install”,再在根目录