Customizing the Spring Boot Banner

Leo Gutiérrez
The Startup
Published in
4 min readJan 15, 2021

--

Hello! In this article, I will show you multiple easy ways to customize the default Spring Boot Banner.

I am currently working on a small Web Application using Spring Boot, after running my app for dozen of times while testing, I wondered how I could show a different banner instead of the default:

It turns to be really simple, as usual, in the Spring world, we just need to override a few properties.

First Steps

How to enable/disable the banner

It seems that there are multiple ways, java-based code, properties files or the Command Line.

Java-Based

import org.springframework.boot.Banner;
import org.springframework..boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
@SpringBootApplication
public class MyBannerApplication {
public static void main(final String[] args) {
new SpringApplicationBuilder(MyBannerApplication.class)
.bannerMode(Banner.Mode.OFF)
.run(args)
;
}
}

Properties (application.properties)

spring.main.banner-mode=off

--

--

Leo Gutiérrez
The Startup

Hi! I am Leonardo Gutiérrez R., a passionate software developer, I hope you find the content in this blog interesting. I write about IT related stuff.