Importing properties from an external file in Spring Boot

With earlier versions of Spring Boot, it was cumbersome to import additional properties or yaml files short of using application.properties and application.yml. You could use the spring.config.additional-location property, but you needed to set it pretty early and it was quite limited with the types of files that it could deal with.

Read more

Using @Grab Annotation in Spring Boot

The @Grab annotation comes from Groovy’s Grape facility. In a nutshell, Grape enables Groovy scripts to download dependency libraries at runtime without using a build tool like Maven or Gradle. In addition to providing the functionality behind the @Grabannotation, Grape is also used by the Spring Boot CLI to fetch dependencies deduced from the code. … Read more

How to change Spring Boot default Banner

You should have noticed that when you run a Spring Boot application a banner is displayed at the beginning of the application. For your own purposes, you can customize the starting banner by implementing the org.springframework.boot.Banner interface. Let’s see an example of it: package com.demo; import java.io.PrintStream; import org.springframework.boot.Banner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.core.env.Environment; … Read more