将 SBT 更新到 0.13.0:
我有几个使用 Scala 2.10.2 编写并使用 sbt 0.12.4 构建的项目。由于我的操作系统是 Ubuntu,我使用 SBT.deb 包安装 sbt 0.12.4。一切都很好。我用 sbt 构建了我的项目。
昨天我想更新 sbt 到 0.13.0 版本。我下载并安装了新的 .deb 包。项目配置未更改。
失败:
更新后运行 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
~/.sbt/update.log
文件可在此处获得:http://ubuntuone.com/6RDMgOqMnxdyKgfzrWVUNP
~/.sbt/boot/.update.log
文件在此处可用:http://ubuntuone.com/4KqYnSL9Mc1yrmRLbCx6bI
如何解决此依赖关系解析?
嫌疑人:
其他人也有类似的问题,例如 this ,但不一样。我不认为这是构建定义不兼容的问题,是吗?据我所见,SBT 并没有达到阅读项目定义的目的。
应该从哪里检索这个文件?不应该包含在SBT安装包中吗?此外,看起来 SBT/Ivy 只在本地 Ivy 存储库中查看。 Maven 中央存储库中没有版本 0.13.0 的 SBT 工件。我必须指定另一个 repo 吗?
那么 Scala 版本呢?不应该在依赖定义中指定吗?我必须在某处指定 Scala 版本吗?
项目配置:
文件:build.sbt
:
name := "MyProject"
version := "1.0-SNAPSHOT"
organization := "myOrg"
scalaVersion := "2.10.2"
libraryDependencies += "com.github.nscala-time" %% "nscala-time" % "0.4.2"
文件:project/plugins.sbt
:
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")
文件:project/build.properties
在这个问题之前我没有这个文件。我添加它是为了解决这个问题:
sbt.version=0.13.0
最佳答案
我在 ~/.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/
你也应该看看这个:http://www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Proxy-Repositories.html
但我仍然担心的问题是,这是否是我和我的系统的个别情况,或者其他人是否也有这样的问题。我是不是误会了什么?因为如果我想使用构建工具,我认为在安装后关心工具的依赖关系不应该是我的责任。这应该由工具的安装本身来完成。
当然,我有责任关心我的项目的依赖关系。
关于scala - 更新后 Unresolved 依赖 SBT 0.13.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18505176/