编译hadoop源码遇到问题 及时解决


最近在研究hadoop,在用maven编译源码的过程中出现了个错误,一直编译过不去:


[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:58.734s
[INFO] Finished at: Tue Jan 08 18:39:18 CST 2013
[INFO] Final Memory: 29M/71M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (compile-proto) on project hadoop-common: An Ant BuildException has occured: exec returned: 127 -> [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


各种查找之后,经过网上的大量查找之后发现原因:


原因:hadoop-1.0.1需要maven3.0+和protoc2.4+,以上错误是protoc版本过低导致的.

The Maven embedder provider with the system plugin ($IDEA_HOME/plugins/maven/lib) is named maven-embedder-1.1-SNAPSHOT.jar, which seems a rather bad version for a released project.
But the big issue for us is that is is bundling Maven 2.2.1.
When using the maven-enforcer-plugin in a project, and forcing Maven version to be  >= 3.0.2, the _generate sources_ action, which used the Maven embedder, fails saying: Detected Maven Version: 2.2.1 is not in the allowed range 3.0.2.
Unlike before, decent Maven embedders now exist (http://repo1.maven.org/maven2/org/apache/maven/maven-embedder/)
As we are using XMLBeans in some modules, that leads to compile issues.
Workaround: Use "external" Maven runner (lifecycle phases launch), but that is really annoying.
Could it be possible to update the embedder, or being able to choose to always use the external runner?


于是马上重新安装了protoc2.4(转)


第一部分:windows7 安装 protocol buffer  (如果没有安装Maven,先安装maven,并且maven -version 验证安装成功)

 

1. 下载地址: http://code.google.com/p/protobuf/downloads/list 。从这里下载protobuf-2.4.1.tar.gz 和 protoc-2.4.1-win32.zip 两个包。分别解压到各自目录。

2. 将protoc-2.4.1-win32中的protoc.exe拷贝到c:\windows\system32中。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值