简体   繁体   English

无法配置Ebean Play Framework 2.5.x

[英]Can't configure Ebean Play Framework 2.5.x

I have a problem configuring Ebean for Play Framework 2.5.x. 我在为Play Framework 2.5.x配置Ebean时遇到问题。 I get the following error when I type sbt run: 输入sbt run时出现以下错误:

Play ebean module has been replaced with an external Play ebean plugin. Play ebean模块已替换为外部Play ebean插件。 See https://playframework.com/documentation/2.4.x/Migration24 for details. 有关详细信息,请参见https://playframework.com/documentation/2.4.x/Migration24

I have added javaJdbc as a Dependency and in my build.sbt I also have: 我已经将javaJdbc添加为依赖项,并且在我的build.sbt中,我也有:

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

In application.conf: 在application.conf中:

ebean.default = ["models.*"]

And plugins.sbt: 和plugins.sbt:

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

Any idea on how to fix this? 关于如何解决此问题的任何想法? https://playframework.com/documentation/2.4.x/Migration24 Doesn't give any other information. https://playframework.com/documentation/2.4.x/Migration24不提供任何其他信息。 Thanks! 谢谢!

EDIT Here's my full build.sbt: 编辑这是我完整的build.sbt:

name := """chatbot"""

version := "1.0-SNAPSHOT"

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


scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  javaJdbc,
  cache,
  javaWs, 
  javaEbean, 
  evolutions
)


fork in run := true

As it is said in the migration guide: 如迁移指南中所述:

To migrate an existing Play project that uses Ebean to use the new external Ebean plugin, remove javaEbean from your libraryDependencies in build.sbt 要迁移使用Ebean来使用新的外部Ebean插件的现有Play项目,请从build.sbt中的libraryDependencies中删除javaEbean。

That's exactly, that you forgot to do, so in the dependencies section you need to have this: 正是您忘记这样做了,因此在“依赖项”部分中,您需要执行以下操作:

libraryDependencies ++= Seq(
  javaJdbc,
  cache,
  javaWs,
  evolutions
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM