Spring Boot Custom Banner Example

In this post, I’ll show you how easy it is to create a custom banner for your Spring Boot application.

Step 1: Generate the banner

The easiest way to generate a custom banner is online. There are plenty of sites out there that offer this functionality. Just google “spring boot custom banner generator” and you’ll see what I mean. I will use this generator : https://devops.datenkollektiv.de/banner.txt/index.html because it is pretty intuitive and has many cool fonts.
Spring Boot Custom Banner Generator

Step 2: Copy the banner text in your app

Copy the generated banner and go to your Spring Boot application. Create a new file called “banner.txt” in the “src\main\resources” folder. The name of the file is important. Make sure the file is named “banner.txt”.

If you want to color your banner, you can do that pretty easy by adding a placeholder like ${AnsiColor.BRIGHT_YELLOW} or ${AnsiColor.BLUE} on the first line. You can also color each line by adding these placeholders.

${AnsiColor.BRIGHT_YELLOW}
     ___      ____    __    ____  _______      _______.  ______   .___  ___.  _______         ___      .______   .______
    /   \     \   \  /  \  /   / |   ____|    /       | /  __  \  |   \/   | |   ____|       /   \     |   _  \  |   _  \
   /  ^  \     \   \/    \/   /  |  |__      |   (----`|  |  |  | |  \  /  | |  |__         /  ^  \    |  |_)  | |  |_)  |
  /  /_\  \     \            /   |   __|      \   \    |  |  |  | |  |\/|  | |   __|       /  /_\  \   |   ___/  |   ___/
 /  _____  \     \    /\    /    |  |____ .----)   |   |  `--'  | |  |  |  | |  |____     /  _____  \  |  |      |  |
/__/     \__\     \__/  \__/     |_______||_______/     \______/  |__|  |__| |_______|   /__/     \__\ | _|      | _|

Step 3: Run the app

Go ahead and run the application. The custom banner will now be shown.

Step 4: Enable/Disable Spring Boot banner

You should also know that you can configure your application to show/hide any banner. In IntelliJ, open the module settings and edit the “Hide Banner” checkbox.enable_disable_spring_boot_banner