如何设置SpringBoot个性化启动Banner样式与配置详解?
- 内容介绍
- 文章标签
- 相关推荐
本文共计275个文字,预计阅读时间需要2分钟。
1. 将 Banner.txt 文件内容复制粘贴到以下路径: + 网络路径: \\\\ServerName\\SharedFolder\\Banner\ + 本地路径: C:\Users\Username\Desktop\Banner\
2.确保文件权限允许读取和执行。
3.启动应用程序或脚本,系统将在指定路径下查找并显示 Banner.txt 文件的内容。
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 //@ComponentScan public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
4.右键Run As启动项目,如图所示
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持易盾网络。
本文共计275个文字,预计阅读时间需要2分钟。
1. 将 Banner.txt 文件内容复制粘贴到以下路径: + 网络路径: \\\\ServerName\\SharedFolder\\Banner\ + 本地路径: C:\Users\Username\Desktop\Banner\
2.确保文件权限允许读取和执行。
3.启动应用程序或脚本,系统将在指定路径下查找并显示 Banner.txt 文件的内容。
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 //@ComponentScan public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
4.右键Run As启动项目,如图所示
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持易盾网络。

