Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ebean missing from Play 2 Module for Java

I created a new project in IntelliJ 13 using the Play 2 Module for Java project template and noticed that the # Ebean configuration is missing from conf/application.conf.

Being new to both Play Framework and IntelliJ I tried following the Play introductory video and got stuck where I need to extend the Ebean Model class. The problem is that the class doesn't appear in the Import class dialogue.

I've tried adding the source directory to these files to File → Project Structure → Libraries but that didn't work.

If import play.db.ebean.Model; is added IntelliJ complains with cannot resolve symbol 'db'.

What do I need to do to have my project include the Play Ebean classes?

like image 529
ivavid Avatar asked Dec 16 '22 01:12

ivavid


1 Answers

The method to enable ebean support has changed in play framework. Now it is done using an external dependency. From the documentation:

To enable it, add the Play Ebean plugin to your SBT plugins in project/plugins.sbt:

addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")

And then modify your build.sbt to enable the Play Ebean plugin:

lazy val myProject = (project in file("."))
  .enablePlugins(PlayJava, PlayEbean)
like image 67
Denis Avatar answered Dec 26 '22 00:12

Denis