sbt.boot.properties 是否在 sbt 0.10+ 中使用?
pre-sbt 0.10.0
使用 sbt.boot.properties
来定义 sbt 的启动配置文件。
sbt 0.10.0 定义启动属性的“方式”是什么?
我正在寻找由 -Dsbt.boot.properties=...
激活的 sbt.boot.properties
(不是 build.properties
)的等效项代码>
pre-sbt 0.10.0
used an sbt.boot.properties
to define sbt's boot configuration file.
What is the sbt 0.10.0 "way" of defining boot properties?
I am looking for the equivalent of sbt.boot.properties
(not build.properties
) that's activated by -Dsbt.boot.properties=...
sbt.boot.properties
存在于0.10
中(直到并包括0.13.1
,这是目前 sbt 的最新版本),本质上是与以前相同。主要的补充是 默认sbt.boot.properties 设置为允许系统属性定义一些属性。这可以避免在某些常见情况下使用自定义 sbt.boot.properties 的需要。
以这种方式配置的两个主要属性由默认文件的以下部分定义:
变量的语法类似于 bash:
${system.property.name-default}
。这意味着您可以使用以下内容设置启动目录:如果未指定,则像往常一样默认为
project/boot/
。同样,您可以通过以下方式设置 Ivy 主目录:如果未指定,则默认为
user.home
系统属性定义的目录中常见的.ivy2
子目录。sbt.boot.properties
exists in0.10
(up to and including0.13.1
that's the latest version of sbt at the moment) and is essentially the same as before.The main addition is that the default sbt.boot.properties is set up to allow a few properties to be defined by system properties. This can avoid the need to use a custom
sbt.boot.properties
in some common cases.The two main properties configurable in this way are defined by the following sections of the default file:
The syntax for variables is bash-like:
${system.property.name-default}
. This means that you can set the boot directory with something like:If unspecified, it would default to
project/boot/
as usual. Similarly, you can set the Ivy home directory with:If unspecified, it defaults to the usual
.ivy2
subdirectory in the directory defined by theuser.home
system property.