【问题标题】:Cannot compile ScalaCheck with specs2 since upgrading升级后无法使用 specs2 编译 ScalaCheck
【发布时间】:2015-01-13 22:16:55
【问题描述】:

我以前用过:

"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 并被常春藤缓存删除rm -r ~/.ivy2/cache

【问题讨论】:

    标签: scala sbt specs2 sbt-assembly scalacheck


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      文档有误,你需要在构建文件中添加多条 SBT 行,特别是根据 Erics 的回答添加一条。

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-11-02
        • 2018-11-19
        • 2014-03-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多