我有一个 tomcat 盒子,它已经设置了 spring 活动配置文件,每次通过 catalina 部署 spring 应用程序时作为命令行参数。
我正在使用 Spring Cloud 配置服务器,因此在配置客户端中,我在 bootstrap.yml 中指定了活动配置文件,但正如我之前提到的,它被 tomcat 命令行参数覆盖。
如何在引导上下文加载时使用我的 boostrap.yml 覆盖通过 tomcat 传递的命令行参数,以便我可以将活动配置文件从我的 bootstrap.yml 传递到配置服务器。
Tomcat 设置环境命令(我无法更改,因为我无权访问)
JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/path -Dspring.profiles.active=e2"
引导程序.yml
spring:
profiles:
active: e2,cron
cloud:
config:
uri: http://localhost:8888
application:
name: heartbeat_monitor.