1、首先在Eclipse-》help-》Eclipse marketplace 搜尋 maven 插件下載下傳。
注意插件要與Eclipse版本對應,我的Eclipse版本為Luna的,插件就要下載下傳Luna版本的,我下載下傳的是 Maven Integration for Eclipse (Luna and newer) 1.5。否則的話建立maven工程的時候沒有帶Java工程。
2、其他環境配置和hadoop配置見參考連結。
3、我使用的是hadoop2.4.0. pom檔案如下:
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.rsclouds.hadoop
wordcount
0.0.1-SNAPSHOT
jar
wordcount
http://maven.apache.org
UTF-8
org.apache.hadoop
hadoop-client
2.4.0
org.apache.hadoop
hadoop-mapreduce-client-core
2.4.1
org.apache.hadoop
hadoop-hdfs
2.4.1
org.apache.hbase
hbase-client
0.98.0-hadoop2
org.apache.hbase
hbase-server
0.98.0-hadoop2
org.apache.hbase
hbase-server
0.98.0-hadoop2
junit
junit
3.8.1
test
org.eclipse.m2e
lifecycle-mapping
1.0.0
org.apache.maven.plugins
maven-dependency-plugin
[2.0,)
copy-dependencies
org.apache.maven.plugins
maven-dependency-plugin
copy-dependencies
package
copy-dependencies
lib
false
false
true