简体   繁体   中英

Is there a way to define the required sbt version in build.sbt?

在Scala项目的build.sbt定义中,是否可以定义构建项目所需的最低版本的sbt?

project/build.properties allows you to force sbt to use particular version. If current version of installed sbt is different - sbt itself will download (if needed) the version you've specified there:

sbt.version=0.12.0

See, Hello for instance. So actually you may have installed several versions of sbt in your system - it's just jars, that placed in .sbt/boot/scala-{scala.version required by this sbt}/org.scala-sbt/sbt/{sbt.version} folder. Sbt executable actually looks for version specified in project/build.properties or (if it's not specified) highest version installed in the system.

PS From sbt-launcher perspective, sbt is only one dependency with small non-intersecting others like ansi.jar , so specifying the range of versions like [0.13.1, 0.13.8] have no much sense as it would be efective only for conflicting transitive deps. Otherwise it's enough to specify higher possible version (which would compile) - you may even choose some version that you already have (and update project's sbt that way).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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