如何配置 SBT 以选择所需的 Scala 版本 (2.9) [英] how to configure SBT to pick the desired scala version (2.9)
问题描述
在使用 sbt 命令创建项目时,它总是提示您使用 2.7.X 版本的 scala,但是我安装了 2.9.0 和 sbt 0.7.7,有没有办法将 sbt 配置为默认选择 2.9.
While creating a project with sbt command it always prompts for the 2.7.X version of scala however I have 2.9.0 and sbt 0.7.7 installed is there a way to configure sbt to pick 2.9 by default.
推荐答案
如果你使用 sbt version 0.10 相反,它发生了一些变化,在 build.sbt
文件中指定 scalaVersion := "2.9.0-1"
(默认似乎是 2.8.1)
If you use sbt version 0.10 instead it has changed a bit, in the build.sbt
file you specify scalaVersion := "2.9.0-1"
(default seem to be 2.8.1)
请参阅从 SBT 0.7 迁移.x 到 0.10.x 或 快速配置示例.完整配置示例 展示了 Scala 风格的配置.
See Migrating from SBT 0.7.x to 0.10.x or Quick Configuration Examples. The Full configuration example shows Scala style configuration.
Thrre 是一个 ~/.sbt/plugins/
库,您可以在其中存储全局插件.但是我还不知道你是否可以定义一个全局构建属性.
Threre is a ~/.sbt/plugins/
library where you store global plugins. But I do not yet know if you can define a global build properties.
这篇关于如何配置 SBT 以选择所需的 Scala 版本 (2.9)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!