I’ve succeed to externalize my spring-boot configuration file (application.properties
) in a config
folder when I run my spring-boot application as a unix service with the help of the official spring documentation https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html
I have also some i18n messages.properties
files in my src/main/resources
that I would like to externalize in the same config folder but I failed to do it. I’ve tried a lot of things, like playing with spring.messages.basename
but unfortunately, it doesn’t work.
I’m using the latest version of spring-boot, and use auto configure mode with the default i18n properties name messages
.
What am I missing??? thanks for your help.
Just a few notes:
file:message - will lookup jar's external current directory e.g. ./message_en.properties <- this is what you want
file:/message - you have to put your message files to root "/" to make it work
use notation file:config/message if you need to put in config folder together with your ./config/application.properties