zoukankan      html  css  js  c++  java
  • 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





  • 相关阅读:
    stm32 SPI DMA读取ADS8345数据
    Minigui3.0.12完美安装,折腾了一天。终于看到了
    qvfb2的安装,在ubuntu10.4上安装成功
    户口从杭州人才市场迁移到武汉万科魅力之城的过程
    禁止minigui 3.0的屏幕保护
    想穿越回到儿时记录那些幸福
    TIM2定时闪灯程序。。。
    关于minigui的皮肤控件无法显示问题
    插件框架内核的设计
    用“序列图”描述技术方案
  • 原文地址:https://www.cnblogs.com/ziyue7575/p/8c3942745cb8f8de4e0ae90c63a64243.html
Copyright © 2011-2022 走看看