【问题标题】:Unresolved dependency: org.scala-sbt#sbt;0.13: not found when running sbt 0.13?未解决的依赖关系:org.scala-sbt#sbt;0.13:运行 sbt 0.13 时未找到?
【发布时间】:2020-07-17 11:23:51
【问题描述】:

我有一个由几个项目组成的 Scala 项目。我决定开始使用 sbt 0.13。这里是~/sbt/repositories

[repositories]
  local
  sbt-releases-repo: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  sbt-plugins-repo: http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  maven-central: http://repo1.maven.org/maven2/

但我仍然收到错误:

Getting org.scala-sbt sbt 0.13 ...

:: problems summary ::
:::: WARNINGS
        module not found: org.scala-sbt#sbt;0.13

    ==== local: tried

      /home/alex/.ivy2/local/org.scala-sbt/sbt/0.13/ivys/ivy.xml

    ==== sbt-releases-repo: tried

      http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13/ivys/ivy.xml

    ==== sbt-plugins-repo: tried

      http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt/0.13/ivys/ivy.xml

    ==== maven-central: tried

      http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13/sbt-0.13.pom

        ::::::::::::::::::::::::::::::::::::::::::::::

        ::          UNRESOLVED DEPENDENCIES         ::

        ::::::::::::::::::::::::::::::::::::::::::::::

        :: org.scala-sbt#sbt;0.13: not found

        ::::::::::::::::::::::::::::::::::::::::::::::



:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13: not found
Error during sbt execution: Error retrieving required libraries
  (see /home/alex/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13

如果我删除此文件,则错误仍然存​​在。

【问题讨论】:

  • “我决定开始使用 sbt 0.13” 是什么意思?你下载 sbt 0.13 了吗?
  • 你的意思是 ~/.sbt/repositories 而不是 ~/sbt/repositories?

标签: scala sbt


【解决方案1】:

尝试使用0.13.1

将以下内容放入project/build.properties

sbt.version=0.13.1

您可能还需要0.13 sbt 启动器。见sbt Getting-Started - Setup

【讨论】:

  • 我做到了,但我得到了另一个错误:[ERROR] Terminal initialization failed; falling back to unsupported java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected -- JLine incompatibility detected. Check that the sbt launcher is version 0.13.x or later
【解决方案2】:

您似乎遇到了版本不匹配的问题。

如果您修改了project/build.properties 以包含sbt.version=0.13.0,这可能意味着您使用了错误的启动器。

尝试运行

sbt sbt-version

并检查版本是否与project/build.properties 中的 sbt 版本匹配。

【讨论】:

  • 如何更改正在使用的启动器?
【解决方案3】:

我在 Ubuntu 上第一次安装 openjdk-9-jdk 和 openjdk-8-jdk 时遇到了同样的问题。

我最终卸载了 rm -rfing /etc/ssl/certs/java/etc/java-*,重新安装 openjdk-8-jdk 并运行 sudo update-ca-certificates -f,这为我解决了问题。

【讨论】:

  • 这是唯一对我有用的东西。使用 Ubuntu 18.04 并安装了 open-jdk 8 和 11。我使用 this 卸载 Java。然后我再次安装了 open-jdk-8-jdk 就是这样。
【解决方案4】:

只需两步

  1. 使用更新证书

    $ update-ca-certificates -f
    
  2. 输入

    $ sbt  
    

如果连接到互联网,它将获取必要的文件。

【讨论】:

  • 答案真的属于这个问题吗?我没有看到任何与证书相关的内容。
猜你喜欢
  • 2012-11-24
  • 2013-12-08
  • 2013-05-16
  • 1970-01-01
  • 2020-01-20
  • 2013-10-27
  • 1970-01-01
  • 2018-11-11
  • 2014-01-12
相关资源
最近更新 更多