2011-09-18 80 views
7

我正在尝试运行一个使用sbt构建的scala的开源项目。Scala sbt找不到commons-logging-1.0.4.jar

我下载了sbt并设置了它。但是当我尝试从命令行运行sbt时,出现以下错误。

:: 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

关于如何解决这个问题的任何想法。

我有斯卡拉2.9.1和SBT版本0.10.1

感谢

+0

Update.log中的内容是什么? –

+1

我已经手动从maven仓库中取出该文件,现在它似乎可以正常工作。我不知道为什么它不能得到它。因为我已经拉过那个文件,所以我的update.log文件不再出现这个错误。 – fohtoh

+0

然后可能再次删除该文件... – soc

回答

0

你代理服务器的后面?如果是这样你可能需要修改你的SBT蝙蝠或sh脚本沿代理信息传递给JVM像这样:

java -XX:MaxPermSize=96m -Xmx512m -Dhttp.proxyHost=my.proxy.server.com -Dhttp.proxyPort=1234 -jar sbt-launch-0.10.1.jar 
+2

我有同样的问题sbt 0.11.0。这不是代理问题。 –

0

我不知道这个问题的根源是什么。但我使用一个脚本自动安装并启动sbt;所以我修改了脚本以在运行sbt之前下载commons-logging。

的SBT发射是在这里:https://gist.github.com/1274530

要SBT在$ PATH的某个地方运行,保存脚本,确保是可执行的,并通过键入sbt运行它。

5

有时Maven不能正确下载文件,只能在资源库中找到.pom文件,并且没有commons-logging-1.0.4.jar文件。首先我删除了〜/ .m2/repository/commons-logging。然后,我从http://search.maven.org/remotecontent?filepath=commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar手动下载罐子,最后使用MVN install命令安装的jar:

mvn install:install-file -DgroupId=commons-logging -DartifactId=commons-logging -Dversion=1.0.4 -Dpackaging=jar -Dfile=commons-logging-1.0.4.jar 
10

它为我工作我去掉两个~/.m2/repository/commons-logging~/.ivy2/cache/commons-logging后。如果sbt找不到这两条路径,它实际上会尝试下载公共日志记录包。

0

http://repo1.maven.org/maven添加到project.properties文件中的maven.repo.remote属性中。这将从maven2远程仓库下载文件。

旧条目:

maven.repo.remote=http://www.ibiblio.org/maven 

新条目:

maven.repo.remote=http://www.ibiblio.org/maven,http://repo1.maven.org/maven