当前位置: 首页 > news >正文

springboot--基本特性--自定义 Banner

SpringApplication的使用

  • 前言
  • 效果
  • 1.1 自定义banner
  • 1.2 自定义SpringApplication
    • 配置文件优先级高于程序化调整的优先级
    • 启动自定义banner
    • 关闭自定义banner
  • 1.3 FluentBuilder API

前言

修改启动时候的修改banner

效果

在这里插入图片描述

1.1 自定义banner

banner制定官网链接
在配置文件中设置
在这里插入图片描述

在这里插入图片描述
也可以通过配置将提示关闭

spring.main.banner-mode=off

在这里插入图片描述

1.2 自定义SpringApplication

配置文件优先级高于程序化调整的优先级

启动自定义banner

在这里插入图片描述

package com.example.boot306demo;import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication  //主程序类
public class Boot306DemoApplication {public static void main(String[] args) {
//        1、SpringApplication:Boot应用的核心API入口
//        SpringApplication.run(Boot306DemoApplication.class, args);//        自定义SpringApplicationSpringApplication application = new SpringApplication(Boot306DemoApplication.class);
//        打开自定义bannerapplication.setBannerMode(Banner.Mode.CONSOLE);
//        关闭自定义banner
//        application.setBannerMode(Banner.Mode.OFF);application.run(args);}
}

关闭自定义banner

在这里插入图片描述

application.setBannerMode(Banner.Mode.OFF);

1.3 FluentBuilder API

//        build方式构建,SrpingApplication. 通过FlentAPI进行设置new SpringApplicationBuilder().main(Boot306DemoApplication.class).sources(Boot306DemoApplication.class).bannerMode(Banner.Mode.CONSOLE).run(args);
http://www.lryc.cn/news/212878.html

相关文章:

  • Vue3:checkbox使用及限制选中数量
  • ​如何选择更快更稳定的存储服务器​
  • AcWing89. a^b
  • 【推荐系统】推荐算法:冷启动-召回-粗排-精排-重排 解读
  • NB-IOT的粮库挡粮门异动监测装置
  • 六、【图像去水印】
  • 电子电器架构 —— 车载网关初入门(二)
  • AT32固件库外设使用,ArduinoAPI接口移植,模块化
  • 【Postgres】Postgres常用命令
  • pthread 读写锁使用详解
  • MySQL扩展语句
  • 阿里云号码认证服务(一键登录)在连接wifi的情况下部分机型下存在的问题
  • 电脑屏幕监控软件,能够帮助企业完成哪些事情?
  • java--方法的其他形式
  • IDEA配置类、方法注释模板
  • PowerDesigner 16数据库(mysql)逆向生成pdm
  • Spring Cloud 之Feign
  • 通用开源自动化测试框架 - Robot Framework
  • css position属性与js滚动
  • python内置模块hashlib对于字符串的加密解密加盐
  • 获取客户端请求IP及IP所属城市
  • 【洛谷 P1106】删数问题 题解(贪心+字符串)
  • 【Python · PyTorch】线性代数 微积分
  • 建模和图表工具:Software Ideas Modeler Crack
  • Android开发,车载通讯应用——binder通讯原理解析
  • [算法]求n!在m进制下末尾有多少个0
  • mysql之用户管理、权限管理、密码管理
  • 图情档核心期刊 | 北大核心、CSSCI、CSCD
  • Mac上具好用的屏幕录像工具(Omi录屏专家)Screen Recorder By Omi Mac 下载安装详细教程
  • 牛客网刷题-(8)