1 Answers

0
votes

This is definitely an opinion-based question and answer.

The answer is simple: My opinion is that spring-boot really encourages you to use application.properties whenever possible. So, I'd says:

it is better to use application.properties with spring-boot, rather than java config

spring-boot's AutoConfiguration happens so early in the spring lifecycle, that it is nearly impossible not to use application.properties (to allow AutoConfigurations to load their properties).

Also, spring-cloud-config allows loading properties remotely, so that would be another possible future advantage of using this mechanism.