2015-09-16 50 views
2

我創建了一個word count項目,並通過maxmind(maven)將maven導入到GeoIP中 - 此Geoip項目爲build with maven在hadoop mapReduce項目下設置pom.xml

我導入後,我有一個新的項目(geoIP)旁邊的單詞計數項目與一個pom.xml(非常長),它是由eclipse創建的。

但在上面的鏈接他們在說增加的pom.xml

<dependency> 
    <groupId>com.maxmind.geoip2</groupId> 
    <artifactId>geoip2</artifactId> 
    <version>v2.3.0</version> 
</dependency> 

  1. 如果我日食創建的pom.xml我應該刪除或添加它,我不明白這一點用上面的代碼?

  2. 我需要多少個pom.xml文件?

  3. MapReduce項目是否需要使用maven構建?

回答

3

我沒有使用過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所有附加的依賴性。