scalacheck/scalatest not found: how to add it in sbt/scala?
Posted
by
Pavel Reich
on Stack Overflow
See other posts from Stack Overflow
or by Pavel Reich
Published on 2012-06-01T00:22:46Z
Indexed on
2012/06/01
4:41 UTC
Read the original article
Hit count: 604
I've installed typesafe-stack from http://typesafe.com/stack/download on my ubuntu12, than I created a play project (g8 typesafehub/play-scala) and now I want to add scalatest or scalacheck to my project.
So my_app/project/plugins.sbt has the following lines:
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0.1")
Then I added scalatest using addSbtPlugin:
addSbtPlugin("org.scalatest" %% "scalatest" % "2.0.M1" % "test")
and now it fails with the following message when I run 'sbt test'
[info] Resolving org.scalatest#scalatest;2.0.M1 ...
[warn] module not found: org.scalatest#scalatest;2.0.M1
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.scalatest/scalatest/scala_2.9.1/sbt_0.11.3/2.0.M1/ivys/ivy.xml
[warn] ==== local: tried
[warn] ~/.ivy2/local/org.scalatest/scalatest/scala_2.9.1/sbt_0.11.3/2.0.M1/ivys/ivy.xml
[warn] ==== Typesafe repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.9.1_0.11.3/2.0.M1/scalatest-2.0.M1.pom
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy- releases/org.scalatest/scalatest/scala_2.9.1/sbt_0.11.3/2.0.M1/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scalatest/scalatest_2.9.1_0.11.3/2.0.M1/scalatest-2.0.M1.pom
What I don't understand: why does it use this http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.9.1_0.11.3/2.0.M1/scalatest-2.0.M1.pom URL instead of the real one http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.9.1/2.0.M1/scalatest_2.9.1-2.0.M1.pom?
Quite the same problem I have with scalacheck: it also tries to download using sbt-version specific artifactId whereas the repository has only scala-version specific.
What am I doing wrong? I understand there must be a switch in sbt somewhere, not to use sbt-version as part of the artifact URL?
I also tried using this in my plugins.sbt
libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M1" % "test"
but looks like it is completely ignored by sbt and scalatest.jar hasn't appeared in the classpath:
my_app/test/AppTest.scala:1: object scalatest is not a member of package org
[error] import org.scalatest.FunSuite
because the output of sbt clean && sbt test has lots of Resolving org.easytesting#fest-util;1.1.6 or just another library, but nothing about scalatest.
I use scala 2.9.1 and sbt 0.11.3, trying to use scalatest 2.0.M1 and 1.8; scalacheck:
resolvers ++= Seq(
"snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
"releases" at "http://oss.sonatype.org/content/repositories/releases"
)
libraryDependencies ++= Seq(
"org.scalacheck" %% "scalacheck" % "1.9" % "test"
)
With the same outcome, i.e. it uses the sbtVersion specific POM URL, which doesn't exist.
What am I doing wrong? Thanks.
© Stack Overflow or respective owner