Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best place to store the application.properties file for a Spring boot application?

I have an application.properties file which I have placed at the same level as the src folder. Things are working correctly. But, is this the standard place to keep this file? What is the best practice?

like image 471
Amit Avatar asked Dec 13 '25 06:12

Amit


1 Answers

I place them at src/main/resources. Some would prefer src/main/resources/config. When deploying, I put the customized properties at the same folder where the jar is placed. Again, some would prefer the config sub folder.

Spring Boot picks the files from these locations by default.

like image 107
Sanjay Avatar answered Dec 16 '25 05:12

Sanjay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!