【问题标题】:Setting for pom.xml under hadoop mapReduce projecthadoop mapReduce项目下pom.xml的设置
【发布时间】:2015-09-16 04:17:32
【问题描述】:

我创建了一个字数统计项目并通过 maxmind(maven) 使用 maven 导入 GeoIP - 这个 Geoip 项目是 build with maven

导入后,我在字数统计项目旁边有一个新项目(geoIP),其中包含一个由 eclipse 创建的 pom.xml(很长)。

但在上面的链接中他们说添加到 pom.xml

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

  1. 如果 eclipse 为我创建了 pom.xml,我不明白我应该删除它还是使用上面的代码添加它?

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

  3. MapReduce 项目是否也需要使用 maven 构建?

【问题讨论】:

    标签: java maven hadoop pom.xml


    【解决方案1】:

    我没有使用过 GeoIP2,但在这里应该没什么区别。

    如果 eclipse 为我创建了 pom.xml,我应该删除还是使用上面的代码添加它?

    Eclipse 默认为您的geoip 项目创建了一个pom.xml 文件。您应该为您的文件添加新的依赖项以便访问 GeoIP。

    我需要多少个 pom.xml 文件?

    真的取决于您的整体项目结构。你可能应该看看这个SO question 的答案,并看看this example 一个项目的多个maven 文件。

    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-11
      • 1970-01-01
      • 1970-01-01
      • 2010-12-30
      • 1970-01-01
      • 2014-05-01
      相关资源
      最近更新 更多