Spring Boot ——banner 的修改与停用

https://blog.csdn.net/yxaltl/article/details/79374243

修改banner


1.在src/main/resources 下新建banner.txt

这里写图片描述

2.通过 http://patorjk.com/software/taag 选择自己喜欢文字

这里写图片描述

3.复制网站中的结果,粘贴到新建的txt中

4.启动SpringBoot

这里写图片描述


停用banner的三种方法


1. main 里的内容修改为:

SpringApplication app 
    = new SpringApplication(xxxxxx.class);
app.setShowBanner(false);
app.run(args);
  • 1
  • 2
  • 3
  • 4

2. 使用fluent API 修改为:

new SpringApplicationBuilder(xxxxxx.class)
    .showBanner(false)
    .run(args);
  • 1
  • 2
  • 3

3. 在 application.yml 或 application.properties文件中配置

.yml 中配置如下:

spring:
    main:
        banner-mode: "off"
  • 1
  • 2
  • 3

.properties 文件中配置如下

spring.main.banner-mode = off

猜你喜欢

转载自blog.csdn.net/lppl010_/article/details/81879695
今日推荐