简体   繁体   English

为多项目中的子项目指定不同版本的sbt?

[英]Specify different version of sbt for a subproject in multi-project?

I have a multi-project containing a few subprojects. 我有一个包含几个子项目的多项目。

The root project's project/build.properties contains 根项目的project/build.properties包含

sbt.version=0.13.0

It turned out that one of the subprojects works only with the version 0.12.4 due to a dependency issue. 事实证明,由于存在依赖性问题,其中一个子项目仅适用于0.12.4版本。

I put build.properties with that version into its directory but it didn't change the version of sbt for this project. 我将带有该版本的build.properties放入其目录中,但它没有更改此项目的sbt版本。

How do I do that properly? 我该怎么做呢? Is it possible at all? 有可能吗?

Right now, sbt allows deep task-level dependencies between projects in the same build. 现在,sbt允许同一构建中项目之间的深层任务级别依赖性。 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. Just keep using sbt 0.12.4 for your build 只需继续使用sbt 0.12.4进行构建
  2. Migrate all communication between projects to happen via Ivy. 迁移项目之间的所有通信以通过Ivy进行。 Have 2 builds with a wrapper script which runs them in the correct order. 有2个带有包装器脚本的版本,该脚本以正确的顺序运行它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM