# 类上加入这段话即可
@PropertySource(value = {"classpath: local.properties", "file:${spring.profiles.path}/local.properties"},
ignoreResourceNotFound = true)
# jar包和配置文件在同目录下
java -jar xxx.jar --spring.config.location=local.properties
# 类上加入这段话即可
@PropertySource(value = {"classpath: local.properties", "file:${spring.profiles.path}/local.properties"},
ignoreResourceNotFound = true)
# jar包和配置文件在同目录下
java -jar xxx.jar --spring.config.location=local.properties
本文标题:jar包引用外部配置文件作为配置
本文链接:https://www.haomeiwen.com/subject/hbvfhhtx.html
网友评论