春季application.yml有条件

时间:2020-10-30 09:59:18

标签: spring spring-boot

我要像这样在spring.freemarker.template-loader-path中配置application.yml

如果设置了EXTERNAL_TEMPLATES,则将其设置为

file:${EXTERNAL_TEMPLATES},classpath:/templates

如果未设置:

classpath:/templates

我能想到的最好的方法是:

spring.freemarker.template-loader-path: ${EXTERNAL_TEMPLATES:classpath:/templates},classpath:/templates

但是如果未设置file:,这会错过前面的classpath:/templates并包括两次EXTERNAL_TEMPLATES

我怎么有这样的条件?

0 个答案:

没有答案