我没有使用过GeoIP2,但它在这里不应该有所作为。
如果eclipse为我创建了pom.xml我应该删除还是添加上面的代码?
Eclipse中创建过pom.xml
文件为您geoip的项目默认。您应该为文件添加新的依赖项以访问GeoIP。
我需要多少个pom.xml文件?
真的取决于您的整体项目结构。你可能应该看看这个SO question的答案,并且看一看项目的多个maven文件的this example。
MapReduce项目是否需要用maven构建?
不,但我会推荐它,它会让你的生活更轻松。这里是我的依赖关系的map-reduce作业:
<dependencies>
<!-- junit testing framework -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- hadoop hdfs components -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>2.7.1</version>
</dependency>
<!-- hadoop map-reduce components -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>2.7.1</version>
</dependency>
<!-- hadoop common components -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.1</version>
</dependency>
</dependencies>
与位于Maven Repository for Hadoop所有附加的依赖性。