当注解@ConfigrationProperties(prefix="value")中value在application.properties\application.yml\another.properties配置文件中均存在时,注入优先级为:application.properties>application.yml>another.properties。
换句话说,即便此时使用@PropertySource注解指定配置文件为another.properties也是没有用的,依然优先引用application.properties。
以上是在配置文件在同一文件夹内时的情况,在不同文件夹中配置文件的优先级为file:./config/>
file:./>
classpath:/config/>
classpath:/