问题描述
我正在将我的应用程序从 hadoop 1.0.3 迁移到 hadoop 2.2.0,并且 maven build 将 hadoop-core 标记为依赖项.由于 hadoop-core 不存在于 hadoop 2.2.0.我尝试用 hadoop-client 和 hadoop-common 替换它,但我仍然收到 ant.filter 的这个错误.有人可以建议使用哪个工件吗?
I am migrating my application from hadoop 1.0.3 to hadoop 2.2.0 and maven build had hadoop-core marked as dependency. Since hadoop-core is not present for hadoop 2.2.0. I tried replacing it with hadoop-client and hadoop-common but I am still getting this error for ant.filter. Can anybody please suggest which artifact to use?
previous config :
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.0.3</version>
</dependency>
New Config:
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.2.0</version>
</dependency>
错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project event: Compilation failure: Compilation failure:
[ERROR] /opt/teamcity/buildAgent/work/c670ebea1992ec2f/event/src/main/java/com/intel/event/EventContext.java:[27,36] package org.apache.tools.ant.filters does not exist
[ERROR] /opt/teamcity/buildAgent/work/c670ebea1992ec2f/event/src/main/java/com/intel/event/EventContext.java:[27,36] package org.apache.tools.ant.filters does not exist
[ERROR] /opt/teamcity/buildAgent/work/c670ebea1992ec2f/event/src/main/java/com/intel/event/EventContext.java:[180,59] cannot find symbol
[ERROR] symbol: class StringInputStream
[ERROR] location: class com.intel.event.EventContext
推荐答案
我们的应用主要依赖于 hdfs api.当我们迁移到 hadoop 2.X 时,我们惊讶地看到依赖项的变化.我们开始一次添加一个依赖项.今天我们依赖于以下核心库.
We mainly depend on hdfs api for our application. When we migrated to hadoop 2.X, we were surprised to see the changes in dependencies. We started adding dependencies one at a time. Today we depend on the following core libraries.
hadoop-annotations-2.2.0
hadoop-auth-2.2.0
hadoop-common-2.2.0
hadoop-hdfs-2.2.0
hadoop-mapreduce-client-core-2.2.0
除此之外,我们还依赖于测试库.根据您的需要,您可能希望将 hadoop-hdfs 和 hadoop-mapreduce-client 与 hadoop-common 一起包含在依赖项中.
In addition to these we depend on test libraries too. Based on your needs, you may want to include hadoop-hdfs and hadoop-mapreduce-client to the dependencies along with hadoop-common.
这篇关于Maven artifactId hadoop 2.2.0 for hadoop-core的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!