Show Topics
Hide Topics

How to change Spring Boot Banner Text?

 

The banner that is printed on startup can be changed by adding a banner.txt file to src\main\resources folder or your classpath, or by setting banner.location to the location of such a file.

 

You can also add a banner.gif, banner.jpg or banner.png image file to your classpath, or set a banner.image.location property. Images will be converted into an ASCII art representation and printed above any text banner.

 

 

1.Go to any ANCII Text generator website & generate your logo. for ex: http://patorjk.com/.

 

2.Create banner.txt under Proj_Home\src\main\resources, paste the logo text

 

3.Refresh the project & run Spring Boot Application.the banner will change as below

 

 

application.properties

Spring Boot provides a very neat way to load properties for an application. we can define properties in application.properties (PROJ_HOME\src\main\resources\application.properties) file the following way

 

 

In traditional Spring application would have loaded up the properties in the following way

 

 

In Spring boot it takes application.properties file to define a bean that can hold all the related properties in following way

 

 

@ConfigurationProperties is used to bind and validate some external Properties. If we want to validate before going to use, we have to place @Validated & place type of validation on the filed