7

我的定义如下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/...

4

2 回答 2

0

更新到 sbt 0.13 后,我可以通过将以下行添加到 build.sbt 来使用我的私人仓库

resolvers += Resolver.ssh("Company Maven Repo", "git@github.com:company/company-repo.git", "/raw/master")

弹出一个对话框,询问我的 github 用户名和密码


这是一个错误!

例如,我使用 github 托管通过 SSH 访问的私有/内部 maven 存储库。如您所料,使用 Maven/POM 文件时,我可以毫不费力地提取工件。

但无法让 SBT (0.12.2) 工作。最令人沮丧的是它只是说

== REPO_NAME: tried

即使我指定了无效的身份验证或提供了错误的 ssh url,它也会执行相同的操作,即没有错误报告。

花了几个小时研究和尝试组合无济于事。因此我建议 SSH repos 不能正常工作。

于 2013-11-07T00:58:00.003 回答
-1

我找到了一个解决方案:从切换sshsftp

resolvers += {
  val privateKeyFile = new java.io.File(sys.env("HOME") + "/.ssh/id_rsa")
  Resolver.sftp("Bubble Foundry", "bubblefoundry.com", "/usr/local/repository/") as ("peter", privateKeyFile)
}
于 2013-05-16T14:10:14.287 回答