How can I change version of Scala that is used by Play, SBT and its plugins?

后端 未结 2 1715
小蘑菇
小蘑菇 2021-02-05 16:08

Is it necessary to change version of Scala that is used by SBT and its plugins ?

I\'m using Play Framework 2.1.1-RC2. I want to create new project that will use Scala 2.

2条回答
  •  Happy的楠姐
    2021-02-05 16:33

    SBT is a Scala application, and, like all Scala applications, it needs to be abide by Scala's binary compatibility rules. Specifically, versions 2.8, 2.9 and 2.10 are not compatible with each other.

    That means that, because the SBT version used by Play was compiled with Scala 2.9.2, then all plugins and all project definitions must be compiled with another 2.9.x version. This is because your Build.scala is not something that is simply executed by SBT, it becomes part of SBT execution.

    However, that has relation whatsoever with what version of Scala your application should be compiled with. SBT can use any Scala version, and can even produce multiple Scala versions at the same time -- which is how Scala libraries manage to provide binaries for the multiple Scala versions.

提交回复
热议问题