为了测试,我创建了一个空项目,只有一个文件build.sbt
只包含一行:
libraryDependencies += "org.openprovenance.prov" % "prov-interop" % "0.7.2"
如果我运行sbt update
,它会因堆栈溢出而失败。最后几行看起来像这样(你可以想象重复的嵌套尝试来获取依赖关系):
at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:731)
at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:748)
at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:799)
at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:731)
at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:748)
at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:799)
[error] (*:update) java.lang.StackOverflowError
[error] Total time: 1 s, completed Dec 21, 2015 11:50:37 PM
我在maven项目中具有相同的依赖关系,并且下载依赖项没有任何问题。我怎样才能在sbt中解决这个问题?
答案 0 :(得分:2)
在libraryDependencies
的最开头声明以下依赖项:
"org.antlr" % "antlr-runtime" % "3.4"
更新:更好地使用antlr-runtime
更新2:给定的解决方案无法完全解决问题,此问题是由prov-interop
依赖关系树中声明的递归依赖引起的。要解决它的声明:
libraryDependencies ++= Seq (
"org.openprovenance.prov" % "prov-model" % "0.7.2",
"org.openprovenance.prov" % "prov-interop" % "0.7.2" exclude("org.antlr", "stringtemplate"), // to resolve cyclic dependencies