This could be an ordering issue and perhaps it's something we can't fix. We should at the very least update the docs.
See #4001 for original feature details.
@philwebb I'm unable to reproduce - see https://github.com/jadekler/git-misc-2/tree/master/boot-banner-properties-off for a super simple spring-boot app that gets its banner turned off with a properties file.
(above app is basic start.spring.io app + props file added)
funny. I can't reproduce with a .properties
file but I can with a .yml
file.
ok off
is mapped to false
by yml.
looks like we'll have to do something similar as https://github.com/spring-projects/spring-boot/commit/c3571d416ad4e4bec688f7272e3840b1d758edef
Unfortunately this is backed by an enum and part of the SpringApplication
API so there is not much we can do (this is a YAML "issue", really). I've added a dedicated section in the doc instead.
First of all sorry for not finding this sooner, I only found this after opening #5746 (only searched for bannerMode
, my bad).
Indeed, this is a YAML 'issue', the way booleans are handled clashes directly with the Banner.Mode.OFF
enum constant.
That is quite unfortunate though.
actually, this does work, in application.yml:
spring:
main:
banner-mode: 'off'
By quoting the value, you disable yaml's automatic-cast-to-boolean feature.
@jamesbates this very issue was about documenting that, see https://github.com/spring-projects/spring-boot/commit/43b8e65eee7c23a7f7c3b61f8a436dc9cbfe5b96
Most helpful comment
actually, this does work, in application.yml:
By quoting the value, you disable yaml's automatic-cast-to-boolean feature.