微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

SBT 无法解析依赖项 [ResolveException]

如何解决SBT 无法解析依赖项 [ResolveException]

我的 build.sbt 文件中有以下内容

lazy val root = (project in file(".")).
  settings(
    inThisBuild(List(
      scalaVersion := "2.13.4",)),name := "ScalaTest",resolvers += "spigot-repo" at "https://hub.spigotmc.org/nexus/content/repositories/snapshots/",libraryDependencies += "org.spigotmc" % "spigot-api" % "1.16.5-R0.1-SNAPSHOT" % "provided" intransitive(),version := "1.0"
  )

当使用 IntelliJ 并尝试刷新/重新导入项目时,会出现一些问题:

  • 尽管使用了 Maven/Gradle,但依赖项仍无法解决
  • 产生以下错误
/Users/harrydrummond/Library/Java/JavaVirtualMachines/openjdk-15.0.1/Contents/Home/bin/java -Djline.terminal=jline.UnsupportedTerminal -Dsbt.log.noformat=true -Dfile.encoding=UTF-8 -Didea.managed=true -Dfile.encoding=UTF-8 -jar /Users/harrydrummond/Library/Application Support/JetBrains/ToolBox/apps/IDEA-U/ch-0/203.7148.57/IntelliJ IDEA.app.plugins/Scala/launcher/sbt-launch.jar
[info] welcome to sbt 1.4.7 (Oracle Corporation Java 15.0.1)
[info] loading global plugins from /Users/harrydrummond/.sbt/1.0/plugins
[info] loading settings for project t-build from plugins.sbt ...
[info] loading project deFinition from /Users/harrydrummond/Documents/workspace/scala/t/project
[info] loading settings for project root from build.sbt ...
[info] set current project to ScalaTest (in build file:/Users/harrydrummond/Documents/workspace/scala/t/)
[info] sbt server started at local:///Users/harrydrummond/.sbt/1.0/server/26df0aea2f87fd17e7ab/sock
[info] started sbt server
sbt:ScalaTest>
;set _root_.scala.collection.Seq(historyPath := None,shellPrompt := { _ => "" },SettingKey[_root_.scala.Option[_root_.sbt.File]]
("sbtStructureOutputFile")
in _root_.sbt.Global := _root_.scala.some(_root_.sbt.file("/private/var/folders/kf/q70qvrg10ls9qd7vvb8zlvgr0000gn/T/sbt-structure.xml")),SettingKey[_root_.java.lang.String]("sbtStructureOptions")
in _root_.sbt.Global := "download,resolveClassifiers")
[info] Defining Global / sbtStructureOptions,Global / sbtStructureOutputFile and 1 others.
[info] The new values will be used by cleanKeepGlobs
[info]  Run `last` for details.
[info] Reapplying settings...
[info] set current project to ScalaTest (in build file:/Users/harrydrummond/Documents/workspace/scala/t/)
[info] Applying State transformations org.jetbrains.sbt.CreateTasks from /Users/harrydrummond/Library/Application Support/JetBrains/ToolBox/apps/IDEA-U/ch-0/203.7148.57/IntelliJ IDEA.app.plugins/Scala/repo/org.jetbrains/sbt-structure-extractor/scala_2.12/sbt_1.0/2020.3/jars/sbt-structure-extractor.jar
[info] Reapplying settings...
[info] set current project to ScalaTest (in build file:/Users/harrydrummond/Documents/workspace/scala/t/)
[warn]
[warn]  Note: Unresolved dependencies path:
[error] stack trace is suppressed; run 'last update' for the full output
[error] stack trace is suppressed; run 'last ssExtractDependencies' for the full output
[error] (update) sbt.librarymanagement.ResolveException: Error downloading org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT
[error]   Not found
[error]   Not found
[error]   not found: /Users/harrydrummond/.ivy2/localorg.spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/spigot-api-1.16.5-R0.1-SNAPSHOT.pom
[error]   download error: Caught java.io.IOException: Server returned HTTP response code: 403 for URL: https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/spigot-api-1.16.5-R0.1-SNAPSHOT.pom (Server returned HTTP response code: 403 for URL: https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/spigot-api-1.16.5-R0.1-SNAPSHOT.pom) while downloading https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/spigot-api-1.16.5-R0.1-SNAPSHOT.pom
[error] (ssExtractDependencies) sbt.librarymanagement.ResolveException: Error downloading org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT
[error]   Not found
[error]   Not found
[error]   not found: /Users/harrydrummond/.ivy2/localorg.spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/spigot-api-1.16.5-R0.1-SNAPSHOT.pom
[error]   download error: Caught java.io.IOException: Server returned HTTP response code: 403 for URL: https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/spigot-api-1.16.5-R0.1-SNAPSHOT.pom (Server returned HTTP response code: 403 for URL: https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/spigot-api-1.16.5-R0.1-SNAPSHOT.pom) while downloading https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.16.5-R0.1-SNAPSHOT/spigot-api-1.16.5-R0.1-SNAPSHOT.pom
[error] Total time: 1 s,completed 21 Feb 2021,16:54:13
[info] shutting down sbt server

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。