我的定义如下build.sbt
:
libraryDependencies += "com.bubblefoundry" %% "something" % "0.1-SNAPSHOT"
resolvers += {
val privateKeyFile = new java.io.File(sys.env("HOME") + "/.ssh/id_rsa")
Resolver.ssh("Bubble Foundry", "bubblefoundry.com", "/usr/local/repository/") as ("peter", privateKeyFile) withPermissions("0644")
}
当 sbt 尝试解决依赖关系时,它失败了:
[info] Resolving com.bubblefoundry#something_2.10;0.1-SNAPSHOT ...
[warn] module not found: com.bubblefoundry#something_2.10;0.1-SNAPSHOT
[warn] ==== local: tried
[warn] /Users/peter/.ivy2/local/com.bubblefoundry/something_2.10/0.1-SNAPSHOT/ivys/ivy.xml
[warn] ==== Bubble Foundry: tried
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/com.bubblefoundry/something_2.10/0.1-SNAPSHOT/something_2.10-0.1-SNAPSHOT.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.bubblefoundry#something_2.10;0.1-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
看起来它甚至没有连接到服务器来查找依赖项。这是为什么?难道我做错了什么?
依赖项已发布(使用相同的解析器定义)到/usr/local/repository/com/bubblefoundry/...
更新到 sbt 0.13 后,我可以通过将以下行添加到 build.sbt 来使用我的私人存储库
resolvers += Resolver.ssh("Company Maven Repo", "[email protected] /cdn-cgi/l/email-protection:company/company-repo.git", "/raw/master")
弹出一个对话框,询问我的 github 用户名和密码
这是一个错误!
例如,我使用 github 来托管通过 SSH 访问的私有/内部 Maven 存储库。当您使用 Maven/POM 文件时,我可以毫无困难地提取工件,正如您所期望的那样。
但无法让 SBT (0.12.2) 工作。最令人沮丧的是它只是说
== REPO_NAME: tried
即使我指定无效的身份验证或提供错误的 ssh url,它也会执行相同的操作,即没有错误报告。
花了几个小时研究并尝试组合但无济于事。因此我建议 SSH 存储库无法正常工作。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)