一、生成艺术字
springboot启动时会打印一个banner,就是spring的艺术字,
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.1.0.RELEASE)
这个是可以自定义的。
(1)、若设置艺术字,可以到下面的网站去生成艺术字,然后复制到txt文件中即可。网址:
http://www.network-science.de/ascii/ http://www.kammerl.de/ascii/AsciiSignature.php http://www.patorjk.com/software/taag
https://www.bootschool.net/ascii
如访问http://www.network-science.de/ascii/,字体选择standard
如访问:http://www.kammerl.de/ascii/AsciiSignature.php,字体选择standard,
如访问:http://www.patorjk.com/software/taag,选择standard
如访问:https://www.bootschool.net/ascii,选择standard
还可以下载banner.txt文件,
二、springboot项目中使用艺术字
在资源目录下创建一个banner.txt,在里面写入的文本就会在项目启动的时候打印出来。
____ _ / ___| _ __ _ __(_)_ __ __ _ \___ \| '_ \| '__| | '_ \ / _` | ___) | |_) | | | | | | | (_| | |____/| .__/|_| |_|_| |_|\__, | |_| |___/ :: Spring Boot :: (${spring-boot.version})
启动后效果如下:
____ _ / ___| _ __ _ __(_)_ __ __ _ \___ \| '_ \| '__| | '_ \ / _` | ___) | |_) | | | | | | | (_| | |____/| .__/|_| |_|_| |_|\__, | |_| |___/ :: Spring Boot :: (2.1.0.RELEASE)
若要显示SpringBoot的版本信息,则可以在里面添加下面的代码
${spring-boot.version}
${spring-boot.formatted-version}
使用下面一种就会在版本前面多一个v,如
____ _
/ ___| _ __ _ __(_)_ __ __ _
\___ \| '_ \| '__| | '_ \ / _` |
___) | |_) | | | | | | | (_| |
|____/| .__/|_| |_|_| |_|\__, |
|_| |___/
:: Spring Boot :: (v2.1.0.RELEASE)
三、关闭banner
不过这个banner也是可以设置关闭的,修改mian方法:
@SpringBootApplication @MapperScan("com.zwh.dao") public class MySpringBootApplication { public static void main(String[] args) { SpringApplicationBuilder builder=new SpringApplicationBuilder(MySpringBootApplication.class); builder.bannerMode(Banner.Mode.OFF).run(args); // SpringApplication.run(MySpringBootApplication.class); } }
感谢您的阅读,如果您觉得阅读本文对您有帮助,请点一下“推荐”按钮。本文欢迎各位转载,但是转载文章之后必须在文章页面中给出作者和原文连接。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
2021-09-02 RequestBodyAdvice和ResponseBodyAdvice详解,@ControllerAdvice注解