代码之家  ›  专栏  ›  技术社区  ›  Alex Fruzenshtein

在私有git repo上引用sbt构建失败

  •  0
  • Alex Fruzenshtein  · 技术社区  · 6 年前

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

    当我用这样的台词 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构建,在本地计算机上我可以访问这些私有repo。

    更新

    我试图改变一个协议:

    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 回复  |  直到 6 年前
        1
  •  1
  •   Alex Fruzenshtein    6 年前

    通过两个步骤解决了问题:

    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

    在这些步骤之后,一切都按预期开始工作了!