spring:
profiles:
active: all #表示指定后缀有-all的配置文件
src:
upload: ${src.upload} #引用指定配置文件中的值
product: ${src.procut}
frame: ${src.frame}
cutting: ${src.cutting}
indexmakerPath: ${src.indexmakerPath}
src:
uploadPath: D:\ProjectFiles\UploadFile productPath: D:\ProjectFiles\productFile framePath: D:\ProjectFiles\frame cuttingPath: D:\ProjectFiles\cutting ffmpegPath: D:\devsoft\ffmpeg\bin tmpFilePath: D:\ProjectFiles\UploadFile
tmpFilePath2: /ProjectFiles/UploadFile
zjx-upload-href: http://192.168.6.175:80/content/
indexmakerPath: D:\devsoft\rtspgw_0_13_2d_win32 uploadproxypath: http://192.168.6.174:8889/ProjectFiles/UploadFile/
logconf: D:\IdeaProjects\toolupload\log\confFile frameproxy: http://192.168.6.174:8889/ProjectFiles/frame/
这样其他的springboot就可以调用外部的配置文件了
在启动jar的bat文件中也可以加上,来指定外部配置文件
--spring.profiles.active=api -Dspring.config.location=application-api.yml
主要描述了读取外部配置文件的优先级关系springBoot项目打jar包后,修改配置文件中的配置项
原文:https://www.cnblogs.com/psyduck/p/14167858.html