What is application.properties (or application.yml) in a Spring Boot project?
Options
- The configuration file with the port and database URL (Correct option)
- The main Java class that starts up the application
- The Maven repository where dependencies are stored
- The test report that is generated after the build
Answer
The configuration file where you set values such as the server port or the database URL
Why
Spring Boot reads settings from this file in src/main/resources, so you can change behavior without changing code.
Examples: server.port=9090, spring.datasource.url=jdbc:postgresql://localhost:5432/shop.
Different environments can use different files (profiles), and secrets should come from environment variables, not from a committed file.
Remember
application.properties = settings of the app.