springboot启动自定义banner

TOC

springboot启动自定义banner

  • 在项目目录下resource下新建banner.txt文件

几个创建banner的网站

////////////////////////////////////////////////////////////////////
//                          _ooOoo_                               //
//                         o8888888o                              //
//                         88" . "88                              //
//                         (| ^_^ |)                              //
//                         O\  =  /O                              //
//                      ____/`---'\____                           //
//                    .'  \\\\|     |//  `.                         //
//                   /  \\|||  :  |||//  \                        //
//                  /  _||||| -:- |||||-  \                       //
//                  |   | \\\  -  /// |   |                       //
//                  | \_|  ''\---/''  |   |                       //
//                  \  .-\__  `-`  ___/-. /                       //
//                ___`. .'  /--.--\  `. . ___                     //
//              ."" '<  `.___\_<|>_/___.'  >'"".                  //
//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
//      ========`-.____`-.___\_____/___.-`____.-'========         //
//                           `=---='                              //
//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
//             佛祖保佑          永无BUG         永不修改         //
////////////////////////////////////////////////////////////////////
  • 千里马
//////////////////////////////////////////////////////
//                               _(\_/)             //
//                             ,((((^`\             //
//                             ((((  (6 \           //
//                          ,((((( ,    \           //
//       ,,,_              ,(((((  /"._  ,`,        //
//     ((((\\ ,...       ,((((   /    `-.-'         //
//      )))  ;'    `"'"'""((((   (                  //
//    (((  /            (((      \                  //
//      )) |                      |                 //
//     ((  |        .       '     |                 //
//     ))  \     _ '      `t   ,.')                 //
//     (   |   y;- -,-""'"-.\   \/                  //
//    )   / ./  ) /         `\  \                   //
//        |./   ( (           / /'                  //
//        ||     \\          //'|                   //
//        ||      \\       _//'||                   //
//        ||       ))     |_/  ||                   //
//        \_\     |_/          ||                   //
//        `'"                  \_\                  //
//                             `'"                  //
//////////////////////////////////////////////////////

配置

spring对banner的配置

# BANNER
spring.banner.charset=UTF-8 # Banner file encoding.
spring.banner.location=classpath:banner.txt # Banner text resource location.
spring.banner.image.location=classpath:banner.gif # Banner image file location (jpg or png can also be used).
spring.banner.image.width=76 # Width of the banner image in chars.
spring.banner.image.height= # Height of the banner image in chars (default based on image height).
spring.banner.image.margin=2 # Left hand image margin in chars.
spring.banner.image.invert=false # Whether images should be inverted for dark terminal themes.

关闭

  • 在main的run方法设置:
/**
 * 启动主类,springboot的入口
 * springboot 默认扫描的类是在启动类的当前包和下级包
 */
@SpringBootApplication
public class SpringbootWebsocketSpringdataJpaApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(SpringbootWebsocketSpringdataJpaApplication.class);
        //Banner.Mode.OFF 关闭
        springApplication.setBannerMode(Banner.Mode.OFF);
        springApplication.run(args);
    }
}
  • 方法2,Edit Configurations --> 勾选Hide banner





posted @ 2020-06-30 17:22  紫月java  阅读(347)  评论(0编辑  收藏  举报