1.添加Banner.txt文件

. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: tianheng Spring Boot :: (v2.0.5.RELEASE)

2.修改application.properties文件

#端口号server.port=8090#配置bannner地址spring.banner.location=banner.txt

3.添加启动类

package top.ytheng.demo;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication //等于下面3个//@SpringBootConfiguration//@EnableAutoConfiguration//@ComponentScanpublic class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); }}

4.右键Run As启动项目,如图所示

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持亿速云。