Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

play.db package not found in play 2.1.3

Im trying to follow the play framework ebean tutorial here:

http://www.playframework.com/documentation/2.1.2/JavaEbean

However when I try to include play.db.ebean.* and try to compile, the package is not found (no play.db package). I have added ebean.default="models.*" to my application.conf

Is there anything else I need to do to get the dependency? Is there an equivalent to play deps from play 1.2 for example?

The trace:

[error] /home/nfv/workspace-scala/scims/app/models/Person.scala:3: object db is not a member of package play
[error] import play.db.ebean.Model;
[error]             ^
[error] /home/nfv/workspace-scala/scims/app/models/Person.scala:5: not found: type Model
[error] class Person extends Model {
[error]                      ^
[error] two errors found
[error] (compile:compile) Compilation failed
[error] Total time: 4 s, completed 09-Sep-2013 11:23:00

Cheers NFV

like image 709
nfvindaloo Avatar asked Sep 09 '13 10:09

nfvindaloo


1 Answers

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")
like image 124
Tadas V. Avatar answered Sep 19 '22 08:09

Tadas V.