Hi All,

Greeting of the day!

Today we will discuss the below 2 points 

  • How to add custom banner in spring boot.
  • How we can hide the banner in spring boot.
By default, spring is printing below the banner on startup.


Now let's discuss 1st point i.e how we can configure a custom banner in spring boot

For that first you need to create a banner, there are many sites from where you can generate your banner.

Once you generate a banner you need to create banner.txt with banner content and place it under \src\main\resources.



So that's all spring will automatically replace the default banner with banner.txt on startup, as shown below.


Now, let's discuss 2nd point i.e how we can hide/disable banner in spring boot on startup.

For that we have a second option first you can add the below property in the application.properties 

spring.main.banner-mode=off

And then on running the project, you will find the banner is disabled on startup.

The second option is by adding code in our main class as shown below.

Here we are setting Banner.Mode.OFF which will remove the banner on startup.

Other articles you can refer

Caching In Spring Boot + Caching In Spring Rest API + Clear Cache In Spring Boot

Spring Microservices Overview

Spring Microservices - Netflix Eureka Service Registration and Discovery

Spring Batch Components And Architecture

Spring Batch Example -CSV To Database with Spring Boot & Oracle

Spring Rest API + CRUD Example + Spring Boot + Oracle Database + Spring JPA

Spring MVC CRUD + Spring Boot + Oracle + Thymeleaf

Thanks

Happy Learning!