The New Year is the Year of the Ox. In SpringBoot, we have a custom banner related to the year of the Ox, which looks really good.

Above is a banner made by myself, the relevant ASCII characters at the end of the text.

Customizing the banner for the SpringBoot project is very simple. You can change the banner printed during startup by adding a banner. TXT file in the classpath or setting the banner.

If you want to programmatically create a banner, can use SpringBootApplication. SetBanner (…). Methods. Using org. Springframework. Boot. Banner interface, implement your own printBanner () method.

Ok, let’s take a step-by-step look at how to make your own banner for the Year of the Ox.

  • Create it in the resource directorybanner.txt

  • Use picture to ASCII

The blogger found a picture on the Internet

There are a lot of websites that use pictures to ASCII, bloggers have tried a lot, feel better use of the following several:

✔ www.twitchquotes.com/ascii-art-g…

✔ codebeautify.org/image-to-as…

✔ www.fontke.com/tool/image2…

Blogger use is: www.twitchquotes.com/ascii-art-g…

Upload the image, you can see the generated ASCII, paste the generated ASCII into the banner. TXT, found the banner has changed:

  • Modify the color, white is obviously not in line with our New Year atmosphere, so the color is changed to red.

    Spring Boot provides three enumerated classes to set the banner style:

⭐ AnsiColor: Used to set the foreground of a character;

⭐ AnsiBackground: Used to set the character background color.

⭐ AnsiStyle: Used to control bold, italic, underlining, etc.

We set the character to red with {ansicolor.bright_red}

There is nothing to say about the text part, add it yourself. Is behind the text did not align, the blogger made along while also did not fix, big New Year’s day, do not want to make 😂

  • To add the SpringBoot version information, pass${spring-boot.version}You can obtain the SpringBoot version
${ansicolor. BRIGHT_YELLOW}Spring Boot version: ${spring-boot.version}Copy the code

This is the blogger’s custom banner, the text on the right has been inconsistent, if there is a solution, please comment in the comment section, thank you!

