This is a Maven project. After MVN 3.2.2 is installed,
mvn --versionApache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:10+08:00)Maven home: /opt/apache-maven-3.2.3Java version: 1.7.0_09, vendor: Oracle CorporationJava home: /data/hadoop/data1/usr/local/jdk1.7.0_09/jreDefault locale: en_US, platform encoding: UTF-8OS name: "linux", version: "2.6.18-348.6.1.el5", arch: "amd64", family: "unix"
Run the following command to create a project:
mvn archetype:generate -DgroupId=org.freebird -DartifactId=mr1_example1 -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
Go to the project directory, open Pom. XML, and modify it as follows:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.freebird</groupId> <artifactId>mr1_example1</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>mr1_example1</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-core</artifactId> <version>1.2.1</version> </dependency> </dependencies></project>
Delete the test directory.
rm -rf src/test/
MVN clean compile is compiled.
Mapreduce 1.x programming Series 1 builds a basic Maven Project