Application Properties

application.properties is Spring Boot’s main external configuration file, located in src/main/resources. It holds settings such as the application name, server port, context path, database details, and your own custom values. It is used so behavior can change without touching Java code or recompiling. Values are read in code with @Value for a single property or @ConfigurationProperties for a whole group.

Types of properties

  1. Core/built-in: spring.application.name, server.port, server.servlet.context-path
  2. Datasource/JPA: spring.datasource.*, spring.jpa.*
  3. Custom: your own keys, e.g. student.college-name
  4. Other formats and sources: application.yml, profile files (application-dev.properties), environment variables, and command-line args (--server.port=9090), which override the file
Scroll to Top