SpringExamples

Spring boot disable banner example

By Admin | Filed Under: Spring Boot

Learn two ways to disable custom start-up banner in Spring Boot applications.

1. Set Banner Mode to OFF – application.properties

Set the banner mode to OFF.

spring.main.banner-mode=OFF

2. Use SpringApplication.setBannerMode() method

Use setBannerMode(Banner.Mode.OFF) in @SpringBootApplication class.

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {
	public static void main(String[] args) 
	{
		SpringApplication app = new SpringApplication(Application.class);
        app.setBannerMode(Banner.Mode.OFF);
        app.run(args);
	}
}
Sourcecode Download

Ask Questions & Share Feedback Cancel reply

Your email address will not be published. Required fields are marked *

*Want to Post Code Snippets or XML content? Please use [java] ... [/java] tags otherwise code may not appear partially or even fully. e.g.
[java] 
public static void main (String[] args) {
...
}
[/java]

Development Environment

  • Spring Boot 2.0.1.RELEASE
  • Maven
  • JDK 8
  • Eclipse

Spring Boot Tutorial

  • Hello world example
  • Which main class
  • Print all beans
  • Embedded jetty server
  • CommandLineRunner
  • Custom banner
  • Change Root Path and Server Port

Spring Tutorial

  • IoC Container
  • Java Configuration

Spring WebMVC Tutorial

  • Minimum required config

Copyright © 2016 · springexamples.com · All Rights Reserved. | Sitemap