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.
Spring Boot applications support YAML as an alternative to the application.properties file. YAML isn’t a markup language but it allows you to define properties in the hierarchical configuration.
The Spring Framework provides a straightforward abstraction for sending email by using the
JavaMailSender interface, and Spring Boot provides auto-configuration for it as well as a starter module. Start by creating a new project which uses the “mail” starter module:
Spring Boot has an awesome feature named @ConfigurationProperties that lets you automatically bind the properties defined in the application.properties file into a Java Bean class. Let’s see how to do it.
Running Spring Boot applications as a Service is pretty simple and this tutorial will show how to do it in just 5 minutes.
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
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