Repository navigation
[7.x] Ignore Ebean settings below ebean.* that are no lists of models - #908
Merged
Merged
Conversation
Besides conf/application.conf, Play also loads conf/application.properties, where Ebean (which doesn't read application.conf) expects its own settings, e.g. ebean.migration.run=false. Play Ebean then took such a setting for a list of models, and failed with e.g. "migration has type OBJECT rather than LIST", at runtime as well as when the sbt plugin loads the models to enhance. Now Play Ebean only uses the strings and lists below ebean.* as models and ignores everything else. As Ebean doesn't read application.conf, ignored settings from a .conf file get logged as a warning.
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
In conf/application.properties, all values are strings. So while nested Ebean settings like ebean.migration.run get ignored, a setting directly below ebean.*, like ebean.dumpMetricsOnShutdown=true, still looks like a list of models, of an Ebean server without a database, which gets skipped. Test that with a configuration in properties syntax, and say so in the docs, recommending conf/application.yaml for such settings.
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #904 to
7.x.Besides
conf/application.conf, Play also loadsconf/application.properties. That's where Ebean expects its own settings (Ebean readsapplication.yaml/application.properties, but notapplication.conf, andebean.propertiesis deprecated), e.g.:ebean.migration.run=falseHowever, Play Ebean took every
ebean.<name>entry of Play's configuration for a list of models, so such a setting made it fail with e.g.migration has type OBJECT rather than LIST, at runtime as well as in the sbt plugin when loading the models to enhance (#212). The same happened for Ebean settings put intoapplication.conf(#104).Now Play Ebean only uses strings and lists below
ebean.*as models (lists still get validated as before), and ignores everything else. As Ebean doesn't readapplication.conf, an ignored setting from a.conffile gets logged as a warning, pointing toapplication.yaml/application.properties. The docs now explain where Ebean's own settings go.In
application.propertiesall values are strings, though. So a setting directly belowebean., likeebean.dumpMetricsOnShutdown=true, still looks like a (comma-separated) list of models, of an Ebean server without a database, which gets skipped. The docs therefore recommendconf/application.yaml, which only Ebean reads, for such settings.Configuring Ebean through
application.conf(as requested in #104) remains unsupported, as Ebean only reads its own configuration files; the warning and the docs now make that clear.The models of an Ebean server still need to be configured as a list (
ebean.default = ["models.*"], usually inapplication.conf). Per-server Ebean settings likeebean.default.databasePlatformNameinapplication.propertiesdon't interfere with that, asapplication.conftakes precedence overapplication.propertiesin Play's configuration, and Ebean readsapplication.propertiesitself.Testing
EbeanParsedConfigTest.ignoresEbeanSettingsFromProperties(configuration in properties syntax, as fromapplication.properties) andEbeanParsedConfigTest.ignoresEbeanSettings.ebean.migration.run=falseinapplication.properties, orebean.docstore.*inapplication.conf, made it fail to start before; now it starts (the latter logs the warning).