Search code examples
macosscalasbtspecs2

Specs2 on OSX - error: object specs2 is not a member of package org


I am trying to run some Scala code on my OSX machine and keep on getting an error that says

error: object specs2 is not a member of package org

I have version 2.9.1-1 of Scala installed. I am also using verison 0.7.7 of sbt

My build.sbt file looks like this

name := "Comp-338-Web-App"

version := "1.0"

scalaVersion := "2.9.1"

scalacOptions += "-deprecation"

libraryDependencies ++= Seq(
  "junit" % "junit" % "4.7",
  "org.specs2" %% "specs2" % "1.8.2" % "test",
  "org.mockito" % "mockito-all" % "1.9.0",
  "org.hamcrest" % "hamcrest-all" % "1.1"
)

resolvers ++= Seq("snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
              "releases"  at "http://oss.sonatype.org/content/repositories/releases")

I've tried a bunch of different things but can't get it to run the test correctly.

Any advice?

Let me know if you need more information about the settings on my computer.


Solution

  • The solution looks simple: Please use the latest release of sbt, currently 0.11.2.

    The version 0.7.x you are using does not know how to use build.sbt, which was only introduced in sbt 0.9 or so.