为什么 sbt 试图下载不存在的依赖项? [英] Why is sbt trying to download non-existing dependencies?
问题描述
我已经下载了 SBT 0.3.15 并且我正在尝试运行它:现在,我只想运行 SBT 并获得提示;我还没有到我想要构建项目的阶段(尽管我希望很快就能做到).
I've downloaded SBT 0.3.15 and I'm trying to run it : for now, I just want to run SBT and get the prompt ; I am not at the stage where I want to build a project yet (even though I expect to be able to do it very soon).
但是,我遇到了 SBT 尝试下载的奇怪依赖项的问题.我最初遇到了代理问题,但现在好多了.SBT 尝试下载的第一件事是 jansi-project 1.11 的 pom.xml 并且它有效:
However, I face issues with strange dependencies that SBT tries to download. I initially faced issue with the proxy, but it's better now. The first thing that SBT tries to download is pom.xml for jansi-project 1.11 and it works :
downloading https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom ...
Maven Central: downloading https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom
to C:\Users\vfuchs070114\.ivy2\cache\org.fusesource.jansi\jansi\ivy-1.11.xml.original.part
sha1 file found for https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom: checking...
Maven Central: downloading https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom.sha1
to C:\Users\VFUCHS~1\AppData\Local\Temp\ivytmp1821470066062959950sha1
sha1 OK for https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom
[SUCCESSFUL ] org.fusesource.jansi#jansi;1.11!jansi.pom(pom.original) (1085ms)
它尝试下载的下一个文件是来自 Maven 中央仓库的 fusesource-pom-1.8.jar :
The next file it tries to download is fusesource-pom-1.8.jar from Maven central repo :
HTTP response status: 404 url=https://repo1.maven.org/maven2/org/fusesource/fusesource-pom/1.8/fusesource-pom-1.8.jar
CLIENT ERROR: Not Found url=https://repo1.maven.org/maven2/org/fusesource/fusesource-pom/1.8/fusesource-pom-1.8.jar
这里还有一些:
https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource/fusesource-pom/1.8/ivys/ivy.xml
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.fusesource/fusesource-pom/1.8/ivys/ivy.xml
https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi-project/1.11/ivys/ivy.xml
https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml
然后它失败了...因为即使通过我的浏览器,我也看不到这些 URL 上的任何可用内容,所以我排除了代理配置问题.
Then it fails... Since even through my browser I don't see anything available on these URLs, I'm ruling out a proxy config issue.
我应该如何获取这些依赖项,从哪里获取?
how am I supposed to get these dependencies, and from where ?
谢谢
推荐答案
经过几天的挣扎,我没有找到问题的确切答案,但我已经找到了解决方法.
After days of struggle, I don't have the exact answer to my question, but I've been able to find a workaround.
通过公司代理下载依赖项不起作用,我不知道为什么.我使用与配置 git 相同的属性来配置 SBT:我可以克隆 GitHub 项目,但 SBT 无法获取依赖项.SBT 日志中没有足够的具体信息来调查任何事情,所以我放弃了这个选项.
downloading dependencies through the corporate proxy just doesn't work and I don't know why. I configure SBT with same properties that I configure git : I'm able to clone GitHub projects, but SBT isn't able to get the dependencies. There's not enough specific infos in SBT logs to investigate anything, so I gave up this option.
我们将 Nexus 作为内部工件和外部存储库的代理.我要求负责它的团队在我们的 Nexus 上创建一个新的存储库,镜像 https://dl.bintray.com/typesafe/ivy-releases/ ,然后在我的配置中添加内部存储库 URL,如下所示:http://www.scala-sbt.org/0.13/docs/Proxy-Repositories.html
we have Nexus as internal artifactory and proxy for external repositories. I asked the team in charge of it to create a new repository on our Nexus, mirroring https://dl.bintray.com/typesafe/ivy-releases/ , and then added the internal repositories URL in my config, as suggested here : http://www.scala-sbt.org/0.13/docs/Proxy-Repositories.html
maven-internal-thirdparty-proxy: internal_proxy_url, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
ivy-internal-typesafe-proxy: internal_proxy_url, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
我不得不删除最初放置的 Internet 代理配置,以确保 SBT 不会尝试通过 Internet 代理访问内部代理存储库.
I had to remove the internet proxy config I had put initially, to make sure SBT doesn't try to go through internet proxy to reach the internal proxy repos.
这篇关于为什么 sbt 试图下载不存在的依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!