2016-02-03 82 views

回答

1

Ebean轉移到Play 2.4中的外部依賴項。您可以在migration guide讀到它:

Ebean has been pulled out into an external project, to allow it to have a lifecycle independent of Play’s own lifecycle. The Ebean bytecode enhancement functionality has also been extracted out of the Play sbt plugin into its own plugin.

To migrate an existing Play project that uses Ebean to use the new external Ebean plugin, remove javaEbean from your libraryDependencies in build.sbt , and add the following to project/plugins.sbt :

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

After that, enable Ebean plugin for your project:

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

And finally, configure Ebean mapped classes as a list instead of a comma separated string (which is still supported but was deprecated):

ebean.default = ["models.*"]

ebean.orders = ["models.Order", "models.OrderItem"]

Additionally, Ebean has been upgraded to 4.5.x, which pulls in a few of the features that Play previously added itself, including the Model class. Consequently, the Play Model class has been deprecated, in favour of using com.avaje.ebean.Model .

+0

感謝我得到了出來放.i在build.sbt中添加了上述所有內容...... @ Steve chaloner – Heena