首页 > 代码库 > 编译hadoop2.2.0源码时报错

编译hadoop2.2.0源码时报错

编译hadoop2.2.0源码时,

mvn install -DskipTests

报错:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/test/work/env/hadoop/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[86,13] 无法訪问 org.mortbay.component.AbstractLifeCycle
未找到 org.mortbay.component.AbstractLifeCycle 的类文件
    server = new Server(0);
[ERROR] /home/test/work/env/hadoop/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[96,29] 无法訪问 org.mortbay.component.LifeCycle
未找到 org.mortbay.component.LifeCycle 的类文件
    server.getConnectors()[0].setHost(host);
[ERROR] /home/test/work/env/hadoop/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[98,10] 找不到符号
符号: 方法 start()
位置: 类 org.mortbay.jetty.Server
[ERROR] /home/test/work/env/hadoop/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[104,12] 找不到符号
符号: 方法 stop()
位置: 类 org.mortbay.jetty.Server
[INFO] 4 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------

这是hadoop2.2.0源码里的一个小bug:https://issues.apache.org/jira/browse/HADOOP-10110


不想看英文的,就直接改动hadoop-common-project/hadoop-auth/pom.xml,加入一个dependency:

<dependency>
	<groupId>org.mortbay.jetty</groupId>
	<artifactId>jetty-util</artifactId>
	<scope>test</scope>
</dependency>

事实上就是少了一个包。