The banner that is printed on start up can be changed by adding a banner.txt file to your classpath
or by setting the spring.banner.location property to the location of such a file. If the file has an
encoding other than UTF-8, you can set spring.banner.charset. In addition to a text file, you can also
add a banner.gif, banner.jpg, or banner.png image file to your classpath or set the
spring.banner.image.location property. Images are converted into an ASCII art representation and
printed above any text banner.
example:
在classpath下放一个banner.txt 就ok
#默认:classpath:banner.txt
spring.banner.location=classpath:banner.txt
banner.txt中可以包含内置变量
${application.version} The version number of your application, as
declared in MANIFEST.MF. For example,
Implementation-Version: 1.0 is printed as 1.0.
${application.formatted-version} The version number of your application, as
declared in MANIFEST.MF and formatted for
display (surrounded with brackets and prefixed
with v). For example (v1.0).
${spring-boot.version} The Spring Boot version that you are using. For
example 2.2.6.RELEASE.
${spring-boot.formatted-version} The Spring Boot version that you are using,
formatted for display (surrounded with brackets
and prefixed with v). For example
(v2.2.6.RELEASE).
{AnsiColor.NAME},
{AnsiStyle.NAME})
Where NAME is the name of an ANSI escape code.
See AnsiPropertySource for details.
${application.title} The title of your application, as declared in
MANIFEST.MF. For example Implementation-Title:
MyApp is printed as MyApp.
网友评论