Ilya Buziuk Ilya Buziuk - 1 month ago 8
Java Question

Maven profile activation - how to define several conditions for activations

Maven profile

<activation>
block used to be a list of
OR
statements until v3.2.2. However, once the http://jira.codehaus.org/browse/MNG-4565 was resolved it became a list of
AND
statements e.g.:

<activation>
<activeByDefault>false</activeByDefault>
<os>
<name>linux</name>
</os>
<property>
<name>release</name>
<value>true</value>
</property>
</activation>


The following profile would be activated when the OS is linux AND the
release
property is set to
true
. The question is - how would it be possible to configure OR logic i.e. either OS is linux
OR
release
property is set to
true
for maven v3.2.2 and above ?

Answer

For now it is not possible to configure ORlogic for maven profile activation (unless to copy-paste the profile, one with each of the 2 possible ways of activation):

Related JIRA issues:

Thanks to the @Tunaki and @Michael-O for their comments to the original question - more details can be found there