Profiles & Externalized Configuration
Learn Profiles & Externalized Configuration (Spring Boot Basics, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Spring Boot Profiles Using Spring Boot we can set different profiles for the dev , test and prod environments. Why do we use them? In a company you work across several environments, and each has its own configuration - driver name, URL, username, password. Editing one application.properties file every time you move between them is not workable. The answer is to create one properties file per environment and let Spring pick the right one at startup. Steps Create the Spring Boot Maven project Add the Maven dependency to pom.xml Write the database connection code in the main properties file...
More lessons in Spring Boot Basics
- Introduction to Spring Boot
- Spring vs Spring Boot
- Spring Boot Features & Architecture
- Spring Boot Features
- Spring Initializr
- Maven/Gradle with Spring Boot
- Starter Dependencies
- spring-boot-starter
- Spring Boot Annotations Explained
- Spring Boot - Internal Working
- Internationalization (i18n)
- Mini Project: Configurable Shop Banner (Auto-configuration and Properties)