我该怎么做才能导入cache,ws,jdbc和specs2%Test

时间:2018-05-07 07:24:56

标签: scala playframework

我正在将我的项目从play 2.4.3升级到2.5.0

我已经在plugin.sbt文件中为play 2.5.0添加了sbt插件,就像这样

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.0")

在我编译代码后添加它会引发一个错误陈述

[info] Loading project definition from /Users/ege/Sites/Aeione/greenroom6-services-v3/greenroom6-services-v3/project
[info] Compiling 1 Scala source to /Users/ege/Sites/Aeione/greenroom6-services-v3/greenroom6-services-v3/project/target/scala-2.10/sbt-0.13/classes...
[error] /Users/ege/Sites/Aeione/greenroom6-services-v3/greenroom6-services-v3/project/Common.scala:4: object PlayScala is not a member of package play
[error] import play.PlayScala
[error]        ^
[error] /Users/ege/Sites/Aeione/greenroom6-services-v3/greenroom6-services-v3/project/Common.scala:49: not found: value jdbc
[error]     jdbc,
[error]     ^
[error] /Users/ege/Sites/Aeione/greenroom6-services-v3/greenroom6-services-v3/project/Common.scala:50: not found: value cache
[error]     cache,
[error]     ^
[error] /Users/ege/Sites/Aeione/greenroom6-services-v3/greenroom6-services-v3/project/Common.scala:51: not found: value ws
[error]     ws,
[error]     ^
[error] /Users/ege/Sites/Aeione/greenroom6-services-v3/greenroom6-services-v3/project/Common.scala:52: not found: value specs2
[error]     specs2 % Test,
[error]     ^
[error] 5 errors found
[error] (compile:compileIncremental) Compilation failed

任何人都可以帮我导出这些依赖项吗?

1 个答案:

答案 0 :(得分:1)

我认为你的导入错了。根据{{​​3}},它应该是:

import sbt._
import Keys._
import play.sbt._
import Play.autoImport._
import PlayKeys._