Java 我可以让一个 Maven 配置文件激活另一个吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/943411/
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
Can I make one maven profile activate another?
提问by krosenvold
I have 2 maven2 profiles, selenium and jspc. Now for "selenium" id'd like to have an implicit activation of "jspc", so that I don't have to write mvn -Pselenium,jspc from the command line. Is this possible ?
我有 2 个 maven2 配置文件,selenium 和 jspc。现在对于“selenium”id 想要隐式激活“jspc”,这样我就不必从命令行编写 mvn -Pselenium,jspc 。这可能吗 ?
采纳答案by Robert Munteanu
You can't "chain" profile activations (maven reference) but you can activate them both through the same property:
您不能“链接”配置文件激活(maven 参考),但您可以通过相同的属性激活它们:
<activation>
<property>
<name>profile.selenium</name>
</property>
</activation>
And the run mvn -Dprofile.selenium
和运行 mvn -Dprofile.selenium