最新寫代碼有點多,拜拜佛祖,代碼不出bug。php
在springboot項目的resources文件夾下面建立一個banner.txt文件,springboot啓動的時候默認會加載這個文件spring
${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
修改啓動類,關閉bannerspringboot
@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); } }