如何才能从SBT混帐拉依赖构件? [英] How can sbt pull dependency artifacts from git?
问题描述
我听说(我知道我已经看到太多的例子,如果只有我能记得在哪里)的 SBT
可以从一个混帐回购协议获得的依赖关系。
I've heard (and I know I've seen examples too, if only I can remember where) that sbt
can obtain dependencies from a git repo.
我期待获得从GitHub的依赖哈拉斯/向上。存储库不提供任何神器JAR文件中,只设置了待建使用 SBT
源树。那我想象这个过程是 SBT
会下载源回购,构建它,然后用其作为依赖构件。
I am looking to obtain the dependency harrah/up from github. The repository does not provide any artifact JAR files, only a source tree which is set up to be built using sbt
. The process that I am imagining is that sbt
will download the source repo, build it, and then use that as the dependency artifact.
我可想象 SBT
其实可以做这样的事情。它可以?如果是这样,怎么样?
I may be imagining that sbt
can in fact do something like this. Can it? And if so, how?
推荐答案
确实如此。你可以给你的项目
与 dependsOn
运营商的依赖,并可以通过URI引用Github上项目时,例如 RootProject(URI(混帐://github.com/dragos/dupcheck.git))
。或者,您可以 git的克隆
项目,然后用 RootProject(文件(...))
。请参见全配置的SBT维基细节和例子。
Yes indeed. You can give your Project
a dependency with the dependsOn
operator, and you can reference a Github project by its URI, for example RootProject(uri("git://github.com/dragos/dupcheck.git"))
. Alternatively, you can git clone
the project, and then reference your local copy with RootProject(file(...))
. See "Full Configuration" on the SBT wiki for details and examples.
这篇关于如何才能从SBT混帐拉依赖构件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!