Other options ;for application configuration values

Until now, the approaches ;we took to ;configure application properties was using the key value pairs from either application.properties or application-{profile-name}.properties.

Spring Boot provides a number of other ways to configure application properties.

Listed here are some of the important ways of providing application configuration:

  • Command-line arguments
  • Creating a system property with the name ;SPRING_APPLICATION_JSON and including the JSON configuration
  • ServletConfig init parameters
  • ServletContext init parameters
  • Java System properties (System.getProperties())
  • Operating system environment variables
  • Profile-specific application properties outside of .jar, somewhere in the classpath ...

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.