最新写代码有点多,拜拜佛祖,代码不出bug。
在springboot项目的resources文件夹下面创建一个banner.txt文件,springboot启动的时候默认会加载这个文件
${AnsiColor.BRIGHT_YELLOW} //////////////////////////////////////////////////////////////////// // _ooOoo_ // // o8888888o // // 88" . "88 // // (| ^_^ |) // // O\ = /O // // ____/`---'\____ // // .' \\| |// `. // // / \\||| : |||// \ // // / _||||| -:- |||||- \ // // | | \\\ - /// | | // // | \_| ''\---/'' | | // // \ .-\__ `-` ___/-. / // // ___`. .' /--.--\ `. . ___ // // ."" '< `.___\_<|>_/___.' >'"". // // | | : `- \`.;`\ _ /`;.`/ - ` : | | // // \ \ `-. \_ __\ /__ _/ .-` / / // // ========`-.____`-.___\_____/___.-`____.-'======== // // `=---=' // // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // // 佛祖保佑 永不宕机 永无BUG // ////////////////////////////////////////////////////////////////////
效果图
banner.txt配置
-
${AnsiColor.BRIGHT_YELLOW}:设置控制台中输出内容的颜色 -
${application.version}:用来获取MANIFEST.MF文件中的版本号 -
${application.formatted-version}:格式化后的${application.version}版本信息 -
${spring-boot.version}:Spring Boot的版本号 -
${spring-boot.formatted-version}:格式化后的${spring-boot.version}版本信息
关闭banner
修改启动类,关闭banner
@SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication springApplication = new SpringApplication(Application.class); //Banner.Mode.OFF 关闭 springApplication.setBannerMode(Banner.Mode.OFF); springApplication.run(args); } }
定制banner
- http://patorjk.com/software/taag
- http://www.network-science.de/ascii/
- http://www.degraeve.com/img2txt.php