Spring Boot — Precedence Order Among Properties File | Code Factory

  1. Devtools global settings properties on your home directory (~/.spring-boot-devtools.properties when devtools is active).
  2. @TestPropertySource annotations on your tests.
  3. properties attribute on your tests. Available on @SpringBootTest and the test annotations for testing a particular slice of your application.
  4. Command line arguments.
  5. Properties from SPRING_APPLICATION_JSON (inline JSON embedded in an environment variable or system property).
  6. ServletConfig init parameters.
  7. ServletContext init parameters.
  8. JNDI attributes from java:comp/env.
  9. Java System properties (System.getProperties()).
  10. OS environment variables.
  11. A RandomValuePropertySource that has properties only in random.*.
  12. Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants).
  13. Profile-specific application properties packaged inside your jar (application-{profile}.properties and YAML variants).
  14. Application properties outside of your packaged jar (application.properties and YAML variants).
  15. Application properties packaged inside your jar (application.properties and YAML variants).
  16. @PropertySource annotations on your @Configuration classes.
  17. Default properties (specified by setting SpringApplication.setDefaultProperties).

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Contributing to Open Source : Week 1

Building trust — with people and software

Can we have a scalable fastapi service with common cache across multiple workers or threads ?

MatrixOne, a hyperconverged and one-size-fits-most database

Dynapower energy storage systems added to Energy Toolbase’s Developer modeling platform

“Missing Authentication Token” — CloudFront/APIG Troubleshooting

Writing DSLs in Kotlin (part 1)

April 2020 — More Labs

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Code Factory

Code Factory

More from Medium

Communication Between Microservices | Spring WebClient

Setting Up Java

Functional Interfaces in Java

Enable authentication and configure ActiveMQ in Java application