Modify the banner of spring boot

Modify Banner

When we start the Spring Boot project, the console will output a startup pattern by default, as follows: 
write picture description here 
Of course, this pattern can be modified by yourself if you need it. The modification method is very simple:

1. Create a new banner.txt document under src/main/resources 
2. Generate the required characters through the http://patorjk.com/software/taag website, and copy the characters to the txt document created in step 1. For example, I Here is Hello Sang! Generate characters as follows:

write picture description here
Click the select and copy button in the lower left corner to copy this character to the txt document, and then start the project, the text output by the console will automatically change, as follows: 
write picture description here

Close Banner

It can be modified, of course, it can also be closed. Closing the Banner requires us to modify the code in the main method slightly, as follows:

public static void main(String[] args) {
        SpringApplicationBuilder builder = new SpringApplicationBuilder(Test19SpringBoot2Application.class); //修改Banner的模式为OFF builder.bannerMode(Banner.Mode.OFF).run(args); }
  • 1
  • 2
  • 3
  • 4
  • 5

OK, after this modification, we can't see the Banner when we start the Project again.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325024894&siteId=291194637