Eclipse 中的 Maven 配置文件和 Tomcat
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16280858/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Maven Profiles and Tomcat in Eclipse
提问by cahen
If I have 2 maven profiles for a WAR application like this:
如果我有 2 个 WAR 应用程序的 Maven 配置文件,如下所示:
mvn clean install -Pdevelopment
mvn clean install -Pproduction
and I import it in Eclipse to run in Tomcat, how to I tell Tomcat to use one profile or the other?
我在 Eclipse 中导入它以在 Tomcat 中运行,如何告诉 Tomcat 使用一个配置文件或另一个?
回答by Charlee Chitsuk
You can activate the maven profile
at the Eclipse
by using the following step: -
您可以使用以下步骤激活maven profile
at Eclipse
: -
Right click
at your project and selectproperties
.- At the
Properties windows
selectMaven
. - At the
right hand panel
you will seeActive Maven Profiles
text box. - Please enter your
profile name
, e.g.development
orproduction
.
Right click
在您的项目中并选择properties
.- 在
Properties windows
选择Maven
. - 在
right hand panel
您将看到Active Maven Profiles
文本框。 - 请输入您的
profile name
,例如development
或production
。
I hope this may help.
我希望这可能会有所帮助。