Changing the banner of Spring Boot applications

Marcos
2 min readJan 20, 2023

--

Do you know the spring banner that appears at the start of the application?

It’s possible to change the spring draw for whatever we want.

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

Let’s create a file called banner.txt in ./src/resources directory. The content of this file is:

#################################################
# Spring Kafka Demo #
# author: mmarcosab #
# creation date: 15/01/2023 #
# repo: https://github.com/mmarcosab/kafka-demo #
#################################################

This will appear at the start of the application. Like this:

A lot of people draw something and it’s very interesting. I prefer to organize some useful information like URL repo, some docs, or contacts.

We can also use images, and spring waits for a file called banner.gif. In this example I used this image:

And the result was:

If you wanna change the location of the image, use this property:

spring.banner.image.location=

And these properties change some properties of the image:

spring.banner.image.width=
spring.banner.image.height=
spring.banner.image.margin=
spring.banner.image.invert=

That’s it for today.

--

--