运行时选择spring boot xml配置
我必须使用 XML beans 配置运行旧版 spring boot (2.1.8) 应用程序
SpringApplication.run(MyApplication.class, args);
,
该配置必须在运行时从 src/main 选择/资源
目录: a/config.xml
或者 b/config.xml
基于具有相应值 a
或 b
的环境变量。有没有办法像这样加载 XML 配置?
I have to run a legacy spring boot (2.1.8) app
SpringApplication.run(MyApplication.class, args);
with XML beans config which must be selected at runtime from the src/main/resources
dir:a/config.xml
orb/config.xml
based on an env variable with the respective value a
or b
. Is there a way to load XML config like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否查看过Spring Profiles?这可能会让你到达你想去的地方。
Have you looked into Spring Profiles; this might get you where you want to be.