将SBT更新为0.13.0:
我有几个项目是用Scala 2.10.2编写的,用sbt 0.12.4构建的。因为我的操作系统是Ubuntu,所以我使用SBT.deb包来安装SBT0.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
如何修复此依赖项解析?
疑点:
项目配置:
文件: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
发布于 2013-08-29 20:37:52
我在~/.sbt/repositories
中添加了一些repos。这就解决了问题。现在,该文件如下所示:
[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
但我仍然担心的是,这是我和我的系统的个别情况,还是其他人也有这样的问题。我是不是误解了什么?因为如果我想使用构建工具,我不认为在安装后关心工具的依赖关系是我的责任。这应该由工具本身的安装来完成。
当然,关心项目的依赖关系是我的责任。
发布于 2013-09-05 09:52:22
我遇到了同样的问题,结果是pebcak (当然),在project/build.properties中指定0.13而不是0.13.0
浏览.sbt/boot/update.log中的输出非常有用,并将我引向问题所在(特别是在我注意到sbt在~/ -下载自身时运行正常之后--我注意到它正在寻找的ivy.xml与它在~/中先前尝试下载的那个不匹配)
发布于 2018-01-26 02:49:07
当我在OSX上的Java版本是1.6时,我也遇到了类似的错误消息。更新到1.8版本修复了这个问题。
https://stackoverflow.com/questions/18505176
复制相似问题