来自 GIT 的多项目可以用作 SBT 依赖项吗? [英] Can multi-projects from GIT be used as SBT dependencies?

查看:23
本文介绍了来自 GIT 的多项目可以用作 SBT 依赖项吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的项目中使用 banana-rdf,最好将其定义为 build.scala 使用 dependsOn:

I would like to use banana-rdf in my project, ideally by defining it as a dependency in a build.scala using dependsOn:

lazy val root = Project("root", file(".")) dependsOn RootProject(uri("git://github.com/w3c/banana-rdf"))

但是,banana-rdf 是一个 多项目,所以需要以不同的方式组成.据我所知,这些多项目定义只允许您将项目位置指定为文件路径,而不允许使用 URI.

However, banana-rdf is a multi-project so needs to be composed differently. From what I can see, these multi-project definitions only allow you to specify project locations as file paths, and won't allow URIs.

问题:我是否正确地说我必须将这些多项目 GIT 依赖项克隆到我的项目中并将它们作为文件夹引用?

Question: Am I right in saying that I have to clone these multi-project GIT dependencies into my project and reference them as folders?

我更喜欢将所有 GIT 克隆留给 SBT,并将这些克隆到某个 tmp SBT 文件夹中,而不是弄乱我的项目...

I rather like the idea of leaving all the GIT cloning up to SBT, and having these cloned in some tmp SBT folder rather than cluttering up my project...

推荐答案

我一直依赖于Banana RDF子项目的ProjectRef,像这样:

I depend on Banana RDF subprojects all the time with ProjectRef, like this:

lazy val core: Project = Project(
  ...
).dependsOn(
  ProjectRef(uri("git://github.com/w3c/banana-rdf.git"), "banana-jena")
)

一个特别好的部分是,您可以将提交或分支名称作为片段标识符添加到 URI 上,一切都完全按照您的预期工作.

One especially nice part is that you can just tack a commit or branch name as a fragment identifier on the URI and everything works exactly as you'd expect.

这篇关于来自 GIT 的多项目可以用作 SBT 依赖项吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