Skip to content

[7.x] Ignore Ebean settings below ebean.* that are no lists of models - #908

Merged
mkurz merged 2 commits into
playframework:7.xfrom
mkurz:ignore-ebean-settings-7.x
Oct 8, 2026
Merged

mkurz merged 2 commits into
playframework:7.xfrom
mkurz:ignore-ebean-settings-7.x

Conversation

@mkurz

@mkurz mkurz commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Backport of #904 to 7.x.

Besides conf/application.conf, Play also loads conf/application.properties. That's where Ebean expects its own settings (Ebean reads application.yaml/application.properties, but not application.conf, and ebean.properties is deprecated), e.g.:

ebean.migration.run=false

However, 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 into application.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 read application.conf, an ignored setting from a .conf file gets logged as a warning, pointing to application.yaml/application.properties. The docs now explain where Ebean's own settings go.

In application.properties all values are strings, though. So a setting directly below ebean., like ebean.dumpMetricsOnShutdown=true, still looks like a (comma-separated) list of models, of an Ebean server without a database, which gets skipped. The docs therefore recommend conf/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 in application.conf). Per-server Ebean settings like ebean.default.databasePlatformName in application.properties don't interfere with that, as application.conf takes precedence over application.properties in Play's configuration, and Ebean reads application.properties itself.

Testing

  • New EbeanParsedConfigTest.ignoresEbeanSettingsFromProperties (configuration in properties syntax, as from application.properties) and EbeanParsedConfigTest.ignoresEbeanSettings.
  • Verified with an app using Play's regular configuration loading: ebean.migration.run=false in application.properties, or ebean.docstore.* in application.conf, made it fail to start before; now it starts (the latter logs the warning).

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.
@mergify

mergify Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
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.
@mkurz
mkurz merged commit 62decb8 into playframework:7.x Oct 8, 2026
21 checks passed
@mkurz
mkurz deleted the ignore-ebean-settings-7.x branch October 8, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant