我刚刚开始使用 Java Play 框架并取得了一些进展,但现在我打算添加 JavaEbean OEM,我浏览了文档,但仍然收到错误NoClassDefFoundError: play/Configuration应用程序.conf # This is the main configuration file for the application. # https://www.playframework.com/documentation/latest/ConfigFile ebean.default = ["models.*"]插件.sbtaddSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0")addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.1.0")我的模型:import io.ebean.Model;public class Book extends Model {..}构建.sbtname := """BookStoreApp"""organization := "com.example"version := "1.0-SNAPSHOT"lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)scalaVersion := "2.12.8"libraryDependencies += guice
1 回答
阿晨1998
TA贡献2037条经验 获得超6个赞
您需要更改play
orebean
版本。
play
已更改 2.7 中的默认类Configuration
:https ://www.playframework.com/documentation/2.7.x/JavaConfigMigration26 。
ebean
插件版本及其对应于play
: https : //github.com/playframework/play-ebean#releases
所以接下来
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0") addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.1.0")
必须改为
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.21") addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.1.0")
或者
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0") addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "5.0.0")
添加回答
举报
0/150
提交
取消