我剛剛開始使用 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
提交
取消