Skip to main content

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