在Spring Boot中使用自定义横幅

在Spring Boot中使用自定义横幅

我们需要在src/main/resources目录中创建一个名为banner.txt的文件,并将横幅内容粘贴到其中。就像这样:
在这里插入图片描述
运行效果:
在这里插入图片描述

这里需要注意的是banner.txt是默认的预期banner文件名,Spring Boot默认使用它。但是,如果要为横幅选择任何其他位置或其他名称,则需要在配置文件中设置spring.banner.location属性。就像这样:

spring:
  banner:
    location: classpath:/xxx/xxx.txt
发布了82 篇原创文章 · 获赞 9 · 访问量 6172

猜你喜欢

转载自blog.csdn.net/weixin_43424932/article/details/104628253