springboot——利用banner.txt修改启动的图形SPRING

最近在看一个开源项目halo,发现启动的时候居然打印的不是SPRING自带的图形,而是作者项目的名称,于是查了一下,发现有个骚东西banner.txt(src/main/resources/banner.txt),是springboot留给我们的一个修改banner的入口。

原有banner 自己设计的banner

banner.txt中代码如下:

${AnsiColor.BLUE}
    __  __      __
   / / / /___ _/ /___
  / /_/ / __ `/ / __ \
 / __  / /_/ / / /_/ /
/_/ /_/\__,_/_/\____/

banner.txt配置

${AnsiColor.BRIGHT_RED}:设置控制台中输出内容的颜色
${application.version}:用来获取MANIFEST.MF文件中的版本号
${application.formatted-version}:格式化后的 ${application.version}版本信息
${spring-boot.version}:Spring Boot的版本号
${spring-boot.formatted-version}:格式化后的 ${spring-boot.version}版本信息


官方设置:

https://docs.spring.io/spring-boot/docs/2.1.0.RELEASE/reference/htmlsingle/#common-application-properties

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.


一些有意思的设计:
在这里插入图片描述在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值