Spring Boot 更換 Banner

Spring 啓動時,會有一個Banner圖案,這個圖案是能夠更換的php

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (1.5.8.RELEASE)

只須要在 src/main/resources 路徑下新建一個banner.txt文件,banner.txt中填寫好須要打印的字符串內容便可。spring

 

banner.txt 中能夠使用一些變量 ( 除了內置的變量外,還包括 application.properties 中配置的全部變量),例如:
    ${AnsiColor.BRIGHT_RED}:設置控制檯中輸出內容的顏色
    ${application.version}:用來獲取MANIFEST.MF文件中的版本號
    ${application.formatted-version}:格式化後的${application.version}版本信息
    ${spring-boot.version}:Spring Boot的版本號
    ${spring-boot.formatted-version}:格式化後的${spring-boot.version}版本信息
app

 

另外,咱們能夠藉助如下網站工具,生成字符畫
    http://patorjk.com/software/taag
    http://www.network-science.de/ascii/
    http://www.degraeve.com/img2txt.php

spring-boot

 

banner 的關閉方法工具

若是咱們不但願項目啓動時候輸出 banner ,能夠修改.properties 文件中配置,以下:網站

spring.main.banner-mode=offspa

相關文章
相關標籤/搜索