sprinboot启动使用外部配置文件

--启动java,使用当前目录apiadressconfig.properties 配置

java -jar xxxxx-0.0.1-SNAPSHOT.jar -apiadressconfig.properties=file:./apiadressconfig.properties 

 

--java代码,本地使用一个文件,正式上线使用一个文件

@PropertySource("classpath:apiadressconfig.properties")
@PropertySource(value = "${apiadressconfig.properties}", ignoreResourceNotFound = true)

 

posted @ 2020-06-11 13:22  搞错,重来  阅读(25)  评论(0)    收藏  举报