由于文件冲突导致程序集失败

时间:2015-02-10 09:24:50

标签: scala hadoop sbt sbt-assembly

我正在尝试通过为我的项目运行sb​​t程序集来制作一个胖罐。 我收到以下错误:

[error] (root/*:assembly) deduplicate: different file contents found in the following:
[error] /Users/xyz/.ivy2/cache/org.apache.hadoop/hadoop-mapreduce-client-core/jars/hadoop-mapreduce-client-core-2.2.0.jar:org/apache/hadoop/filecache/DistributedCache.class
[error] /Users/xyz/.ivy2/cache/org.apache.hadoop/hadoop-core/jars/hadoop-core-2.0.0-mr1-cdh4.7.1.jar:org/apache/hadoop/filecache/DistributedCache.class

hadoop-mapreduce-client-core的DistributedCache现已弃用。 在我的build.sbt中,我包括:

"org.apache.hadoop" % "hadoop-client" % "2.0.0-mr1-cdh4.7.1" excludeAll(
    ExclusionRule(organization = "javax.servlet"))

依赖性是这样的:

org.apache.hadoop:hadoop-client:2.2.0 
 org.apache.hadoop:hadoop-mapreduce-client-app:2.2.0
  org.apache.hadoop:hadoop-mapreduce-client-core:2.2.0

我该如何处理?

提前致谢!

1 个答案:

答案 0 :(得分:0)

如果您打算在依赖hadoop-client时加载mapreduce-client-app的依赖jar:2.2.0,只需简单地添加不及物:

"org.apache.hadoop" % "hadoop-client" % "2.2.0" intransitive()

这将只包含hadoop-client:2.2.0 jar并排除其所有依赖项。