我正在尝试使用scala测试并写:
resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.3")
到plugins.sbt
和build.sbt
看起来如下:
libraryDependencies ++= Seq(
"org.scalactic" %% "scalactic" % ScalaTest,
"org.scalatest" %% "scalatest" % ScalaTest % "test"
)
SBT
抱怨:
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>
我做错了什么?
答案 0 :(得分:3)
尝试按照https://www.artima.com/supersafe_user_guide.html
中的建议将解析程序添加到 sbt global将Artima Maven存储库添加为〜/ .sbt / 0.13 / global.sbt 中的解析器,如下所示:
resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
我在build.sbt文件中有它并根据他们的指示移动它解决了我的问题。 祝你好运!