将依赖项存储在私有GitHub或Bitbucket存储库中

mku*_*urz 6 scala sbt

我们正在使用sbt 0.13.9,我们希望使用私有 GitHub仓库来存储公司范围的依赖项.我试着像这样向解析器添加一个私有的 GitHub repo:

resolvers += Resolver.ssh("Company Repo", "git@github.com:company/company-repo.git", "/raw/master")(Resolver.ivyStylePatterns)
// or
resolvers += Resolver.ssh("Company Repo", "git@github.com:company/company-repo.git", "/raw/master")(Resolver.ivyStylePatterns) as("githubuser")
// or
resolvers += Resolver.ssh("Company Repo", "git@github.com:company/company-repo.git", "/raw/master")(Resolver.ivyStylePatterns) as("githubuser", "password")
// or
resolvers += {
    val keyFile: File = new File(Path.userHome.absolutePath + "/.ssh/id_rsa")
    Resolver.ssh("Company Repo", "git@github.com:company/company-repo.git", "/raw/master")(Resolver.ivyStylePatterns) as("githubuser", keyFile)
}
// or
resolvers += {
    val keyFile: File = new File(Path.userHome.absolutePath + "/.ssh/id_rsa")
    Resolver.ssh("Company Repo", "git@github.com:company/company-repo.git", "/raw/master")(Resolver.ivyStylePatterns) as("githubuser", keyFile, "keyFilePassword")
}
Run Code Online (Sandbox Code Playgroud)

(对于没有提供用户和/或没有密码的解析器,弹出窗口似乎输入用户名/密码.)

但是,它总是失败:

[warn] ==== Company Maven Repo: tried
[warn]   com.company/my-module_2.11/2.0.0/ivys/ivy.xml
Run Code Online (Sandbox Code Playgroud)

回购中文件的位置是正确的,我100%肯定.

可以git根据解析器处理回购吗?有人有一个私人 GitHub回购的工作示例吗?Bitbucket也没关系.

再次,回购是私有的,回购是一个git回购,而不是http(s)sftp.

哦,是的,我知道bintray,但是现在我们不想每月支付45美元来管理2个开发者的3个依赖项.

PS:我的配置基于以下示例