Search code examples
scalasbtspecs2sbt-assemblyscalacheck

Cannot compile ScalaCheck with specs2 since upgrading


I used to use:

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

Which worked fine, then I upgraded my dependencies to what I think are the latest:

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

Which should be correct according to http://etorreborre.github.io/specs2/

But now ScalaCheck is not being recognised as a member of 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]        ^

I've done sbt clean and removed by ivy cache rm -r ~/.ivy2/cache


Solution

  • You need to add the specs2-scalacheck module to your build.