scala 更新后未解决的依赖项 SBT 0.13.0

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18505176/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 05:36:43  来源:igfitidea点击:

Unresolved dependency SBT 0.13.0 after update

scalaconfigurationbuildsbtivy

提问by user573215

Update SBT to 0.13.0:

将 SBT 更新到 0.13.0:

I have a couple of projects written with Scala 2.10.2 and build with sbt 0.12.4. As my OS is Ubuntu I used the SBT.deb package for installation of sbt 0.12.4. Everything fine. I built my projects with sbt.

我有几个用 Scala 2.10.2 编写并用 sbt 0.12.4 构建的项目。由于我的操作系统是 Ubuntu,我使用 SBT.deb 包安装 sbt 0.12.4。一切都很好。我用 sbt 构建了我的项目。

Yesterday I wanted to update sbt to version 0.13.0. I downloaded and installed the new .deb package. The projects configuration has not been changed.

昨天我想将 sbt 更新到 0.13.0 版。我下载并安装了新的 .deb 包。项目配置没有改变。

The failure:

失败:

When runnging SBT after the update I get this failure:

更新后运行 SBT 时出现此故障:



$ sbt
Loading /usr/share/sbt/bin/sbt-launch-lib.bash
Getting org.scala-sbt sbt 0.13.0 ...

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

    ==== local: tried

      /home/myUser/.ivy2/local/org.scala-sbt/sbt/0.13.0/ivys/ivy.xml

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

        ::          UNRESOLVED DEPENDENCIES         ::

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

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

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



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


The ~/.sbt/update.logfile is available here: http://ubuntuone.com/6RDMgOqMnxdyKgfzrWVUNPThe ~/.sbt/boot/.update.logfile is available here: http://ubuntuone.com/4KqYnSL9Mc1yrmRLbCx6bI

~/.sbt/update.log文件可在此处获得:http: //ubuntuone.com/6RDMgOqMnxdyKgfzrWVUNP~/.sbt/boot/.update.log文件可在此处获得:http: //ubuntuone.com/4KqYnSL9Mc1yrmRLbCx6bI

How do I fix this dependency resolution?

如何修复此依赖项解析?

Suspects:

嫌疑人:

  1. Other people had similar problems like this, but not the same. I don't think this is a problem of build definition incompatibility, do you? As far as I can see, SBT does not get to the point to read the project definition.

  2. From where does this file should be retrieved? Shouldn't it be included in the SBT installation package? Also it looks like SBT / Ivy does only look inside the local Ivy repo. There is no SBT artifact with version 0.13.0 in the Maven Central Repository. Do I have to specify another repo or something?

  3. And what about the Scala version? Shouldn't it be specified in the dependency definition? Do I have to specify the Scala version somewhere?

  1. 其他人不得不像类似的问题这样,但不一样的。我不认为这是构建定义不兼容的问题,是吗?据我所知,SBT 没有达到阅读项目定义的地步。

  2. 应该从哪里检索这个文件?不应该包含在SBT安装包中吗?此外,看起来 SBT / Ivy 只查看本地 Ivy 存储库。Maven Central Repository 中没有版本为 0.13.0 的 SBT 工件。我是否必须指定另一个回购或其他东西?

  3. 那么 Scala 版本呢?不应该在依赖定义中指定吗?我是否必须在某处指定 Scala 版本?

Project configuration:

项目配置:

File: build.sbt:

文件build.sbt::



name := "MyProject"

version := "1.0-SNAPSHOT"

organization := "myOrg"

scalaVersion := "2.10.2"

libraryDependencies += "com.github.nscala-time" %% "nscala-time" % "0.4.2"


File: project/plugins.sbt:

文件project/plugins.sbt::

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")

File: project/build.properties

文件: project/build.properties

Prior to this problem I did not have this file. I added it trying to solve this problem:

在此问题之前,我没有此文件。我添加它试图解决这个问题:

sbt.version=0.13.0

回答by user573215

I added some repos to ~/.sbt/repositories. This solved the problem. Now the file looks like this:

我添加了一些 repos 到~/.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/

You should look at this, too: http://www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Proxy-Repositories.html

你也应该看看这个:http: //www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Proxy-Repositories.html

But what still worries me is the question if this is an individual case for me and my system or if others have such problems, too. Did I misunderstand something? Because if I want to use a build tool, I don't think it should be my responsibility to care about the tool's dependencies after installation. That should be done by the tool's installation itself.

但仍然让我担心的是,这是否是我和我的系统的个别情况,或者其他人是否也有这样的问题。我是不是误会了什么?因为如果我想使用构建工具,我认为安装后不应该关心工具的依赖关系。这应该由工具的安装本身完成。

Of course it is my responsibility to care about my project's dependencies.

当然,关心我的项目的依赖是我的责任。

回答by Peter vR

I ran into the same problem, turned out to be pebcak (of course), specifying 0.13 instead of 0.13.0 in project/build.properties

我遇到了同样的问题,结果是pebcak(当然),在project/build.properties中指定0.13而不是0.13.0

Stepping through the output in .sbt/boot/update.log was pretty useful and lead me to the issue (especially after I noticed that sbt ran ok in ~/ - downloading itself - I noticed the ivy.xml it was looking for didn't match the one it downloaded from that earlier attempt in ~/)

单步执行 .sbt/boot/update.log 中的输出非常有用并引导我解决问题(特别是在我注意到 sbt 在 ~/ 中运行正常之后 - 下载本身 - 我注意到它正在寻找的 ivy.xml 没有” t 匹配它从早期尝试中下载的那个 ~/)

回答by Mike

I had a similar error message when my version of Java on OSX was 1.6. Updating to 1.8 fixed this issue for me.

当我在 OSX 上的 Java 版本为 1.6 时,我收到了类似的错误消息。更新到 1.8 为我解决了这个问题。