Maven Build Failure - Hadoop 2.2.0 - [ERROR] class file for org.mortbay.component.AbstractLifeCycle not found
In the previous post on Build, Install, Configure and Run Apache Hadoop 2.2.0 in Microsoft Windows OS, many people have encountered Maven build failure issue ("[ERROR] class file for org.mortbay.component.AbstractLifeCycle not found") for Apache Hadoop Auth project. So thought of sharing the fix as a separate post.
Tools and Technologies used in this article :
Problem
Windows SDK 7.1 Command Prompt[ERROR] C:\hdfs\hadoop-common-project\hadoop-auth\src\test\java\org\apache\hadoop\security\authentication\client\AuthenticatorTestCase.java:[88,11] error: cannot access AbstractLifeCycle [ERROR] class file for org.mortbay.component.AbstractLifeCycle not found [ERROR] C:\hdfs\hadoop-common-project\hadoop-auth\src\test\java\org\apache\hadoop\security\authentication\client\AuthenticatorTestCase.java:[96,29] error: cannot access LifeCycle [ERROR] class file for org.mortbay.component.LifeCycle not found [ERROR] C:\hdfs\hadoop-common-project\hadoop-auth\src\test\java\org\apache\hadoop\security\authentication\client\AuthenticatorTestCase.java:[98,10] error: cannot find symbol [ERROR] symbol: method start() [ERROR] location: class org.mortbay.jetty.Server
Why?
Maven dependency jetty-util is missing in "<hadoop-src>hadoop-common-project/hadoop-auth/pom.xml" of Apache Hadoop 2.2.0 source distribution, used for Maven build. This issue is already reported in JIRA - HADOOP-10110.
Solution
Apply HADOOP-10110.patch or open "<hadoop-src>hadoop-common-project/hadoop-auth/pom.xml" and manually add the following maven dependency.
<dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-util</artifactId> <scope>test</scope> </dependency>
Download SrcCodes