为多项目中的子项目指定不同版本的sbt? [英] Specify different version of sbt for a subproject in multi-project?

查看:43
本文介绍了为多项目中的子项目指定不同版本的sbt?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含几个子项目的多项目.

I have a multi-project containing a few subprojects.

根项目的project/build.properties包含

sbt.version=0.13.0

事实证明,由于依赖性问题,其中一个子项目仅适用于 0.12.4 版本.

It turned out that one of the subprojects works only with the version 0.12.4 due to a dependency issue.

我将带有那个版本的 build.properties 放到它的目录中,但它没有改变这个项目的 sbt 版本.

I put build.properties with that version into its directory but it didn't change the version of sbt for this project.

我该如何正确地做到这一点?有可能吗?

How do I do that properly? Is it possible at all?

推荐答案

现在,sbt 允许同一构建中的项目之间存在深层任务级依赖关系.因此,虽然每个项目都有自己的目录,但它们共享一个用于构建的类加载器,其中包含所有定义.

Right now, sbt allows deep task-level dependencies between projects in the same build. So, while the projects each have their own directory, they share one classloader for their build which has all the definitions.

这限制了您不能让构建共享不兼容的版本.

This places the limitation that you cannot have builds sharing incompatible versions.

将来可能会取消此限制,但现在我会执行以下操作之一:

Removing this restriction may be possible in the future, but for now I'd do one of the following:

  1. 继续使用 sbt 0.12.4 进行构建
  2. 将项目之间的所有通信迁移到 Ivy.有 2 个带有包装脚本的构建,该脚本以正确的顺序运行它们.

这篇关于为多项目中的子项目指定不同版本的sbt?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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