SBT does not find scalatest for scala 2.10.1

I am trying to learn how to use SBT, and the following simple example I found does not 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 used maven before trying sbt and the following dependency works fine:

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

I got the following result trying to start 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 don’t have any kind of repository or something like that?

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?

+4
source share
1 answer

To ensure this is not a potential SBT project configuration problem, do not use the %% notation at this time. In fact, this one automatically selects the version of Jar that matches your current version of scala, which may be different from what you expect (supervision in your conf, conflict of variables in some configuration files, etc.).

Prefer this to isolate the "error" context:

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

I just tried that works well.

+8
source

Source: https://habr.com/ru/post/1484827/


All Articles