Repaso
Español
Spring, JPA & Java WebFoundationsSPR-43

What is application.properties (or application.yml) in a Spring Boot project?

Options

  1. The configuration file with the port and database URL (Correct option)
  2. The main Java class that starts up the application
  3. The Maven repository where dependencies are stored
  4. 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.

Key terms

Practice this question in Repaso