In this tutorial, you will learn to use @ConfigurationProperties to handling nested properties file in Spring Boot application. Let's get started to build a simple example with Java and Maven

What you'll need

  • JDK 1.8+
  • Maven 3+

Stack

  • Java
  • Spring Boot

Project structure

├── src
│   └── main
│       ├── java
│       │   └── com
│       │       └── hellokoding
│       │           └── util
│       │               ├── Application.java
│       │               ├── NestedProperties.java
│       │               └── SimpleProperties.java
│       └── resources
│           └── application.properties
└── pom.xml

Project dependencies


Properties file


Handling Properties file



Test


mvn clean spring-boot:run

Source code

[email protected]:hellokoding/handling-properties-file-springboot.git

https://github.com/hellokoding/handling-properties-file-springboot