参考私人git repo的SBT构建失败

时间:2018-07-06 14:08:20

标签: git scala sbt

我决定在多个git存储库上拆分一个庞大的SBT多模块项目。所有存储库都托管在私有存储库中。

当我在build.sbt中使用这样的行时:

lazy val common = ProjectRef(uri("git://github.com:PRIVATE-ORG/akka-common.git"), "akka-common")

SBT引发错误:

fatal: Unable to look up github.com:PRIVATE-ORG (port 9418) (nodename nor servname provided, or not known)

我尝试在可以访问这些私有存储库的本地计算机上运行SBT构建。

更新

我尝试更改协议:

lazy val common = ProjectRef(uri("ssh://git@github.com:PRIVATE-ORG/akka-common.git"), "akka-common")

错误已更改:

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

如何处理问题?

1 个答案:

答案 0 :(得分:1)

此问题已通过2个步骤解决:

  1. uri中更改ProjectRef的格式:
lazy val common = ProjectRef(uri("https://github.com/PRIVATE-ORG/akka-common.git"), "common")
  1. Adding of GitHub ssh key to the ssh agent

完成这些步骤后,一切都按预期开始工作!