这是一个maven 工程,安装完mvn 3.2.2后,
mvn --version Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:10+08:00) Maven home: /opt/apache-maven-3.2.3 Java version: 1.7.0_09, vendor: Oracle Corporation Java home: /data/hadoop/data1/usr/local/jdk1.7.0_09/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.18-348.6.1.el5", arch: "amd64", family: "unix"
用下面的命令创建工程:
mvn archetype:generate -DgroupId=org.freebird -DartifactId=mr1_example1 -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
<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>
rm -rf src/test/
MapReduce 1.x 编程 系列一 搭建基本的Maven工程
原文地址:http://blog.csdn.net/csfreebird/article/details/39521925