我有一个问题,从sbt版本0.13.2-M3迁移到0.13.5-RC3,其中13.2-M3成功解决的传递依赖无法通过0.13.5-RC3解决。
在版本为"working@“的情况下,我得到了未解决的依赖错误。
当我有一个包含两个子项目的多项目构建时,就会发生这种情况,其中一个子项目依赖于另一个子项目。它们都有依赖关系,它们的maven pom指定了一个共同的父母(尽管我不确定这是不是在转移注意力)。
只有当依赖项不在本地常春藤缓存中时,才会发生这种情况。
最小的repro构建是:
import sbt._
import Keys._
object BarBuild extends Build {
val buildSettings = Seq(scalaVersion := "2.10.3")
lazy val root = Project(
id = "bar",
base = file(".")
) aggregate(withSolrCore, withSolrClient)
lazy val withSolrCore = Project(
id = "withSolrCore",
base = file("solrCore"),
settings = buildSettings ++ Seq(
libraryDependencies ++= Seq("org.apache.solr" % "solr-core" % "4.7.1")
)
) dependsOn (withSolrClient)
lazy val withSolrClient = Project(
id = "withSolrClient",
base = file("solrClient"),
settings = buildSettings ++ Seq(
libraryDependencies ++= Seq("org.apache.solr" % "solr-solrj" % "4.7.1")
)
)
}在使用build.properties的sbt.version=0.13.5-RC3时,我看到很多错误,比如
[warn] module not found: org.apache.lucene#lucene-analyzers-kuromoji;working@heraclitus.local和
[error] unresolved dependency: org.apache.lucene#lucene-core;working@heraclitus.local: not found但是有了sbt.version=0.13.2-M3,一切都很棒。
我不确定是我做错了什么,还是sbt出了问题,但在这一点上,我怀疑是后者。
谢谢。
发布于 2014-05-20 00:40:18
这是一个众所周知的常春藤问题。解决方法是覆盖完全传递闭包中所有依赖项的版本,这与要使用的“真实”版本背道而驰。(我通过在一个存根项目上运行update来获得真正的文件,这个存根项目只有一个老版本的sbt,0.13.2,这是常春藤错误之前的问题依赖),比如,
dependencyOverrides ++= Set(
"com.google.guava" % "guava" % "14.0.1",
"com.google.protobuf" % "protobuf-java" % "2.5.0",
"com.googlecode.concurrentlinkedhashmap" % "concurrentlinkedhashmap-lru" % "1.2",
"com.spatial4j" % "spatial4j" % "0.4.1",
...
)https://stackoverflow.com/questions/23701209
复制相似问题