file in SpringBoot

  • Spring Boot comes with a built-in mechanism for application configuration using a file called
  • You can find the configuration keys in the official documentation as well

Basics of :

  • The file is nothing more than simple key-value storage for configuration properties.
  • We can bundle the configuration file in your application jar or put the file in the filesystem of the runtime environment and load it on Spring Boot startup.
  • Using this file we can configure the spring boot framework
  • Define the application custom configuration properties
  • Spring Boot loads the file automatically from the project classpath, all we have to do is to create file under src/main/resources directory.

Common configuration


Injecting properties with @Value

Environment specific file

Externalising file

Leave a Comment