Custom Banner in Springboot application
Your spring boot console banner still looks like this! Man you need to change it immediately to your project name. Don’t know how to change?
Changing Console Banner
- After generating your spring boot file from Spring Initializr you have to unzip the zip file
- Then open the folder and go the the
/src/main/resourcesfolder and create a folderMETA-INF. - Then create a file
banner.txtinto the folder . [NOTE:META-INFis not necessary but its a good practice]
After creating folders and files go to Patorjk Banner generator site and type your banner text there and you can select any banner style according to your taste of design!
1
2
3
4
5
6
7
8
9
_
___ _ __ ___ __ _ _ __ ___| |__ _ _
/ _ \| '_ ` _ \ / _` | '__/ __| '_ \| | | |
| (_) | | | | | | (_| | | | (__| | | | |_| |
\___/|_| |_| |_|\__,_|_| \___|_| |_|\__, |
|___/
${application.title} ${application.version}
Powered by Spring Boot ${spring-boot.version}
- It will look something like this.(BTW omarchy is a great linux distro by DHH!)
I have used some place holders at the end so that it gives us info about the app title , version and spring boot version as well!
- As we are using the path
src/main/resources/META-INF/banner.txtso we have to add an extra functionality to the IDE (If you are directly usingsrc/main/resources/banner.txtthen you are already good to go!)
To make this work, you need to use the spring.banner.location property. If you want to use your IDE, you need to figure out how to override Spring Boot configuration properties. If you are using IntelliJ IDEA, choose Edit Configurations ➤ Modify Options, locate the Override Configuration Properties section, and add spring.banner.location and classpath:/META-INF/banner.txt

