【问题标题】:Scala sbt unable to find commons-logging-1.0.4.jarScala sbt 找不到 commons-logging-1.0.4.jar
【发布时间】:2011-11-19 19:16:41
【问题描述】:

我正在尝试让一个使用 sbt 构建的 scala 运行的开源项目。

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

:: 问题总结 :: :::: WARNINGS [NOT FOUND ] commons-logging#commons-logging;1.0.4!commons-logging.jar (1ms)

==== Maven2 本地:尝试过

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

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

:: 使用详细或调试消息级别获取更多详细信息下载 失败: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

谢谢

【问题讨论】:

  • 我已经从 maven 存储库中手动提取了该文件,它现在似乎可以工作了。我不知道为什么它不能得到它。因为我已经提取了该文件,所以我的 update.log 文件不再存在并出现错误。
  • 那么可能会再次删除文件...
  • 我对 sbt 0.11.0 有同样的问题。这是我的 update.log 文件:gist.github.com/1274448
  • 我遇到了同样的问题,通过手动下载 jar 并将其放入我的本地 maven 存储库中解决了这个问题

标签: scala sbt


【解决方案1】:

在我删除 ~/.m2/repository/commons-logging~/.ivy2/cache/commons-logging 后,它对我有用。如果 sbt 没有找到这两个路径,它实际上会尝试下载 commons 日志包。

【讨论】:

    【解决方案2】:

    有时 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手动下载了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
    

    【讨论】:

      【解决方案3】:

      您在代理服务器后面吗?如果是这样,您可能需要修改 sbt bat 或 sh 脚本以将代理信息传递给 JVM,如下所示:

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

      【讨论】:

      • 我对 sbt 0.11.0 也有同样的问题。这不是代理问题。
      【解决方案4】:

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

      sbt 启动器在这里:https://gist.github.com/1274530

      要运行 sbt,请将脚本保存在 $PATH 中的某个位置,确保它是可执行的,然后键入 sbt 运行它。

      【讨论】:

        【解决方案5】:

        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
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2020-08-12
          • 2018-05-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-08-26
          • 2018-07-29
          相关资源
          最近更新 更多