Spring-boot: spring.main.banner-mode=off doesn't work with yml configuration

Created on 24 Nov 2015  路  8Comments  路  Source: spring-projects/spring-boot

This could be an ordering issue and perhaps it's something we can't fix. We should at the very least update the docs.

documentation

Most helpful comment

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.

All 8 comments

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.

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.

Was this page helpful?
0 / 5 - 0 ratings