Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT not finding scalatest for scala 2.10.1

Tags:

sbt

scalatest

I'm trying to learn how to use SBT and the following simple example I've found fails to find the version for scalatest:

name := "DoingItWrong"

version := "0.0.1"

scalaVersion := "2.10.1"

libraryDependencies ++= Seq (
  "org.scalatest" %% "scalatest" % "1.9.1" % "test"
)

I was using maven before trying sbt and the following dependency works ok:

<dependency>                                                            
   <groupId>org.scalatest</groupId>                                    
   <artifactId>scalatest_2.10</artifactId>                             
   <version>1.9.1</version>                                            
</dependency> 

I got the following output trying to run SBT:

$ sbt package              
[info] Loading global plugins from /home/rafael/.sbt/plugins
[info] Set current project to DoingItWrong (in build file:/home/rafael/Dev/DoingItWrong/)
[info] Updating {file:/home/rafael/Dev/DoingItWrong/}default-c52ace...
[info] Resolving org.scala-lang#scala-library;2.10.1 ...
[info] Resolving org.scalatest#scalatest_2.10.1;1.9.1 ...
[warn]  module not found: org.scalatest#scalatest_2.10.1;1.9.1
[warn] ==== local: tried
[warn]   /home/rafael/.ivy2/local/org.scalatest/scalatest_2.10.1/1.9.1/ivys/ivy.xml
[warn] ==== Sonatype snapshots: tried
[warn]   http://oss.sonatype.org/content/repositories/snapshots/org/scalatest/scalatest_2.10.1/1.9.1/scalatest_2.10.1-1.9.1.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/scalatest/scalatest_2.10.1/1.9.1/scalatest_2.10.1-1.9.1.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scalatest#scalatest_2.10.1;1.9.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/home/rafael/Dev/DoingItWrong/}default-c52ace/*:update: sbt.ResolveException: unresolved dependency: org.scalatest#scalatest_2.10.1;1.9.1: not found
[error] Total time: 1 s, completed Jun 6, 2013 9:45:49 AM

I'm I lacking some repository or something?

I also tried scalaVersion := "2.10.0" and 2.10.0-M4. What is the latest available version for scalatest for Scala 2.10 via SBT?

like image 683
Rafael S. Calsaverini Avatar asked Feb 17 '23 08:02

Rafael S. Calsaverini


1 Answers

To be sure that it's not a potential SBT project's configuration issue, don't use for now the %% notation. Indeed, this one automatically chooses the Jar version corresponding to your current scala version, which may be different than the one you expect (oversight in your conf, conflict of variables in some configuration files etc...).

Prefer this in order to isolate your "error" context:

libraryDependencies += "org.scalatest" % "scalatest_2.10" % "1.9.1" % "test"

I've just tried it, that works well.

like image 57
Mik378 Avatar answered Feb 18 '23 21:02

Mik378