我可以让一个maven配置文件激活另一个吗?

我可以让一个maven配置文件激活另一个吗?

问题描述:

我有2个maven2配置文件,selenium和jspc。现在对于seleniumid喜欢隐式激活jspc,这样我就不必从命令行编写mvn -Pselenium,jspc了。这可能吗?

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 ?

你不能链接配置文件激活( maven reference )但您可以通过同一属性激活它们:

You can't "chain" profile activations (maven reference) but you can activate them both through the same property:

<activation>
  <property>
    <name>profile.selenium</name>
  </property>
</activation>

并且运行 mvn -Dprofile.selenium