tomcat Server启动带profile文件

一般mvn如果配置有环境,直接在tomcat server中无法直接启动,需要在vm或者tomcat启动中添加profile启动。

pom.xml中添加:

在<profile>中添加默认profile,<activation><activeByDefault>true</activeByDefault></activation>

然后在vm中添加
-Dspring.profiles.default='local'
另一种激活:
-Dspring.profiles.active=dev
在Server中打开 :选择 Open launcher Configuration
在vm中添加以上内容,或者在environment添加以上内容即可。


原文地址:https://www.cnblogs.com/DennyZhao/p/10569483.html