当我尝试使用以下方法构建hadoop时:
mvn安装-e-dskiptests
它总是抛出以下错误:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/xiu/myGit/hadoop2/hadoop-mr1-project/hadoop-mr1/src/test/java/org/apache/hadoop/mapreduce/security/TestTokenCache.java:[153,4] getDelegationTokenSecretManager() is not public in org.apache.hadoop.hdfs.server.namenode.FSNamesystem; cannot be accessed from outside package
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Hadoop MR1 ................................. FAILURE [3.144s]
[INFO] Apache Hadoop MR1 Examples ........................ SKIPPED
[INFO] Apache Hadoop MR1 Project ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.353s
[INFO] Finished at: Thu Jul 18 11:01:30 PDT 2013
[INFO] Final Memory: 32M/100M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (default-testCompile) on project hadoop-mr1: Compilation failure
[ERROR] /home/xiu/myGit/hadoop2/hadoop-mr1-project/hadoop-mr1/src/test/java/org/apache/hadoop/mapreduce/security/TestTokenCache.java:[153,4] getDelegationTokenSecretManager() is not public in org.apache.hadoop.hdfs.server.namenode.FSNamesystem; cannot be accessed from outside package
[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/MojoFailureException
我尝试过清理并重新安装不同版本的maven,但没有成功。有Maven知道这是怎么回事吗?
2条答案
按热度按时间6l7fqoea1#
我在hadoop2.2.0源代码构建过程中遇到了同样的问题。在“mvn install-dskiptests”期间,这个错误出现在“hadoop auth”文件夹中。从某处(我不记得从哪里)我知道这个hadoop auth文件夹的pom.xml中缺少一个依赖项
依赖关系是
我添加了这个依赖项,并再次尝试了“mvn install-dskiptests”。我的错误解决了。
您只需尝试在“ApacheHadoopMR1”的pom.xml中添加此依赖项。愿你的错误得到解决
wixjitnu2#
好像maven编译器插件在抱怨
getDelegationTokenSecretManager()
hadoop中的方法FSNameSystem
由于方法可见性而无法访问,即它不是公共的:我建议您检查pom.xml中定义的hadoop版本,并再次检查hadoop版本javadoc中是否可以访问该方法。