【问题标题】:where to add the scalaVersion in play framework在播放框架中添加 scalaVersion 的位置
【发布时间】:2015-03-18 10:07:30
【问题描述】:

我遇到以下建议添加 scalaVersion 的错误消息。我在 build.sbt 中添加了 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

【问题讨论】:

  • 尝试将scalaVersion := "2.10.4" 添加到您的build.sbt。此外,您发布的只是警告,而不是错误

标签: playframework playframework-2.2


【解决方案1】:

当你运行这个命令时:

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 是如何指定的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-14
    • 1970-01-01
    相关资源
    最近更新 更多