gpt4 book ai didi

plugins - 依赖项中的 sbt-assembly 和多个类定义

转载 作者:行者123 更新时间:2023-12-01 23:10:42 26 4
gpt4 key购买 nike

作为 sbt 和 sbt-assembly 插件的新手,我对如何处理涉及我试图打包的依赖项中不同类定义的构建感到困惑。

[error] (*:assembly) deduplicate: different file contents found in the following:
[error] /Users/dm/.ivy2/cache/org.apache.tika/tika-app/jars/tika-app-1.3.jar:javax/xml/XMLConstants.class
[error] /Users/dm/.ivy2/cache/stax/stax-api/jars/stax-api-1.0.1.jar:javax/xml/XMLConstants.class
[error] /Users/dm/.ivy2/cache/xml-apis/xml-apis/jars/xml-apis-1.3.03.jar:javax/xml/XMLConstants.class

我已添加:

mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
{
case PathList("javax", "xml", xs @ _*) => MergeStrategy.first
}
}

到我的 build.sbt 文件,但我仍然收到上面的错误(无论它是否在构建文件中)。任何指导将不胜感激。

谢谢,

不要

最佳答案

我认为你很接近。确保在加载 assemblySettings 后添加任何重新布线,并将未处理的任何模式传递给默认策略:

assemblySettings

mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
{
case PathList("javax", "xml", xs @ _*) => MergeStrategy.first
case _ => old
}
}

关于plugins - 依赖项中的 sbt-assembly 和多个类定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17089047/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com