在播放框架中添加 scalaVersion 的位置

where to add the scalaVersion in play framework

我遇到了以下错误消息,建议在我的 build.sbt 中添加 scalaVersion.I added ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }但这并没有解决问题

[warn] Scala version was updated by one of library dependencies:
[warn]  * org.scala-lang:scala-library:(2.10.0, 2.10.3, 2.10.1, 2.10.2) -> 2.10.4
[warn] To force scalaVersion, add the following:
[warn]  ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] Run 'evicted' to see detailed eviction warnings

当你运行这个命令时:

activator new test play-scala

...这是创建的 build.sbt 文件:

name := """test"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.6"

libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  specs2 % Test
)

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator

play-scala 模板在文件中添加了一些不受欢迎的信息,但您可以清楚地看到 scalaVersion 是如何指定的。