分享

从零教你如何获取hadoop2.4源码并使用eclipse关联hadoop2.4源码

问题导读:
1.如何通过官网src包,获取hadoop的全部代码
2.通过什么样的操作,可以查看hadoop某个函数或则类的实现?
3.maven的作用是什么?






我们如果想搞开发,研究源码对我们的帮助很大。不明白原理就如同黑盒子,遇到问题,我们也摸不着思路。所以这里交给大家
一.如何获取源码
二.如何关联源码

一.如何获取源码

1.下载hadoop的maven程序包

(1)官网下载
这里我们先从官网上下载maven包hadoop-2.4.0-src.tar.gz。
官网下载地址

对于不知道怎么去官网下载,可以查看:新手指导:hadoop官网介绍及如何下载hadoop(2.4)各个版本与查看hadoop API介绍

(2)网盘下载
也可以从网盘下载:
http://pan.baidu.com/s/1kToPuGB

2.通过maven获取源码
获取源码的方式有两种,一种是通过命令行的方式,一种是通过eclipse。这里主要讲通过命令的方式

通过命令的方式获取源码:
1.解压包

window解压包.png


解压包的时候遇到了下面问题。不过不用管,我们继续往下走
1        : 无法创建文件:D:\hadoop2\hadoop-2.4.0-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-applicationhistoryservice\target\classes\org\apache\hadoop\yarn\server\applicationhistoryservice\ApplicationHistoryClientService$ApplicationHSClientProtocolHandler.class:
路径和文件名总长度不能超过260个字符
系统找不到指定的路径。        D:\hadoop2\hadoop-2.4.0-src.zip
2        : 无法创建文件:D:\hadoop2\hadoop-2.4.0-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-applicationhistoryservice\target\classes\org\apache\hadoop\yarn\server\applicationhistoryservice\timeline\LeveldbTimelineStore$LockMap$CountingReentrantLock.class:系统找不到指定的路径。        D:\hadoop2\hadoop-2.4.0-src.zip
3        : 无法创建文件:D:\hadoop2\hadoop-2.4.0-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-applicationhistoryservice\target\test-classes\org\apache\hadoop\yarn\server\applicationhistoryservice\webapp\TestAHSWebApp$MockApplicationHistoryManagerImpl.class:系统找不到指定的路径。        D:\hadoop2\hadoop-2.4.0-src.zip
4        : 无法创建文件:D:\hadoop2\hadoop-2.4.0-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-resourcemanager\target\test-classes\org\apache\hadoop\yarn\server\resourcemanager\monitor\capacity\TestProportionalCapacityPreemptionPolicy$IsPreemptionRequestFor.class:
路径和文件名总长度不能超过260个字符
系统找不到指定的路径。        D:\hadoop2\hadoop-2.4.0-src.zip
5        : 无法创建文件:D:\hadoop2\hadoop-2.4.0-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-resourcemanager\target\test-classes\org\apache\hadoop\yarn\server\resourcemanager\recovery\TestFSRMStateStore$TestFSRMStateStoreTester$TestFileSystemRMStore.class:系统找不到指定的路径。        D:\hadoop2\hadoop-2.4.0-src.zip
6        : 无法创建文件:D:\hadoop2\hadoop-2.4.0-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-resourcemanager\target\test-classes\org\apache\hadoop\yarn\server\resourcemanager\recovery\TestZKRMStateStore$TestZKRMStateStoreTester$TestZKRMStateStoreInternal.class:
路径和文件名总长度不能超过260个字符
系统找不到指定的路径。        D:\hadoop2\hadoop-2.4.0-src.zip
7        : 无法创建文件:D:\hadoop2\hadoop-2.4.0-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-resourcemanager\target\test-classes\org\apache\hadoop\yarn\server\resourcemanager\recovery\TestZKRMStateStoreZKClientConnections$TestZKClient$TestForwardingWatcher.class:
路径和文件名总长度不能超过260个字符
系统找不到指定的路径。        D:\hadoop2\hadoop-2.4.0-src.zip
8        : 无法创建文件:D:\hadoop2\hadoop-2.4.0-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-resourcemanager\target\test-classes\org\apache\hadoop\yarn\server\resourcemanager\recovery\TestZKRMStateStoreZKClientConnections$TestZKClient$TestZKRMStateStore.class:
路径和文件名总长度不能超过260个字符
系统找不到指定的路径。        D:\hadoop2\hadoop-2.4.0-src.zip
9        : 无法创建文件:D:\hadoop2\hadoop-2.4.0-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-resourcemanager\target\test-classes\org\apache\hadoop\yarn\server\resourcemanager\rmapp\attempt\TestRMAppAttemptTransitions$TestApplicationAttemptEventDispatcher.class:
路径和文件名总长度不能超过260个字符
系统找不到指定的路径。        D:\hadoop2\hadoop-2.4.0-src.zip


