且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用 SBT 从 Nexus 检索快照依赖项?

更新时间:2022-12-12 19:27:39

好的,我解决了这个问题,但它实际上不是 SBT 问题,它是 100% 用户错误.

Alright, I got this sorted out but it wasn't actually an SBT problem it was 100% user error.

我使用的 Nexus 需要身份验证.我没有正确设置身份验证凭据(查看我的身份验证问题)并且因为它没有正确验证它没有找到元数据pom文件,所以SBT打印出它失败的错误消息我错误地认为它验证但不解决.所以我开始弄乱实际问题中所证明的模式.

The Nexus I was using required authentication. I didn't have the authentication credentials set up correctly (see my authentication question) and because it wasn't properly authenticating it wasn't finding the metadata pom files and so SBT printed out the error message that it was failing I, incorrectly, assumed it was authenticating but not resolving. So I started messing with the patterns as evidenced in the actual question.

但是,既然我已经正确设置了身份验证,我就改回了一个常规的存储库声明,如下所示:

However, now that I have authentication setup correctly I changed back to just a regular repository declaration like so:

val snapshotsRepo = "Snapshots Repository" at "http://host:port/path/to/snapshots/root/"

一切正常.检索工件并解决依赖关系.

and everything works. Artifacts are retrieved and dependencies resolved.