Properties for a Spring Boot App


There are, in fact, several ways to set properties for a Spring Boot application. Spring

Boot will draw properties from several property sources, including the following:

  1. Command-line arguments

  2. JNDI attributes from java:comp/env

  3. JVM system properties

  4. Operating system environment variables

  5. Randomly generated values for properties prefixed with random.* (referenced when setting other  properties, such as `${random.long})

  6. An application.properties or application.yml file outside of the application

  7. An application.properties or application.yml file packaged inside of the application

  8. Property sources specified by @PropertySource

  9. Default properties