7

I am trying to use scala test and write:

resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.3")

into plugins.sbt and build.sbt looks as following:

libraryDependencies ++= Seq(
  "org.scalactic" %% "scalactic" % ScalaTest,
  "org.scalatest" %% "scalatest" % ScalaTest % "test"
)

SBT complains:

Error:Error while importing SBT project:<br/>...<br/><pre>[error]   at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:118)
[error]     at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2353)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:64)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.Execute.work(Execute.scala:266)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]     at java.lang.Thread.run(Thread.java:748)
[error] (*:update) sbt.librarymanagement.ResolveException: unresolved dependency: com.artima.supersafe#supersafe_2.12.4;1.1.3: not found
[error] (*:ssExtractDependencies) sbt.librarymanagement.ResolveException: unresolved dependency: com.artima.supersafe#supersafe_2.12.4;1.1.3: not found
[error] Total time: 4 s, completed Nov 23, 2017 1:58:40 PM</pre><br/>See complete log in <a href="file:/home/developer/.IntelliJIdea2017.2/system/log/sbt.last.log">file:/home/developer/.IntelliJIdea2017.2/system/log/sbt.last.log</a>

What am I doing wrong?

softshipper
  • 32,463
  • 51
  • 192
  • 400

1 Answers1

8

Try adding the resolver to the sbt global, as suggested in https://www.artima.com/supersafe_user_guide.html

Add the Artima Maven Repository as a resolver in ~/.sbt/0.13/global.sbt, like this:

resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"

I had it in the build.sbt file and moving it as per their instructions solved the issue for me. Good luck!

Omry Nachman
  • 232
  • 3
  • 4
  • 3
    Add more information, mind the path of the `global.sbt` file, yours might be a little bit different. To know exactly what the path is, go inside `~/.sbt/`. `` is automatically created as `sbt` ran. Some of yours is `0.13`, others might be `1.0` – Ken Block Jun 20 '19 at 04:37
  • The [Scala Test install guide](http://www.scalatest.org/install) blindly asserts `0.13`, and I was too dumb to notice I'm actually using `1.0`. Pay attention to this line in your console: `[info] Loading global plugins from /Users/xxx/.sbt/1.0/plugins`. Thanks @KenBlock – charles-allen Jan 17 '20 at 05:03