Skip to content

Commit 400b664

Browse files
committed
Update "banner" reference documentation
Fixes gh-2103
1 parent b63922d commit 400b664

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,33 @@ such as the user that launched the application.
5151
=== Customizing the Banner
5252
The banner that is printed on start up can be changed by adding a `banner.txt` file
5353
to your classpath, or by setting `banner.location` to the location of such a file.
54-
If the file has an unusual encoding you can set `banner.encoding` (default is UTF-8).
54+
If the file has an unusual encoding you can set `banner.encoding` (default is `UTF-8`).
55+
56+
You can use the following variables inside your `banner.txt` file:
57+
58+
.Banner variables
59+
|===
60+
| Variable | Description
61+
62+
|`${application.version}`
63+
|The version number of your application as declared in `MANIFEST.MF`. For example `1.0`.
64+
65+
|`${application.formatted-version}`
66+
|The version number of your application as declared in `MANIFEST.MF` formatted for
67+
display (surrounded with brackets and prefixed with `v`). For example `(v1.0)`.
68+
69+
|`${spring-boot.version}`
70+
|The Spring Boot version that you are using. For example `{spring-boot-version}`.
71+
72+
|`${spring-boot.formatted-version}`
73+
|The Spring Boot version that you are using formatted for display (surrounded with
74+
brackets and prefixed with `v`). For example `(v{spring-boot-version})`.
75+
|===
76+
77+
TIP: The `SpringBootApplication.setBanner(...)` method can be used if you want to generate
78+
a banner programmatically. Use the `org.springframework.boot.Banner` interface and
79+
implement your own `printBanner()` method.
80+
5581

5682

5783
[[boot-features-customizing-spring-application]]

0 commit comments

Comments
 (0)