Hiding the Spring Boot Startup Banner
Hiding the Spring Boot Startup Banner
When you start a Spring Boot application, a banner is displayed as shown below. This page explains how to hide it.
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.5)
Method 1. Configure application.properties or application.yml
Add one of the following settings to application.properties or application.yml.
# application.properties
spring.main.banner-mode=off
# application.yml
spring:
main:
banner-mode: "off"
Method 2. Configure SpringApplication
Set Banner.Mode.OFF with SpringApplication#setBannerMode(Banner.Mode).
Main.java
package com.devkuma.springboot;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
public class Main {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(Main.class);
app.setBannerMode(Banner.Mode.OFF); // Turn off the banner.
app.run(args);
}
}
You can also configure SpringApplicationBuilder.
package com.devkuma.springboot;
import org.springframework.boot.Banner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
@SpringBootApplication
public class Main {
public static void main(String[] args) {
new SpringApplicationBuilder()
.bannerMode(Banner.Mode.OFF)
.sources(Application.class)
.run(args);
}
}