我有一个SBT项目,该项目使用内部Nexus存储库来获取其某些依赖项。运行时update
,我看到以下警告消息:
[info] Resolving foo.bar.baz#foobar;2.0.1
...
[debug] The Repo of Interest: no ivy file found for foo.bar.baz#foobar;2.0.1
[warn] module not found: foo.bar.baz#foobar;2.0.1
[warn] ==== local: tried
...
... several irrelevant repositories omitted...
...
[warn] ==== The Repo of Interest: tried
[warn] http://internal.url.com/nexus/content/repositories/releases/foo/bar/baz/foobar/2.0.1/foobar-2.0.1.pom
...
... some other repositories omitted...
...
上面显示的URL似乎应该工作,因为我可以在浏览器中打开pom而不会出现问题(请注意,我已经修改了URL,所以您必须相信这是可行的)。 更令人困惑的是,我仅在尝试在某些计算机上构建时才看到此问题。 我什至开始调试此问题怎么办?我是否可以打开其他日志记录以了解为什么SBT / Ivy忽略了位于上述URL的POM?
更新:我的build.sbt定义解析器,如下所示:
resolvers := Seq(
...,
"The Repo of Interest" at "http://internal.url.com/nexus/content/repositories/releases",
...
)
此外,http://internal.url.com/nexus/content/repositories/releases/foo/bar/baz/foobar/2.0.1文件夹还具有pom,jar,源jar以及所有相关的md5和sha1这些文件。pom文件如下所示:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo.bar.baz</groupId>
<artifactId>foobar</artifactId>
<version>2.0.1</version>
<dependencies>
...
</dependencies>
</project>
更新#2:该构建似乎只在其他计算机上工作,因为它们已经在缓存下保存了相关jar的副本~/.ivy2/cache/foo/bar/baz/foobar/jars
。
更新#3:在更仔细地查看了日志记录之后,我相信这The Repo of Interest: no ivy file found for foo.bar.baz#foobar;2.0.1
是真正的错误消息
感谢您的所有建议!事实证明,在我的特殊情况下答案非常简单:所需的存储库URLhttps
而不是http
。在尝试使用Coursier的命令行工具手动通过以下命令获取jar时,我偶然发现了该解决方案:
coursier fetch -r http://internal.url.com/nexus/content/repositories/releases foo.bar.baz:foobar:2.0.1
然后产生类似于以下内容的输出:
Error:
foo.bar.baz:foobar:2.0.1
not found: /some/path/.ivy2/local/foo.bar.baz/foobar/2.0.1/ivys/ivy.xml
not found: https://repo1.maven.org/maven2/foo/bar/baz/foobar/2.0.1/foobar-2.0.1.pom
checksum format error: ...
没有任何not found: http://internal.url.com/nexus/content/repositories/releases...
一行似乎很奇怪,而我只是偶然想到URL可能实际上应该以开头https
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句