我正在使用sbt 0.13.7和Scala 2.11.4。
在我的build.sbt
中,我有:
autoAPIMappings := true
和File.scala
:
/** scaladoc link to [[scala.concurrent.duration.FiniteDuration]] */
运行sbt doc
时,我收到了:
[warn] ...:5: Could not find any member to link for "scala.concurrent.duration.FiniteDuration".
[warn] /** scaladoc link to [[scala.concurrent.duration.FiniteDuration]] */
[warn] ^
现在,我将autoAPIMappings := true
替换为:
apiMappings += (scalaInstance.value.libraryJar ->
url(s"http://www.scala-lang.org/api/${scalaVersion.value}/"))
编译器仍然发出警告。
什么是解决方案?
答案 0 :(得分:2)
我无法使用sbt 0.13.7和Scala 2.11.4重现此行为。
您有多项目设置吗?如果是这样,请确保向每个项目明确添加设置,或在ThisBuild
范围中定义常用设置。
sbt.version=0.13.7
lazy val commonSettings = Seq(
scalaVersion := "2.11.4",
autoAPIMappings := true
)
lazy val root = (project in file(".")).
aggregate(app).
settings(commonSettings: _*)
lazy val app = (project in file("app")).
settings(commonSettings: _*)
/** scaladoc link to [[scala.concurrent.duration.FiniteDuration]] */
object Hello extends App {
}