Maven compiled hadoop-2.2.0-src
Maven compiled Hadoop-2.2.0-src
1. Environment
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 23:22:22 + 0800)
Maven home:/opt/maven
Java version: 1.7.0 _ 45, vendor: Oracle Corporation
Java home:/usr/java/jdk1.7.0 _ 45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.18-371.3.1.el5", arch: "amd64", family: "unix"
2. Run
Mvn package-DskipTests-Pdist, native, docs-Dtar
3. Episode 1
[ERROR] Failed to execute goal org. apache. maven. plugins: maven-compiler-plugin: 2.5.1: testCompile (default-testCompile) on project hadoop-auth: Compilation failure:
[ERROR]/home/chuan/trunk/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase. java: [84,13] cannot access org. mortbay. component. abstractLifeCycle
[ERROR] class file for org. mortbay. component. AbstractLifeCycle not found
Patch
Patch: https://issues.apache.org/jira/browse/HADOOP-10110
Method: Modify hadoop-common-project/hadoop-auth/pom. xml in the hadoop source code directory.
Add or modify the following content:
<Dependency>
<GroupId> org. mortbay. jetty </groupId>
<ArtifactId> jetty-util </artifactId>
<Scope> test </scope>
</Dependency>
<Dependency>
<GroupId> org. mortbay. jetty </groupId>
<ArtifactId> jetty </artifactId>
<Scope> test </scope>
</Dependency>
4. Episode 2
[ERROR] Failed to execute goal org. apache. maven. plugins: maven-antrun-plugin: 1.6: run (make) on project hadoop-common: An Ant BuildException has occured: Execute failed: java. io. IOException: Cannot run program "cmake" (in directory "/opt/hadoop-2.2.0-src/hadoop-common-project/hadoop-common/target/native"): error = 2, no such file or directory-> [Help 1]
Cmake Is Not Installed
People just want this place. This is not decisive.
Yum install cmake
5. Episode 3
[ERROR] Failed to execute goal org. apache. hadoop: hadoop-maven-plugins: 2.2.0: protoc (compile-protoc) on project hadoop-common: org. apache. maven. plugin. mojoExecutionException: 'protoc -- version' did not return a version-> [Help 1]
Org. apache. maven. lifecycle. lifecycleExecutionException: Failed to execute goal org. apache. hadoop: hadoop-maven-plugins: 2.2.0: protoc (compile-protoc) on project hadoop-common: org. apache. maven. plugin. mojoExecutionException: 'protoc -- version' did not return a version
No protobuf-2.5.0 installed.
Download protobuf-2.5.0.tar.gz and decompress it. 3. Compile and install protobuf-2.5.0.tar.gz.
6. Continue (this time, with debug)
Mvn package-Pdist, native-DskipTests-Dtar-e-X
Waiting for a long time
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Hadoop Main ................................ SUCCESS [2: 18. 165 s]
[INFO] Apache Hadoop Project POM ...... SUCCESS [50.526 s]
[INFO] Apache Hadoop Annotations ...... SUCCESS [. 522 s]
[INFO] Apache Hadoop Assemblies...
[INFO] Apache Hadoop Project Dist POM ...... SUCCESS [5.983 s]
[INFO] Apache Hadoop Maven Plugins ...... SUCCESS [13.161 s]
[INFO] Apache Hadoop Auth ................................ SUCCESS [10.647 s]
[INFO] Apache Hadoop Auth Examples ...... SUCCESS [5.010 s]
[INFO] Apache Hadoop Common .............................. SUCCESS [4: 32. 249 s]
[INFO] Apache Hadoop NFS ................................. SUCCESS [18.927 s]
[INFO] Apache Hadoop Common Project ...... SUCCESS [0.134 s]
[INFO] Apache Hadoop HDFS ................................ SUCCESS [5: 29. 380 s]
[INFO] Apache Hadoop HttpFS .............................. SUCCESS [:43. 219 s]
[INFO] Apache Hadoop HDFS BookKeeper Journal ...... SUCCESS [44.693 s]
[INFO] Apache Hadoop HDFS-NFS...
[INFO] Apache Hadoop HDFS Project ...... SUCCESS [0.219 s]
[INFO] hadoop-yarn .................................. ..... SUCCESS [1.957 s]
[INFO] hadoop-yarn-api ................................... SUCCESS [:36. 233 s]
[INFO] hadoop-yarn-common ................................ SUCCESS [1: 31. 987 s]
[INFO] hadoop-yarn-server ................................ SUCCESS [0.334 s]
[INFO] hadoop-yarn-server-common ...... SUCCESS [26.932 s]
[INFO] hadoop-yarn-server-nodemanager ...... SUCCESS [49.536 s]
[INFO] hadoop-yarn-server-web-proxy ...... SUCCESS [7.882 s]
[INFO] hadoop-yarn-server-resourcemanager ...... SUCCESS [. 936 s]
[INFO] hadoop-yarn-server-tests .......................... SUCCESS [6.642 s]
[INFO] hadoop-yarn-client ................................ SUCCESS [11.930 s]
[INFO] hadoop-yarn-applications ...... SUCCESS [0.437 s]
[INFO] hadoop-yarn-applications-distributedshell ...... SUCCESS [12.064 s]
[INFO] hadoop-mapreduce-client... SUCCESS [1.363 s]
[INFO] hadoop-mapreduce-client-core ...... SUCCESS [58.193 s]
[INFO] hadoop-yarn-applications-unmanaged-am-launcher... SUCCESS [11.262 s]
[INFO] hadoop-yarn-site ................................ .. SUCCESS [0.328 s]
[INFO] hadoop-yarn-project ............................... SUCCESS [17.453 s]
[INFO] hadoop-mapreduce-client-common ...... SUCCESS [43.479 s]
[INFO] hadoop-mapreduce-client-shuffle ...... SUCCESS [6.048 s]
[INFO] hadoop-mapreduce-client-app ...... SUCCESS [46.449 s]
[INFO] hadoop-mapreduce-client-hs ...... SUCCESS [9.770 s]
[INFO] hadoop-mapreduce-client-jobclient ...... SUCCESS [17.249 s]
[INFO] hadoop-mapreduce-client-hs-plugins ...... SUCCESS [9.929 s]
[INFO] Apache Hadoop MapReduce Examples ...... SUCCESS [12.193 s]
[INFO] hadoop-mapreduce .................................. SUCCESS [6.817 s]
[INFO] Apache Hadoop MapReduce Streaming ...... SUCCESS [10.957 s]
[INFO] Apache Hadoop Distributed Copy ...... SUCCESS [32.407 s]
[INFO] Apache Hadoop Archives...
[INFO] Apache Hadoop Rumen ............................... SUCCESS [18.817 s]
[INFO] Apache Hadoop Gridmix ...... SUCCESS [10.909 s]
[INFO] Apache Hadoop Data Join...
[INFO] Apache Hadoop Extras .............................. SUCCESS [11.594 s]
[INFO] Apache Hadoop Pipes ............................... SUCCESS [3.737 s]
[INFO] Apache Hadoop Tools Dist ...... SUCCESS [3.623 s]
[INFO] Apache Hadoop Tools ............................... SUCCESS [0.127 s]
[INFO] Apache Hadoop Distribution ...... SUCCESS [. 243 s]
[INFO] Apache Hadoop Client .............................. SUCCESS [25.929 s]
[INFO] Apache Hadoop Mini-Cluster...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33: 38.762 s
[INFO] Finished at: Sat Dec 28 21:59:12 CST 2013
[INFO] Final Memory: 68 MB/200 MB
[INFO] ------------------------------------------------------------------------
Note: The first running usually requires many jar packages.
Sometimes there is a major error caused by the following during the download.
Connection to http://repo.maven.apache.org refused
Just re-Execute
Mvn package-Pdist, native-DskipTests-Dtar-e-X
Next, it is generally a network problem.
Maven official guide _ Chinese full version clear PDF
Install Maven in Linux
Maven3.0 configuration and simple use
Set up sun-jdk and Maven2 in Ubuntu
Get started with Maven