2

我正在努力在 build.scala 中给出排除模式。我看过他们提到 build.sbt 的几篇文章。我是 sbt 的新手。有人可以帮我在 build.scala 中编写排除模式吗?

我想排除以下两个在运行程序集时导致错误的包:xmlbeans 和 xml-apis

Error : 
[trace] Stack trace suppressed: run last app/*:assembly for the full output.
[error] (app/*:assembly) deduplicate: different file contents found in the following:
[error] /Users/rajeevprasanna/.ivy2/cache/org.apache.xmlbeans/xmlbeans/jars/xmlbeans-2.3.0.jar:org/w3c/dom/TypeInfo.class
[error] /Users/rajeevprasanna/.ivy2/cache/xml-apis/xml-apis/jars/xml-apis-1.3.03.jar:org/w3c/dom/TypeInfo.class

我参考这个文件写了 build.scala:https ://github.com/eed3si9n/sbt-assembly-full-config-sample/blob/master/project/builds.scala

4

1 回答 1

5

找出哪个依赖项(“oldstuff”)引入了错误版本的 xmlbeans 或 xml-apis,并排除一个或两个依赖项,如下所示:

libraryDependencies ++= Seq(
  "org.old"  % "oldstuff"" % "0.5" 
     exclude ("org.apache.xmlbeans", "xmlbeans")
     exclude ("xml-apis", "xml-apis"),
  ...
  ...
)

您可能需要查看您的~/.ivy2/cache目录以获取确切的名称。

于 2013-12-04T17:55:46.857 回答