升级后无法使用 specs2 编译 ScalaCheck

Cannot compile ScalaCheck with specs2 since upgrading

我曾经用过:

"org.scalacheck" %% "scalacheck" % "1.10.1" % "test" withSources() withJavadoc(),
"org.specs2" %% "specs2" % "1.14" % "test" withSources() withJavadoc(),

效果很好,然后我将我的依赖项升级到我认为是最新的:

"org.scalacheck" %% "scalacheck" % "1.12.1" % "test" withSources() withJavadoc(),
"org.specs2" %% "specs2-core" % "2.4.15" % "test" withSources() withJavadoc(),

根据http://etorreborre.github.io/specs2/

应该是正确的

但现在 ScalaCheck 未被识别为 org.specs2

的成员
[error] /Users/me/src/aFile.scala:7: object ScalaCheck is not a member of package org.specs2
[error] import org.specs2.ScalaCheck
[error]        ^

我已经完成 sbt clean 并被 ivy 缓存删除 rm -r ~/.ivy2/cache

文档有误,您需要在构建文件中添加多行 SBT 行,特别是根据 Erics answer 添加一行。

也不要添加以下内容,它会导致一堆其他错误

"org.specs2" %% "specs2" % "2.4.15" % "test" withSources() withJavadoc(),

您需要将 specs2-scalacheck 模块添加到您的构建中。