我正在使用play 2.2.2
。
我想在Accessing an SQL database中提及的Play / Scala项目中启用jdbc
库。
这是我的rootproject/project/plugins.sbt
:
libraryDependencies ++= Seq(
jdbc
"com.google.zxing" % "core" % "2.0",
"mysql" % "mysql-connector-java" % "5.1.27",
"com.typesafe.slick" %% "slick" % "2.1.0",
"org.slf4j" % "slf4j-nop" % "1.6.4"
)
在编译项目时,我得到了jdbc
未找到错误
$ /usr/local/play-2.2.2/play compile
/packup/smartad-core/project/plugins.sbt:8: error: not found: value jdbc
jdbc
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q
我的rootproject/build.sbt
只是
import play.Project._
name := "smartad-backend"
version := "1.0"
playScalaSettings
https://www.playframework.com/documentation/2.3.x/ScalaAnorm
答案 0 :(得分:5)
您应该将这两个块合并到build.sbt
文件中。 plugins.sbt
用于添加sbt插件,例如play sbt插件。但那是关于它的。
import play.Project._
name := "smartad-backend"
version := "1.0"
playScalaSettings
libraryDependencies ++= Seq(
jdbc,
...
)