${AnsiColor. BRIGHT_RED} a promotion and pay increase money ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠠ ⡀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ more ⠀ ⡀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠠ ⣄ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ body ⠸ ⡀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⢙ ⢂ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ less strong ⢸ ⣱ ⢄ ⣀ ⣀ ⣀ ⣀ ⣀ ⢀ ⣀ ⣠ ⢀ ⡀ ⣤ ⠤ ⣚ ⣼ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ body dry ⠀ ⠒ ⠿ ⣊ ⣇ ⣧ ⣾ ⣟ ⣝ ⣝ ⣿ ⣿ ⣜ ⡵ ⠵ ⢼ ⣊ ⠁ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ health of ⠀ ⠀ ⠀ ⠐ ⠺ ⠿ ⣿ ⠻ ⢟ ⣿ ⢍ ⢍ ⢻ ⣿ ⣿ ⣧ ⡞ ⠁ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ into great ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⣿ ⢠ ⣿ ⣿ ⣿ ⣴ ⣿ ⣿ ⣟ ⢷ ⣦ ⣀ ⡀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ step ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⢸ ⢿ ⡿ ⢿ ⣿ ⣿ ⣿ ⢫ ⣿ ⠏ ⢤ ⣿ ⠩ ⣝ ⣷ ⣤ ⣀ ⡀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⣠ ⣄ ⣀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ fast ⠀ ⠀ ⠀ ⠀ ⠀ ⣏ ⡃ ⣘ ⣃ ⣿ ⠿ ⢛ ⣡ ⣿ ⠿ ⢶ ⣿ ⣿ ⣷ ⣬ ⣍ ⣼ ⡟ ⢻ ⣟ ⢟ ⠿ ⣿ ⠿ ⢛ ⣿ ⠿ ⣿ ⠿ ⢳ ⣶ ⣿ ⡿ ⠛ ⠛ ⠿ ⣷ ⣄ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠈ ⠉ ⠛ ⠛ ⠻ ⡿ ⡻ ⡉ ⠡ ⡀ ⣿ ⣿ ⣿ ⣿ ⣿ ⣿ ⣿ ⣷ ⣾ ⣬ ⣥ ⣴ ⣿ ⣗ ⣿ ⠡ ⣷ ⡗ ⣼ ⡷ ⠛ ⡻ ⣷ ⡀ ⠀ ⠀ ⠈ ⠻ ⣦ ⣀ ⠀ ⡔ ⠒ ⠲ ⡇ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⢿ ⡷ ⣷ ⡷ ⡿ ⣿ ⣿ ⣿ ⣿ ⣿ ⣿ ⣿ ⡍ ⠛ ⢛ ⢍ ⣽ ⠏ ⣼ ⠻ ⣜ ⣻ ⢟ ⣵ ⣷ ⠿ ⣿ ⢜ ⣧ ⠀ ⠀ ⠀ ⠀ ⠀ ⠉ ⠉ ⠑ ⠒ ⠊ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⢸ ⣮ ⣠ ⣠ ⣴ ⠿ ⣿ ⣿ ⣿ ⣿ ⣿ ⣿ ⣿ ⣾ ⣼ ⣾ ⡿ ⢧ ⣽ ⣎ ⠿ ⠻ ⣻ ⡵ ⢻ ⣿ ⠏ ⣿ ⣿ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⢀ ⣀ ⣸ ⡟ ⢹ ⣗ ⣽ ⠿ ⣿ ⣿ ⣿ ⣿ ⣿ ⣿ ⡿ ⣆ ⣌ ⠐ ⣰ ⣿ ⣄ ⣛ ⣿ ⣻ ⠛ ⢍ ⣼ ⣋ ⣵ ⠣ ⡟ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⡤ ⡲ ⣴ ⢄ ⣯ ⣬ ⣿ ⣷ ⣄ ⣹ ⠅ ⣱ ⣿ ⣿ ⣿ ⣿ ⣿ ⣿ ⠌ ⢽ ⣿ ⡟ ⠛ ⡋ ⣹ ⡝ ⣷ ⣉ ⣻ ⣏ ⣉ ⣲ ⣿ ⣿ ⡇ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⢨ ⡪ ⡭ ⢸ ⣿ ⠃ ⠀ ⠉ ⠙ ⠛ ⠳ ⢼ ⣿ ⣿ ⣿ ⣿ ⢻ ⢊ ⣢ ⣽ ⣋ ⣿ ⣾ ⠾ ⣟ ⣯ ⣷ ⣿ ⡻ ⢿ ⣿ ⣿ ⣿ ⣿ ⣿ ⣦ ⡀ ⢠ ⣀ ⣤ ⠀ ⠀ ⠀ ⡀ ⠀ ⠀ ⠀ ⠛ ⣠ ⣃ ⣬ ⣿ ⣁ ⠀ ⣿ ⣗ ⣤ ⠀ ⡀ ⠀ ⠀ ⣜ ⢿ ⣿ ⠏ ⠉ ⠋ ⠉ ⠉ ⠉ ⠉ ⠀ ⠀ ⠀ ⠙ ⠿ ⣿ ⣿ ⣧ ⠀ ⠈ ⠙ ⠛ ⠿ ⣿ ⣯ ⣼ ⠀ ⡃ ⣣ ⣧ ⣤ ⣾ ⣇ ⠀ ⠀ ⢀ ⣀ ⣴ ⡿ ⣺ ⡏ ⢻ ⣆ ⡈ ⠓ ⠻ ⠃ ⡐ ⠀ ⠀ ⣷ ⣿ ⠋ ⠀ ⠀ ⠀ ⠀ ⠀ ⣼ ⣵ ⠇ ⡀ ⠀ ⠀ ⠀ ⣸ ⣿ ⡭ ⠃ ⠀ ⠀ ⠀ ⠀ ⠈ ⠻ ⣿ ⡄ ⠀ ⠿ ⣯ ⣖ ⡽ ⠃ ⠀ ⠀ ⢨ ⣵ ⣭ ⣽ ⡗ ⡟ ⢿ ⣶ ⣿ ⡄ ⠀ ⠀ ⠀ ⠀ ⢠ ⣿ ⡇ ⠀ ⠀ ⠀ ⠙ ⡒ ⣥ ⣄ ⡘ ⠍ ⠀ ⢀ ⣠ ⣼ ⡿ ⠋ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⢹ ⣷ ⡀ ⠠ ⢵ ⠸ ⣤ ⣀ ⠀ ⠀ ⠀ ⠉ ⢈ ⣋ ⣦ ⣴ ⡄ ⢉ ⣰ ⣲ ⡂ ⠀ ⠀ ⢰ ⣭ ⡽ ⠂ ⠀ ⠀ ⠀ ⠈ ⠀ ⠐ ⠻ ⢽ ⠿ ⡳ ⠶ ⡾ ⠛ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⢀ ⣯ ⣵ ⠣ ⣟ ⣆ ⡃ ⠧ ⣾ ⡅ ⠀ ⠀ ⠀ ⠙ ⠻ ⠿ ⠛ ⠉ ⠑ ⠋ ⠉ ⠀ ⠀ ⠪ ⣀ ⣉ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠚ ⠀ ⠃ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠠ ⣱ ⣀ ⡁ ⠀ ⠀ ⠃ ${ansicolor. BRIGHT_YELLOW}Spring Boot version: ${spring-boot.version}Copy the code




Reference:

[1] : Spring Boot custom Banner

[2] : 22.1. Custom Banner