sbt如何从git中拉取相关文件?(How can sbt pull dependency artifacts from git?)

编程入门 行业动态 更新时间:2024-10-26 16:25:40
sbt如何从git中拉取相关文件?(How can sbt pull dependency artifacts from git?)

我已经听到(我知道我也看过例子,如果我只记得在哪里) sbt可以从git repo获得依赖。

我正在寻找从github获得依赖的harrah / up 。 存储库不提供任何工件JAR文件,只能使用设置为使用sbt构建的源代码树。 我想象的过程是, sbt将下载源代码,构建它,然后将其用作依赖项工件。

我可能会想象, 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.

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.

I may be imagining that sbt can in fact do something like this. Can it? And if so, how?

最满意答案

确实是的。 您可以使用dependsOn运算符给您的Project一个依赖关系,您可以通过其URI来引用Github项目,例如RootProject(uri("git://github.com/dragos/dupcheck.git")) 。 或者,您可以git clone项目,然后使用RootProject(file(...))引用本地副本。 有关详细信息和示例,请参阅SBT wiki上的“完整配置” 。

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.

更多推荐

本文发布于:2023-07-26 19:00:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1279601.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   中拉取   git   sbt   dependency

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!