In this article, you will learn how to configure a custom Spring Boot starting banner.
2. Customizing the Spring Boot banner
Spring Boot provides a convenient way to change its banner, the one that is printed on the start up of the application. Default Spring Boot banner looks similar to the following:
To change that output you have to place special banner.txt file into the classpath. In Maven projects you have to create a banner file in your /resources folder.
Structure of this file is not formalized, you can put any ASCII character there. Additionally Spring Boot provides several placeholders you can use inside banner.txt file, that will be replaced with specific values:
${application.version} - the version number of your application, as declared in MANIFEST.MF, ex. 2.1.5.RELEASE (note that if you don't have MANIFEST.MF file this value will be empty),
${application.formatted-version} - version of the application formatted for display, ex. (v2.1.5.RELEASE),
${spring-boot.version} - version of the Spring Boot you are using in current project,
${spring-boot.formatted-version} - formated version of Spring Boot,
${application.title} - title of your application, as declared in MANIFEST.MF (note that if you don't have MANIFEST.MF file this value will be empty).
For example filling banner.txt file with the following content:
will produce the following output on Spring Boot start up console:
If you want to create similar fancy banner text, using ASCI codes only, go here.
3. Turning off banner
Spring Boot gives you the ability to turn off the banner completely, so it wouldn't be displayed anywhere on start up.
1) you can use spring.main.banner-mode property in configuration file to determine if the banner has to be printed:
YAML file:
Properties file:
, or
2) set bannerMode parameter which is available on SpringApplication object:
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}