application-{profile}.yml| Profile | Description |
|---|---|
application-local.yml |
Local development settings (DB, debug logs, ports) |
application-prod.yml |
Production environment settings (secure DB, optimizations) |
application-test.yml |
For testing or CI/CD pipelines |
How Spring Boot chooses profile:
java -jar myapp.jar --spring.profiles.active=prod
SPRING_PROFILES_ACTIVE=prod
application.yml (less common)spring:
profiles:
active:local
Overriding rules:
application.yml → base config