Spring Boot自定义启动Banner

Laughing
2019-07-28 / 0 评论 / 1,218 阅读 / 搜一下 / 正在检测是否收录...

看烦了自带的Banner,动手修改一个属于自己的Banner,提现逼格的时候到了~哈哈,以下是官网给的配置指南:

文字形式

其实,替换很简单,只需要在classpath路径下创建一个banner.txt即可。具体的一些变量官网也有给出,具体如下:

${AnsiColor.BRIGHT_YELLOW}  
////////////////////////////////////////////////////////////////////  
//                          _ooOoo_                               //  
//                         o8888888o                              //  
//                         88" . "88                              //  
//                         (| ^_^ |)                              //  
//                         O\  =  /O                              //  
//                      ____/`---'\____                           //  
//                    .'  \\|     |//  `.                         //  
//                   /  \\|||  :  |||//  \                        //  
//                  /  _||||| -:- |||||-  \                       //  
//                  |   | \\\  -  /// |   |                       //  
//                  | \_|  ''\---/''  |   |                       //  
//                  \  .-\__  `-`  ___/-. /                       //  
//                ___`. .'  /--.--\  `. . ___                     //  
//              ."" '<  `.___\_<|>_/___.'  >'"".                  //  
//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //  
//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //  
//      ========`-.____`-.___\_____/___.-`____.-'========         //  
//                           `=---='                              //  
//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //  
//            佛祖保佑       永不宕机     永无BUG                  //  
////////////////////////////////////////////////////////////////////  

关闭banner

如果需要关闭banner,可以通过设置SpringApplicationBuilder来设置bannerModeOFF

 SpringApplicationBuilder builder = new SpringApplicationBuilder(DemoApplication.class);
        builder.bannerMode(Banner.Mode.OFF);
        builder.run(args);
1

评论 (0)

取消
  1. 头像
    青云
    Windows 10 · Google Chrome

    支持一下

    回复
  2. 头像
    Seputar Berita Unik
    Windows 7 · Google Chrome

    win iCloud移动到非C盘_木子网

    回复