我正在尝试使用 Scala 设置 API,并发现一些在线资源建议
akka
。我是 Scala 新手,所以我正在关注一些文档,并查看 https://doc.akka.io/docs/akka/current/typed/actors.html 获取官方文档和版本。我已经在我的 build.sbt 中进行了该设置,其余的库依赖项如下:
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor-typed" % akkaVersion,
)
当我尝试运行 sbt run 时,出现错误
sbt.librarymanagement.ResolveException: Error downloading com.typesafe.akka:akka-actor-typed_3:2.9.7
。我已验证此处存在软件包和版本:https://doc.akka.io/docs/akka/current/typed/actors.html。我想知道我的设置或配置是否不正确。
任何有关如何解决此问题的帮助将不胜感激!完整的错误日志如下供参考:
Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.typesafe.akka:akka-actor-typed_3:2.9.7
[error] Not found
[error] Not found
[error] not found: /Users/env/.ivy2/localcom.typesafe.akka/akka-actor-typed_3/2.9.7/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/typesafe/akka/akka-actor-typed_3/2.9.7/akka-actor-typed_3-2.9.7.pom
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:346)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$39(CoursierDependencyResolution.scala:315)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:315)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:60)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:142)
[error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:74)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:144)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:131)
[error] at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:220)
[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:169)
[error] at sbt.Classpaths$.$anonfun$updateTask0$1(Defaults.scala:3894)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:69)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[error] at sbt.Execute.work(Execute.scala:292)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
[error] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[error] at java.base/java.lang.Thread.run(Thread.java:1575)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.typesafe.akka:akka-actor-typed_3:2.9.7
[error] Not found
[error] Not found
[error] not found: /Users/env/.ivy2/localcom.typesafe.akka/akka-actor-typed_3/2.9.7/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/typesafe/akka/akka-actor-typed_3/2.9.7/akka-actor-typed_3-2.9.7.pom
[error] Total time: 1 s, completed Oct 23, 2024, 3:02:16 p.m.
正如Akka - Actors 简介中详细介绍的那样(与您共享的链接相同)
模块信息
Akka 依赖项可从 Akka 的库存储库中获取。要在那里访问它们,您需要配置此存储库的 URL。
resolvers += "Akka library repository".at("https://repo.akka.io/maven")
根据您共享的
build.sbt
配置,该行缺失