Scala sbt 无法找到 commons-logging-1.0.4.jar
我正在尝试让一个使用 sbt 构建的 scala 运行的开源项目。
我下载了 sbt 并进行了设置。但是当我尝试从命令行运行 sbt 时,出现以下错误。
:: 问题摘要 ::::: 警告 [未找到] commons-logging#commons-logging;1.0.4!commons-logging.jar (1ms)
==== Maven2 Local:已尝试
文件:///Users/jeremy/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
<前><代码> :::::::::::::::::::::::::::::::::::::::::::::: :: :: 下载失败 :: :: ^ 有关详细信息,请参阅解决消息 ^ :: ::::::::::::::::::::::::::::::::::::::::::::::::: :: commons-logging#commons-logging;1.0.4!commons-logging.jar ::::::::::::::::::::::::::::::::::::::::::::::::::: 使用详细或调试消息级别了解更多详细信息 下载 失败:commons-logging#commons-logging;1.0.4!commons-logging.jar sbt 执行期间出错:检索所需库时出错(请参阅 /Users/jeremy/sourceCode/public/scalaConsole/project/boot/update.log 完整日志)错误:无法检索 sbt 0.10.1
有关如何解决此问题的任何想法。
我有 scala 2.9.1 和 sbt 版本 0.10.1
谢谢
I am trying to get an open source project running with scala that is built using sbt.
I downloaded sbt and set it up. But when I try to run sbt from the command line, I get the following error.
:: problems summary :: :::: WARNINGS [NOT FOUND ]
commons-logging#commons-logging;1.0.4!commons-logging.jar (1ms)==== Maven2 Local: tried
file:///Users/jeremy/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
:::::::::::::::::::::::::::::::::::::::::::::: :: FAILED DOWNLOADS :: :: ^ see resolution messages for details ^ :: :::::::::::::::::::::::::::::::::::::::::::::: :: commons-logging#commons-logging;1.0.4!commons-logging.jar ::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS download
failed: commons-logging#commons-logging;1.0.4!commons-logging.jar
Error during sbt execution: Error retrieving required libraries (see
/Users/jeremy/sourceCode/public/scalaConsole/project/boot/update.log
for complete log) Error: Could not retrieve sbt 0.10.1
Any ideas on how I could resolve this.
I have scala 2.9.1 and sbt version 0.10.1
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在我删除
~/.m2/repository/commons-logging
和~/.ivy2/cache/commons-logging
后,它对我有用。如果 sbt 没有找到这两个路径中的任何一个,它实际上会尝试下载公共日志记录包。It worked for me after I removed both
~/.m2/repository/commons-logging
and~/.ivy2/cache/commons-logging
. If sbt founds none of this two paths it will actually try and download the commons logging package.有时,maven 无法正确下载文件,您只能在存储库中找到 .pom 文件,而没有 commons-logging-1.0.4.jar 文件。首先,我删除了 ~/.m2/repository/commons-logging。然后我从 http 手动下载了 jar ://search.maven.org/remotecontent?filepath=commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar 并最终使用以下命令安装了 jar mvn安装命令:
Sometimes maven doesn't download the files correctly and you'll only find a .pom file in the repository and no commons-logging-1.0.4.jar file. First I removed ~/.m2/repository/commons-logging. Then I downloaded the jar manually from http://search.maven.org/remotecontent?filepath=commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar and finally installed the jar using the mvn install command:
您在代理服务器后面吗?如果是这样,您可能需要修改 sbt bat 或 sh 脚本以将代理信息传递给 JVM,如下所示:
Are you behind a proxy server? If so you may need to modify your sbt bat or sh script to pass along the proxy information to the JVM like so:
我不知道问题的根本原因是什么。但我使用一个自动安装并启动 sbt 的脚本;所以我修改了脚本以在运行 sbt 之前下载 commons-logging。
sbt 启动器位于此处: https://gist.github.com/1274530
要运行 sbt,请保存在 $PATH 中的某个位置编写脚本,确保它是可执行的,然后通过输入 sbt 来运行它。
I don't know what the root cause of the issue is. But I use a script that automatically installs and launches sbt; so I modified the script to download commons-logging before running sbt.
The sbt launcher is here: https://gist.github.com/1274530
To run sbt, save the script somewhere in your $PATH, make sure that is executable, and run it by typing
sbt
.将 http://repo1.maven.org/maven 添加到项目中的 maven.repo.remote 属性.properties 文件。这将从 maven2 远程存储库下载文件。
旧条目:
新条目:
Add http://repo1.maven.org/maven to the maven.repo.remote property in your project.properties file. This will download the file from the maven2 remote repository.
Old entry:
New entry: