play.db package not found in play 2.1.3

爷,独闯天下 提交于 2019-12-05 11:23:37

This is probably because of a missing dependency in your Build.scala file.

To use Ebean, it should include a dependency on javaEbean. Ex :

val appDependencies = Seq(
  jdbc,
  javaEbean,
  ...)

After adding the dependency, run reload and update from the play console.

I would recommend to follow https://playframework.com/documentation/2.4.x/Migration24 as you are not meant to specify "javaEbean" in the build.sbt file any more.

Now in the build.sbt you have to put:

lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean) 

Next uncomment the following lines in the "conf/application.conf".

db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
ebean.default="models.*"

And lastly put the following line in "project/plugins.sbt"

addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!