ALL LESSONS Module 7

Profiles and Configuration

Apr 5, 2026 1 min read

Environment Management

Separate configurations for dev/test/prod.

Profile Usage

application-dev.yml:
spring.datasource.url=jdbc:h2:mem:test

application-prod.yml:
spring.datasource.url=jdbc:postgresql://prod:5432/db

spring.profiles.active=dev

Configuration Sources

  • YAML multi-profile support
  • @Profile conditional beans
  • Environment variables override
  • @ConfigurationProperties

Need help with this lesson? Visit the Discussion Forum