Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is application.default.properties file will be picked ever?

We have following properties files in our springboot project.

application-local.yaml
application-develop.yaml
application-qa.yaml
application-uat.yaml
application-prod.yaml
application-default.yaml
application.yaml

From our code i understand that we have one properties file for each envirnonment. But here my question is "application-default.properties/yaml" file will exeucte by any chance? will this file executes only when we call -Dspring.profiles.active=default or is there any case where this file will be executed?

like image 762
Satya Avatar asked Oct 31 '25 14:10

Satya


2 Answers

The Environment has a set of default profiles (by default, [default]) that are used if no active profiles are set. In other words, if no profiles are explicitly activated, then properties from application-default are considered.

See documentation

like image 183
Nemanja Avatar answered Nov 02 '25 03:11

Nemanja


No the default application properties will be "application.yml" If you don't specify any profile. The name of your file "application.default.yml" is confusing yourself. https://docs.spring.io/spring-boot/docs/current/reference/html/features.html

like image 29
Camille Desmots Avatar answered Nov 02 '25 02:11

Camille Desmots