使用重复数据删除策略时,这是我收到的错误:
[error] deduplicate: different file contents found in the following:
[error] C:\Users\me\.ivy2\cache\org.neo4j\neo4j-kernel\jars\neo4j-kernel-3.2.3.jar:META-INF/services/org.neo4j.kernel.extension.KernelExtensionFactory
[error] C:\Users\me\.ivy2\cache\org.neo4j\neo4j-lucene-index\jars\neo4j-lucene-index-3.2.3.jar:META-INF/services/org.neo4j.kernel.extension.KernelExtensionFactory
[error] C:\Users\me\.ivy2\cache\org.neo4j\neo4j-udc\jars\neo4j-udc-3.2.3.jar:META-INF/services/org.neo4j.kernel.extension.KernelExtensionFactory
[error] C:\Users\me\.ivy2\cache\org.neo4j\neo4j-jmx\jars\neo4j-jmx-3.2.3.jar:META-INF/services/org.neo4j.kernel.extension.KernelExtensionFactory
我需要的文件是列表中的第二个文件:neo4j-lucene-index\jars\neo4j-lucene-index-3.2.3.jar:META-INF/services/org.neo4j.kernel.extension.KernelExtensionFactory
,但是第二个SBT程序集中没有MergeStrategy,只有“第一个”和“最后一个”。
这是我当前正在使用的合并策略:
assemblyMergeStrategy in assembly := {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case PathList("META-INF", "LICENSES.txt") => MergeStrategy.discard
case PathList("META-INF", "services", "org.neo4j.kernel.extension.KernelExtensionFactory") => MergeStrategy.first
case PathList("META-INF", xs @ _*) =>
(xs map {_.toLowerCase}) match {
case ps @ (x :: xs) if ps.last.endsWith(".sf") || ps.last.endsWith(".dsa") || ps.last.endsWith(".rsa") =>
MergeStrategy.discard
case x => MergeStrategy.deduplicate
}
case x => MergeStrategy.deduplicate
}
如何为列表中的第二个创建自定义合并策略,或告诉SBT包含特定文件?