springboot 引用外部配置文件

在项目下新建bootstrap.yml(或bootstrap.properties)文件,将spring.config.location配置在次文件中。

 

说明: bootstrap文件会优先于application.properties加载,所以引导类型的配置都配置在这里。

 

如果bootstrap.yml依然无效,可以使用注解:@PropertySource

@PropertySource(value={"file:C://Users//Administrator//Desktop//properties//manage-application.properties"},ignoreResourceNotFound=true)

 

你可能感兴趣的:(java)