在Windows中通过Maven构建Hadoop会导致失败

时间:2015-08-06 07:56:05

标签: windows maven hadoop

我打算在Windows设置中开发Hadoop 我首先开始安装如下。

  • cygwin,cmake,maven,Protocol Buffer 2.5,Windows SDK v7.1

然后我将变量设置如下。

  • M2_HOME = d:\的java \ Apache的行家-3.2.1
  • 平台=的Win32

我将C:\cygwin\bin;%M2_HOME%\bin;D:\java\protoc-2.5.0-win32;添加到路径

并输入Hadoop root并运行- mvn package -Pdist,native-win -DskipTests -Dtar 从Windows SDK 7.1命令提示符

  

(略)   [INFO] Apache Hadoop Common ............................. FAILURE [32.778 s]   (略)   [错误]无法执行目标org.codehaus.mojo:exec-maven-plugin:1.3.1:exec   (complie-ms-winutils)关于项目hadoop-common:命令执行   zhcon失败。退出并出现错误:1(退出值:1) - > [帮助1]   (略)

完整日志网址:http://pastebin.com/WAYezZmv

上述错误不断发生,导致建筑物连续失效。 如果有人能帮助找到问题的解决方案,那么您的见解将不胜感激! 谢谢!!

1 个答案:

答案 0 :(得分:0)

这在Hadoop中不是问题。但我发现了根本原因,所以你可以自己解决问题。

检查日志时,问题是因为带有.Net Framework 4.5的Windows SDK v7.1

<强>异常

"D:\hdc\hadoop-common-project\hadoop-common\target\bin\libwinutils.lib" libwinutils.lib(libwinutils.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
Generating code
Finished generating code
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [D:\hdc\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj]
"D:\hdc\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj" 프로젝트를 빌드했습니다(기본 대상). - 실패
"D:\hdc\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" 프로젝트를 빌드했습니다(기본 대상). - 실패
"D:\hdc\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" 프로젝트를 빌드했습니다(기본 대상). - 실패  

实际例外是

fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

您可以谷歌查找解决方案。当我搜索时,粘贴下面这个问题的链接

LNK1123 Error
LNK1123
Error 'LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt' after installing Visual Studio 2012 Release Preview
Failure during conversion to COFF: file invalid or corrupt