Java 如何覆盖Spring@PropertySource顺序?
问题是我的数据库配置文件具有“user”值,我正在使用PropertySource并尝试获取该值,但SystemEnvironmentPropertySource具有同样具有“user”值的优先级 那么,如何指定DBConfiguration类使用database.config的用户呢 另外,我无法更改配置名称,因为许多应用程序正在使用它Java 如何覆盖Spring@PropertySource顺序?,java,spring,config,Java,Spring,Config,问题是我的数据库配置文件具有“user”值,我正在使用PropertySource并尝试获取该值,但SystemEnvironmentPropertySource具有同样具有“user”值的优先级 那么,如何指定DBConfiguration类使用database.config的用户呢 另外,我无法更改配置名称,因为许多应用程序正在使用它 @PropertySource("file:/config/database.config") public class DBConfiguration {
@PropertySource("file:/config/database.config")
public class DBConfiguration {
@Value("${user}")
private String user;
.....
}