Scala sbt file dependency from github repository

断了今生、忘了曾经 提交于 2021-02-19 05:20:13

问题


Is it possible to include a dependency from github? The repository does not have a jar file, just a build.sbt file and a source folder.


回答1:


You can create a new project which points to the source in your build.sbt and then use dependsOn:

lazy val projectIDependOn = RootProject(uri("git://github.com/user/Project.git"))

lazy val myProject = project in file("my-project").dependsOn(projectIDependOn)

An alternative approach would be to clone to github repository and then use sbt-assembly to create an uber JAR you can use, but that requires a bit more work.



来源:https://stackoverflow.com/questions/42206668/scala-sbt-file-dependency-from-github-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!