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

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

问题描述

我想在项目中使用 banana-rdf ,最好将其定义为使用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...

推荐答案

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

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天全站免登陆