Control Banner Content
Spring boot when the default banner is the word spring, look more and feel very monotonous, Spring boot for us to provide a custom banner function.
Custom banner only need to create a new Banner.txt file under Resource, put the banner words we need into, and read the banner in this text file when it is started.
Like what:
_ooooo_ o8888888o 88 ". " (| -_- |) O\ =/ o ____/'---' \____ . ' \\| | // `. / \\||| : ||| // / _||||| -:- ||||| - | | \\\ -///| | | \_| " \---/' | | \ .-\__ '-' ___/-./ ___ ' ... ' /--.--\ `. . __ ."" ' < ' . ___\_<|>_/___. ' > ' "". | | : `- \`.; `\ _ /`;. `/ - ` : | | \ \ `-. \_ __\/__ _/ .-'/ /====== '-.____ '-.___\_____/___.-' ____.-' ====== ' =---= ' ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^, ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^ Buddha bless never bug
Control Banner Style
Spring provides three enumeration classes to set the color of the characters, respectively:
Ansicolor: Used to set the foreground color of a character
Ansibackground: Used to set the background color of a character
Ansistyle: Used to control bold, italic, underline and so on.
Use ${ansifoo.bar} to specify the style, which is prompted when the style is specified:
Specify a test, such as the following:
${ansicolor.bright_yellow} _ooooo_ o8888888o 88 ". " (| -_- |) O\ =/ o ____/'---' \____ . ' \\| | // `. / \\||| : ||| // / _||||| -:- ||||| - | | \\\ -///| | | \_| " \---/' | | \ .-\__ '-' ___/-./ ___ ' ... ' /--.--\ `. . __ ."" ' < ' . ___\_<|>_/___. ' > ' "". | | : `- \`.; `\ _ /`;. `/ - ` : | | \ \ `-. \_ __\/__ _/ .-'/ /====== '-.____ '-.___\_____/___.-' ____.-' ====== ' =---= ' ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^, ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^ Buddha bless never bug
Effect:
Well, the reason behind the scenery is so ugly .... But that's not the point.
The
Focus is that the setting of this color can be changed, that is, the same screen can specify more than one ${ansicolor.foocolor} this, after specifying the color until the next specified character is Foocolor color, a simple example, To set the Big Buddha's pimple to a different color (for Shmau I feel the following character is very funny, windy ... ):
${ansicolor.bright_yellow} ${ansicolor.bright_red}_ooooo_${ansicolor.bright_yellow} ${A Nsicolor.bright_red}o8888888o${ansicolor.bright_yellow} ${ansicolor.bright_red}88${ansicolor.bright_yello W} ". "${ansicolor.bright_red}88${ansicolor.bright_yellow} (| -_- |) o\ =/o ____/'---' \____. ' \\| |// `. / \\||| : ||| // / _||||| -:- ||||| - | | \\\ - /// | | | \_| ' \---/' | | \ .-\__ `-` ___/-. / ___`. .‘ /--.--\ `. . __ ."" ' < '. ___\_<|>_/___. ' > ' "". | | : `- \`.; `\ _ /`;. `/ - ` : | | \ \ `-. \_ __\/__ _/.-'//====== '-.____ '-.___\_____/___.-' ____.-' ====== ' =---= ' ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ Buddha blessed with no bugs
Effect:
Show app Information
In addition to the above specified styles, you can also display some version information related to your app:
${application.version} The same version number as the MANIFEST.MF file, such as 1.5.4.RELEASE
${application.formatted-version} formatted version number is the addition of a V and then wrapped up in parentheses, for example (V1.5.4.release)
${application.title}
${spring-boot.version} Spring Boot version
${spring-boot.formatted-version} formatted version
Controls whether the banner is turned on and outputs the position
Set banner mode to OFF banner:
Package Org.cc11001100;import Org.springframework.boot.banner;import org.springframework.boot.SpringApplication; Import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplicationpublic class springbootstudy002application {public static void main (string[] args) {springapplication springapplication = new Springapplication (Springbootstudy002application.class); Springapplication.setbannermode (Banner.Mode.OFF); Springapplication.run (args);}}
Several commonly used character painting to build websites
Introduce several commonly used character painting build sites:
1. http://patorjk.com/software/taag/#p =display&f=henry%203d&t=cc11001100%0a This is more commonly used, can be generated according to the character of the input characters drawn
2. https://spring-boot-banner-gen.cfapps.io/can convert the uploaded image into a text-like character painting, just feel the style comparison ghost animal (must not be admitted to my long ghost animal ...) ), this is my humble character painting ....
3. Http://www.degraeve.com/img2txt.php can be based on the online image URL to generate characters, such as the company can directly paste the address of the logo to create character painting, style is normal ...
A portrait of Zhang Huang:
.
Spring Boot note Custom boot banner