SBT - 汇编(Scala - Neo4j),如何处理这个重复数据删除问题?

时间:2013-11-22 18:53:06

标签: scala neo4j sbt sbt-assembly

只是尝试用sbt-assembly生成一个Jar,我仍然被困在这个:

[error] (*:assembly) deduplicate: different file contents found in the following:
[error] /Users/fsalvador/.ivy2/cache/org.neo4j/neo4j-kernel/jars/neo4j-kernel-1.9.4.jar:META-INF/CHANGES.txt
[error] /Users/fsalvador/.ivy2/cache/org.neo4j/neo4j-lucene-index/jars/neo4j-lucene-index-1.9.4.jar:META-INF/CHANGES.txt
[error] /Users/fsalvador/.ivy2/cache/org.neo4j/neo4j-graph-algo/jars/neo4j-graph-algo-1.9.4.jar:META-INF/CHANGES.txt
[error] /Users/fsalvador/.ivy2/cache/org.neo4j/neo4j-udc/jars/neo4j-udc-1.9.4.jar:META-INF/CHANGES.txt
[error] /Users/fsalvador/.ivy2/cache/org.neo4j/neo4j-cypher/jars/neo4j-cypher-1.9.4.jar:META-INF/CHANGES.txt
[error] /Users/fsalvador/.ivy2/cache/org.neo4j/neo4j-jmx/jars/neo4j-jmx-1.9.4.jar:META-INF/CHANGES.txt

在我的build.sbt中我尝试了以下内容:

mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) => {
    case PathList("ivy2", "cache",  "org.neo4j", xs @ _*) => MergeStrategy.last
    case "CHANGES.txt"     => MergeStrategy.discard
    case x => old(x)
  }
}

仍然没有快乐,几乎尝试了一切。

2 个答案:

答案 0 :(得分:8)

PathList(...)提取器拆分路径字符串。以下应该有效:

mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) => {
    case PathList("META-INF", "CHANGES.txt") => MergeStrategy.discard
    case x => old(x)
  }
}

答案 1 :(得分:-3)

你有没有尝试过更简单的方法:

mergeStrategy in assembly := mergeStrategy.first

更新,请勿执行此操作,请参阅注释