[Index](../README.md) · [Profiles →](02-profiles.md) # 1. The precedence list Spring Boot's documented order, lowest precedence first. Later entries win. | # | Source | |---|---| | 1 | Default properties (`SpringApplication.setDefaultProperties`) | | 2 | `@PropertySource` on `@Configuration` classes | | 3 | **Config data** — `application.properties`, `application.yaml`, profile-specific files, `spring.config.import` | | 4 | `RandomValuePropertySource` (`random.*`) | | 5 | **OS environment variables** | | 6 | Java system properties (`-D`) | | 7 | JNDI attributes from `java:comp/env` | | 8 | `ServletContext` init parameters | | 9 | `ServletConfig` init parameters | | 10 | `SPRING_APPLICATION_JSON` | | 11 | Command-line arguments | | 12 | `properties` on `@SpringBootTest` | | 13 | `@DynamicPropertySource` | | 14 | `@TestPropertySource` | | 15 | Devtools global settings | ## The two rows that matter **Item 3 covers every file you write.** `application.yaml`, `application-prod.yaml`, an imported config tree, a mounted ConfigMap — all of it is config data, all of it at rank 3. **Item 5 is above it.** Every environment variable outranks every file. Profile-specific files beat non-profile files, and later imports beat earlier ones, but those are orderings *within* item 3. Nothing inside item 3 can reach item 5. That single fact explains the bug this project exists for, and [chapter 4](04-why-your-profile-file-lost.md) walks through it with a transcript. ## Seeing it for real `/sources` prints the live stack, which is more useful than the table because it shows exactly which files were loaded: ``` 3. SimpleCommandLinePropertySource commandLineArgs 6. PropertiesPropertySource systemProperties 7. OriginAwareSystemEnvironmentPropertySource systemEnvironment 9. OriginTrackedMapPropertySource application-prod-metrics.yaml 10. OriginTrackedMapPropertySource application-prod-db.yaml 11. OriginTrackedMapPropertySource application-prod.yaml 12. OriginTrackedMapPropertySource application.yaml ``` Note rank 2 in the real stack, which the table does not mention: `ConfigurationPropertySourcesPropertySource`, named `configurationProperties`. That is the source Spring Boot attaches to give `${...}` placeholders the binder's relaxed name matching — see the [binding project's chapter 2](../../configuration-properties/docs/02-relaxed-binding.md).