gpt4 book ai didi

tomcat - 一个 tomcat 实例中的多个 spring.active.profiles

转载 作者:行者123 更新时间:2023-11-28 22:26:33 30 4
gpt4 key购买 nike

我需要在一个 tomcat8 实例上部署多个不同的 war 文件。

一些 war 文件需要 spring.active.profile 是“生产”,一些其他 war 文件需要这个值是“测试”。

这能以某种方式实现吗?

我现在可以在/etc/default/tomcat8 中设置 -Dspring.active.profile=production 但这是全局的...我需要为每个 war 文件提供单独的解决方案...

有人可以帮忙吗?

最佳答案

只需将配置文件名称添加到每个 webapp web.xml 文件中:

<context-param>
<param-name>spring.profiles.active</param-name>
<param-value>production</param-value>
</context-param>

关于tomcat - 一个 tomcat 实例中的多个 spring.active.profiles,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42574858/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com