Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sbt project depending on a external & private github repository

Tags:

github

scala

sbt

this tutorial explains clearly how to have a remote github depency dependence in an sbt project using:

lazy val reponame = RootProject(uri("git://github.com/group/reponame.git"))
lazy val root = Project(id = "MLSS", base = file("."), settings = sharedSettings) dependsOn(reponame)

However if the remote repo is private, it doesn't seem to work and throws a

Repository not found.
Cloning into '/Users/.../b6958781f05b85672849/reponame'...
[error] Nonzero exit code (128): git clone git://github.com/group/reponame.git

it seems to be an auth error but how to specify the key? thanks

like image 871
Mermoz Avatar asked Sep 18 '13 14:09

Mermoz


2 Answers

For a private repo, you want to use SSH so authentication uses your keys instead of a username & password. The github provided SSH url [email protected]:group/reponame.git isn't a correctly formed URI, but it's equivalent to ssh://[email protected]/group/reponame.git. I just tried a uri dependency on a private repo URL formatted that way and it worked for me. Reference.

like image 64
Kelsey Gilmore-Innis Avatar answered Oct 18 '22 21:10

Kelsey Gilmore-Innis


just using the https version worked fine to clone the repo (provided you have the key in your sshconfig) but it doesn't add the modules to the classpath:

lazy val pogistan = RootProject(uri("https://github.com/group/reponame.git"))
like image 35
Mermoz Avatar answered Oct 18 '22 20:10

Mermoz