Tomcat 激活spring profile

springboot打包war部署到外部tomcat的时候指定profile启动

  • windows

在%tomcat%/bin下创建setenv.bat文件

  • linux

在%tomcat%/bin下创建setenv.sh文件

使用JVM参数:

  • windows
    set "JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active=dev"
  • inux
    JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=dev"

或者使用CATALINA_OPTS参数:

CATALINA_OPTS="-Dspring.profiles.active=prod"

posted @ 2019-01-09 15:37  这谁顶着住啊  阅读(3775)  评论(0编辑  收藏  举报