2.通过maven获取源码


这里需要说明的是,在使用maven的时候,需要先安装jdk,protoc ,如果没有安装可以参考win7如何安装maven、安装protoc

(1)进入hadoop-2.4.0-src\hadoop-maven-plugins,运行mvn install
  1. D:\hadoop2\hadoop-2.4.0-src\hadoop-maven-plugins>mvn install
复制代码


显示如下信息
  1. [INFO] Scanning for projects...
  2. [WARNING]
  3. [WARNING] Some problems were encountered while building the effective model for
  4. org.apache.hadoop:hadoop-maven-plugins:maven-plugin:2.4.0
  5. [WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found d
  6. uplicate declaration of plugin org.apache.maven.plugins:maven-enforcer-plugin @
  7. org.apache.hadoop:hadoop-project:2.4.0, D:\hadoop2\hadoop-2.4.0-src\hadoop-proje
  8. ct\pom.xml, line 1015, column 15
  9. [WARNING]
  10. [WARNING] It is highly recommended to fix these problems because they threaten t
  11. he stability of your build.
  12. [WARNING]
  13. [WARNING] For this reason, future Maven versions might no longer support buildin
  14. g such malformed projects.
  15. [WARNING]
  16. [INFO]
  17. [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethrea
  18. ded.SingleThreadedBuilder with a thread count of 1
  19. [INFO]
  20. [INFO] ------------------------------------------------------------------------
  21. [INFO] Building Apache Hadoop Maven Plugins 2.4.0
  22. [INFO] ------------------------------------------------------------------------
  23. [INFO]
  24. [INFO] --- maven-antrun-plugin:1.7:run (create-testdirs) @ hadoop-maven-plugins
  25. ---
  26. [INFO] Executing tasks
  27. main:
  28. [INFO] Executed tasks
  29. [INFO]
  30. [INFO] --- maven-plugin-plugin:3.0:descriptor (default-descriptor) @ hadoop-mave
  31. n-plugins ---
  32. [INFO] Using 'UTF-8' encoding to read mojo metadata.
  33. [INFO] Applying mojo extractor for language: java-annotations
  34. [INFO] Mojo extractor for language: java-annotations found 2 mojo descriptors.
  35. [INFO] Applying mojo extractor for language: java
  36. [INFO] Mojo extractor for language: java found 0 mojo descriptors.
  37. [INFO] Applying mojo extractor for language: bsh
  38. [INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
  39. [INFO]
  40. [INFO] --- maven-resources-plugin:2.2:resources (default-resources) @ hadoop-mav
  41. en-plugins ---
  42. [INFO] Using default encoding to copy filtered resources.
  43. [INFO]
  44. [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hadoop-maven-
  45. plugins ---
  46. [INFO] Nothing to compile - all classes are up to date
  47. [INFO]
  48. [INFO] --- maven-plugin-plugin:3.0:descriptor (mojo-descriptor) @ hadoop-maven-p
  49. lugins ---
  50. [INFO] Using 'UTF-8' encoding to read mojo metadata.
  51. [INFO] Applying mojo extractor for language: java-annotations
  52. [INFO] Mojo extractor for language: java-annotations found 2 mojo descriptors.
  53. [INFO] Applying mojo extractor for language: java
  54. [INFO] Mojo extractor for language: java found 0 mojo descriptors.
  55. [INFO] Applying mojo extractor for language: bsh
  56. [INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
  57. [INFO]
  58. [INFO] --- maven-resources-plugin:2.2:testResources (default-testResources) @ ha
  59. doop-maven-plugins ---
  60. [INFO] Using default encoding to copy filtered resources.
  61. [INFO]
  62. [INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ hadoo
  63. p-maven-plugins ---
  64. [INFO] No sources to compile
  65. [INFO]
  66. [INFO] --- maven-surefire-plugin:2.16:test (default-test) @ hadoop-maven-plugins
  67. ---
  68. [INFO] No tests to run.
  69. [INFO]
  70. [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ hadoop-maven-plugins ---
  71. [INFO] Building jar: D:\hadoop2\hadoop-2.4.0-src\hadoop-maven-plugins\target\had
  72. oop-maven-plugins-2.4.0.jar
  73. [INFO]
  74. [INFO] --- maven-plugin-plugin:3.0:addPluginArtifactMetadata (default-addPluginA
  75. rtifactMetadata) @ hadoop-maven-plugins ---
  76. [INFO]
  77. [INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ hadoop-
  78. maven-plugins ---
  79. [INFO]
  80. [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ hadoop-maven-p
  81. lugins ---
  82. [INFO] Installing D:\hadoop2\hadoop-2.4.0-src\hadoop-maven-plugins\target\hadoop
  83. -maven-plugins-2.4.0.jar to C:\Users\hyj\.m2\repository\org\apache\hadoop\hadoop
  84. -maven-plugins\2.4.0\hadoop-maven-plugins-2.4.0.jar
  85. [INFO] Installing D:\hadoop2\hadoop-2.4.0-src\hadoop-maven-plugins\pom.xml to C:
  86. \Users\hyj\.m2\repository\org\apache\hadoop\hadoop-maven-plugins\2.4.0\hadoop-ma
  87. ven-plugins-2.4.0.pom
  88. [INFO] ------------------------------------------------------------------------
  89. [INFO] BUILD SUCCESS
  90. [INFO] ------------------------------------------------------------------------
  91. [INFO] Total time: 4.891 s
  92. [INFO] Finished at: 2014-06-23T14:47:33+08:00
  93. [INFO] Final Memory: 21M/347M
  94. [INFO] ------------------------------------------------------------------------
复制代码

部分截图如下:

hadoop2.4mvninstall.png


hadoop2.4mvninstall1.png



(2)运行

  1. mvn eclipse:eclipse -DskipTests
复制代码
这时候注意,我们进入的是hadoop_home,我这里是D:\hadoop2\hadoop-2.4.0-src

部分信息如下
  1. [INFO]
  2. [INFO] ------------------------------------------------------------------------
  3. [INFO] Reactor Summary:
  4. [INFO]
  5. [INFO] Apache Hadoop Main ................................ SUCCESS [  0.684 s]
  6. [INFO] Apache Hadoop Project POM ......................... SUCCESS [  0.720 s]
  7. [INFO] Apache Hadoop Annotations ......................... SUCCESS [  0.276 s]
  8. [INFO] Apache Hadoop Project Dist POM .................... SUCCESS [  0.179 s]
  9. [INFO] Apache Hadoop Assemblies .......................... SUCCESS [  0.121 s]
  10. [INFO] Apache Hadoop Maven Plugins ....................... SUCCESS [  1.680 s]
  11. [INFO] Apache Hadoop MiniKDC ............................. SUCCESS [  1.802 s]
  12. [INFO] Apache Hadoop Auth ................................ SUCCESS [  1.024 s]
  13. [INFO] Apache Hadoop Auth Examples ....................... SUCCESS [  0.160 s]
  14. [INFO] Apache Hadoop Common .............................. SUCCESS [  1.061 s]
  15. [INFO] Apache Hadoop NFS ................................. SUCCESS [  0.489 s]
  16. [INFO] Apache Hadoop Common Project ...................... SUCCESS [  0.056 s]
  17. [INFO] Apache Hadoop HDFS ................................ SUCCESS [  2.770 s]
  18. [INFO] Apache Hadoop HttpFS .............................. SUCCESS [  0.965 s]
  19. [INFO] Apache Hadoop HDFS BookKeeper Journal ............. SUCCESS [  0.629 s]
  20. [INFO] Apache Hadoop HDFS-NFS ............................ SUCCESS [  0.284 s]
  21. [INFO] Apache Hadoop HDFS Project ........................ SUCCESS [  0.061 s]
  22. [INFO] hadoop-yarn ....................................... SUCCESS [  0.052 s]
  23. [INFO] hadoop-yarn-api ................................... SUCCESS [  0.842 s]
  24. [INFO] hadoop-yarn-common ................................ SUCCESS [  0.322 s]
  25. [INFO] hadoop-yarn-server ................................ SUCCESS [  0.065 s]
  26. [INFO] hadoop-yarn-server-common ......................... SUCCESS [  0.972 s]
  27. [INFO] hadoop-yarn-server-nodemanager .................... SUCCESS [  0.580 s]
  28. [INFO] hadoop-yarn-server-web-proxy ...................... SUCCESS [  0.379 s]
  29. [INFO] hadoop-yarn-server-applicationhistoryservice ...... SUCCESS [  0.281 s]
  30. [INFO] hadoop-yarn-server-resourcemanager ................ SUCCESS [  0.378 s]
  31. [INFO] hadoop-yarn-server-tests .......................... SUCCESS [  0.534 s]
  32. [INFO] hadoop-yarn-client ................................ SUCCESS [  0.307 s]
  33. [INFO] hadoop-yarn-applications .......................... SUCCESS [  0.050 s]
  34. [INFO] hadoop-yarn-applications-distributedshell ......... SUCCESS [  0.202 s]
  35. [INFO] hadoop-yarn-applications-unmanaged-am-launcher .... SUCCESS [  0.194 s]
  36. [INFO] hadoop-yarn-site .................................. SUCCESS [  0.057 s]
  37. [INFO] hadoop-yarn-project ............................... SUCCESS [  0.066 s]
  38. [INFO] hadoop-mapreduce-client ........................... SUCCESS [  0.091 s]
  39. [INFO] hadoop-mapreduce-client-core ...................... SUCCESS [  1.321 s]
  40. [INFO] hadoop-mapreduce-client-common .................... SUCCESS [  0.786 s]
  41. [INFO] hadoop-mapreduce-client-shuffle ................... SUCCESS [  0.456 s]
  42. [INFO] hadoop-mapreduce-client-app ....................... SUCCESS [  0.508 s]
  43. [INFO] hadoop-mapreduce-client-hs ........................ SUCCESS [  0.834 s]
  44. [INFO] hadoop-mapreduce-client-jobclient ................. SUCCESS [  0.541 s]
  45. [INFO] hadoop-mapreduce-client-hs-plugins ................ SUCCESS [  0.284 s]
  46. [INFO] Apache Hadoop MapReduce Examples .................. SUCCESS [  0.851 s]
  47. [INFO] hadoop-mapreduce .................................. SUCCESS [  0.099 s]
  48. [INFO] Apache Hadoop MapReduce Streaming ................. SUCCESS [  0.742 s]
  49. [INFO] Apache Hadoop Distributed Copy .................... SUCCESS [  0.335 s]
  50. [INFO] Apache Hadoop Archives ............................ SUCCESS [  0.397 s]
  51. [INFO] Apache Hadoop Rumen ............................... SUCCESS [  0.371 s]
  52. [INFO] Apache Hadoop Gridmix ............................. SUCCESS [  0.230 s]
  53. [INFO] Apache Hadoop Data Join ........................... SUCCESS [  0.184 s]
  54. [INFO] Apache Hadoop Extras .............................. SUCCESS [  0.217 s]
  55. [INFO] Apache Hadoop Pipes ............................... SUCCESS [  0.048 s]
  56. [INFO] Apache Hadoop OpenStack support ................... SUCCESS [  0.244 s]
  57. [INFO] Apache Hadoop Client .............................. SUCCESS [  0.590 s]
  58. [INFO] Apache Hadoop Mini-Cluster ........................ SUCCESS [  0.230 s]
  59. [INFO] Apache Hadoop Scheduler Load Simulator ............ SUCCESS [  0.650 s]
  60. [INFO] Apache Hadoop Tools Dist .......................... SUCCESS [  0.334 s]
  61. [INFO] Apache Hadoop Tools ............................... SUCCESS [  0.042 s]
  62. [INFO] Apache Hadoop Distribution ........................ SUCCESS [  0.144 s]
  63. [INFO] ------------------------------------------------------------------------
  64. [INFO] BUILD SUCCESS
  65. [INFO] ------------------------------------------------------------------------
  66. [INFO] Total time: 31.234 s
  67. [INFO] Finished at: 2014-06-23T14:55:08+08:00
  68. [INFO] Final Memory: 84M/759M
  69. [INFO] ------------------------------------------------------------------------
复制代码
这时候,我们已经把源码给下载下来了。这时候,我们会看到文件会明显增大。


xiazailiang.png



3.关联eclipse源码

加入我们以下程序
hadoop2.2mapreduce例子.rar (1.14 MB, 下载次数: 549, 售价: 1 云币)

已有(48)人评论

跳转到指定楼层
Victor-Shy 发表于 2014-10-31 15:11:32
呼,按着楼主的大作终于OK了,,不过2确实比1麻烦好多的说
回复

使用道具 举报

gogaobin 发表于 2014-8-7 14:33:15
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.4.0:prot
oc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecut
ionException: 'protoc --version' did not return a version -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :hadoop-common

这个错误是怎么回事,已经正确安装protoc
回复

使用道具 举报

sunny62520 发表于 2014-6-23 23:35:01
感谢分享,回头操作一遍

点评

恩,遇到问题,可以留言  发表于 2014-6-23 23:57
回复

使用道具 举报

pig2 发表于 2014-6-23 23:51:36


  1. [INFO] Reactor Summary:
  2. [INFO]
  3. [INFO] Apache Hadoop Main ................................ SUCCESS [  8.920 s]
  4. [INFO] Apache Hadoop Project POM ......................... SUCCESS [  1.966 s]
  5. [INFO] Apache Hadoop Annotations ......................... SUCCESS [  4.578 s]
  6. [INFO] Apache Hadoop Project Dist POM .................... SUCCESS [  0.503 s]
  7. [INFO] Apache Hadoop Assemblies .......................... SUCCESS [  0.235 s]
  8. [INFO] Apache Hadoop Maven Plugins ....................... SUCCESS [  5.394 s]
  9. [INFO] Apache Hadoop Auth ................................ FAILURE [  1.247 s]
  10. [INFO] Apache Hadoop Auth Examples ....................... SKIPPED
  11. [INFO] Apache Hadoop Common .............................. SKIPPED
  12. [INFO] Apache Hadoop NFS ................................. SKIPPED
  13. [INFO] Apache Hadoop Common Project ...................... SKIPPED
  14. [INFO] Apache Hadoop HDFS ................................ SKIPPED
  15. [INFO] Apache Hadoop HttpFS .............................. SKIPPED
  16. [INFO] Apache Hadoop HDFS BookKeeper Journal ............. SKIPPED
  17. [INFO] Apache Hadoop HDFS-NFS ............................ SKIPPED
  18. [INFO] Apache Hadoop HDFS Project ........................ SKIPPED
  19. [INFO] hadoop-yarn ....................................... SKIPPED
  20. [INFO] hadoop-yarn-api ................................... SKIPPED
  21. [INFO] hadoop-yarn-common ................................ SKIPPED
  22. [INFO] hadoop-yarn-server ................................ SKIPPED
  23. [INFO] hadoop-yarn-server-common ......................... SKIPPED
  24. [INFO] hadoop-yarn-server-nodemanager .................... SKIPPED
  25. [INFO] hadoop-yarn-server-web-proxy ...................... SKIPPED
  26. [INFO] hadoop-yarn-server-resourcemanager ................ SKIPPED
  27. [INFO] hadoop-yarn-server-tests .......................... SKIPPED
  28. [INFO] hadoop-yarn-client ................................ SKIPPED
  29. [INFO] hadoop-yarn-applications .......................... SKIPPED
  30. [INFO] hadoop-yarn-applications-distributedshell ......... SKIPPED
  31. [INFO] hadoop-mapreduce-client ........................... SKIPPED
  32. [INFO] hadoop-mapreduce-client-core ...................... SKIPPED
  33. [INFO] hadoop-yarn-applications-unmanaged-am-launcher .... SKIPPED
  34. [INFO] hadoop-yarn-site .................................. SKIPPED
  35. [INFO] hadoop-yarn-project ............................... SKIPPED
  36. [INFO] hadoop-mapreduce-client-common .................... SKIPPED
  37. [INFO] hadoop-mapreduce-client-shuffle ................... SKIPPED
  38. [INFO] hadoop-mapreduce-client-app ....................... SKIPPED
  39. [INFO] hadoop-mapreduce-client-hs ........................ SKIPPED
  40. [INFO] hadoop-mapreduce-client-jobclient ................. SKIPPED
  41. [INFO] hadoop-mapreduce-client-hs-plugins ................ SKIPPED
  42. [INFO] Apache Hadoop MapReduce Examples .................. SKIPPED
  43. [INFO] hadoop-mapreduce .................................. SKIPPED
  44. [INFO] Apache Hadoop MapReduce Streaming ................. SKIPPED
  45. [INFO] Apache Hadoop Distributed Copy .................... SKIPPED
  46. [INFO] Apache Hadoop Archives ............................ SKIPPED
  47. [INFO] Apache Hadoop Rumen ............................... SKIPPED
  48. [INFO] Apache Hadoop Gridmix ............................. SKIPPED
  49. [INFO] Apache Hadoop Data Join ........................... SKIPPED
  50. [INFO] Apache Hadoop Extras .............................. SKIPPED
  51. [INFO] Apache Hadoop Pipes ............................... SKIPPED
  52. [INFO] Apache Hadoop Tools Dist .......................... SKIPPED
  53. [INFO] Apache Hadoop Tools ............................... SKIPPED
  54. [INFO] Apache Hadoop Distribution ........................ SKIPPED
  55. [INFO] Apache Hadoop Client .............................. SKIPPED
  56. [INFO] Apache Hadoop Mini-Cluster ........................ SKIPPED
  57. [INFO] ------------------------------------------------------------------------
  58. [INFO] BUILD FAILURE
  59. [INFO] ------------------------------------------------------------------------
  60. [INFO] Total time: 24.476 s
  61. [INFO] Finished at: 2014-06-23T08:30:58+08:00
  62. [INFO] Final Memory: 38M/305M
  63. [INFO] ------------------------------------------------------------------------
  64. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
  65. 5.1:testCompile (default-testCompile) on project hadoop-auth: Compilation failur
  66. e: Compilation failure:
  67. [ERROR] D:\hadoop2\hadoop-2.2.0-src\hadoop-common-project\hadoop-auth\src\test\j
  68. ava\org\apache\hadoop\security\authentication\client\AuthenticatorTestCase.java:
  69. [88,11] 错误: 无法访问AbstractLifeCycle
  70. [ERROR] 找不到org.mortbay.component.AbstractLifeCycle的类文件
  71. [ERROR] D:\hadoop2\hadoop-2.2.0-src\hadoop-common-project\hadoop-auth\src\test\j
  72. ava\org\apache\hadoop\security\authentication\client\AuthenticatorTestCase.java:
  73. [96,29] 错误: 无法访问LifeCycle
  74. [ERROR] 找不到org.mortbay.component.LifeCycle的类文件
  75. [ERROR] D:\hadoop2\hadoop-2.2.0-src\hadoop-common-project\hadoop-auth\src\test\j
  76. ava\org\apache\hadoop\security\authentication\client\AuthenticatorTestCase.java:
  77. [98,10] 错误: 找不到符号
  78. [ERROR] 符号:   方法 start()
  79. [ERROR] 位置: 类型为Server的变量 server
  80. [ERROR] D:\hadoop2\hadoop-2.2.0-src\hadoop-common-project\hadoop-auth\src\test\j
  81. ava\org\apache\hadoop\security\authentication\client\AuthenticatorTestCase.java:
  82. [104,12] 错误: 找不到符号
  83. [ERROR] -> [Help 1]
  84. [ERROR]
  85. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
  86. ch.
  87. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  88. [ERROR]
  89. [ERROR] For more information about the errors and possible solutions, please rea
  90. d the following articles:
  91. [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
  92. eption
  93. [ERROR]
  94. [ERROR] After correcting the problems, you can resume the build with the command
  95. [ERROR]   mvn <goals> -rf :hadoop-auth
复制代码

出现这个错误的原因:命令的执行路径不正确。
正确执行命令的方式
D:\hadoop2\hadoop-2.4.0-src\hadoop-maven-plugins>mvn install

mvn eclipse:eclipse -DskipTests (是在D:\hadoop2\hadoop-2.4.0-src路径下)


回复

使用道具 举报

xjl456852 发表于 2014-8-7 18:23:24
帖子很好,正在研究,编译源码用了2个多小时
回复

使用道具 举报

admin 发表于 2014-8-8 21:22:08
gogaobin 发表于 2014-8-7 14:33
------------------------------------------------------------------------
[ERROR] Failed to execute ...
'protoc --version' did not return a version -> [Help 1]

虽然你正确安装了,但是还是没有返回版本,所以你安装的还是有问题
回复

使用道具 举报

轩辕依梦Q 发表于 2014-9-23 10:10:06
gogaobin 发表于 2014-8-7 14:33
------------------------------------------------------------------------
[ERROR] Failed to execute ...

连接访问速度比较慢。链接:http://pan.baidu.com/s/1i3klLqd 密码:a3kd
回复

使用道具 举报

轩辕依梦Q 发表于 2014-9-23 10:11:16
gogaobin 发表于 2014-8-7 14:33
------------------------------------------------------------------------
[ERROR] Failed to execute ...

你的问题解决了么?
回复

使用道具 举报

轩辕依梦Q 发表于 2014-9-23 10:14:27
admin 发表于 2014-8-8 21:22
'protoc --version' did not return a version -> [Help 1]

虽然你正确安装了,但是还是没有返回版本, ...

你好:我使用的是win764位系统操作的,按照这个帖子操作的。http://www.aboutyun.com/forum.php?mod=viewthread&tid=8212&highlight=protoc,报同样的错误protoc --version' did not return a version -> [Help 1],怎样确定protoc是正确安装了。安装过程中没有遇到使用pom.xml。
回复

使用道具 举报

pig2 发表于 2014-10-14 11:08:15
gogaobin 发表于 2014-8-7 14:33
------------------------------------------------------------------------
[ERROR] Failed to execute ...
按照上面,如果不能正确返回,请注意版本问题,jdk1.7
回复

使用道具 举报

12345下一页
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条