I have a profile defined in parent pom.xml
and activated by property. In child module I need to de-activate it. How this can be done (it's Maven 3)?
ps. As far as I know it can't be done legally (MNG-4565, MNG-5083), but what is a possible workaround?
It depends. Child poms should not deny parent pom behaviour (it's like LSP for build process). It may be a good idea to define profile in a parent pom, but activate it only in child poms where you really need it.
If you can't do it, you could activate profile in a parent pom by a property with exact value:
<profiles>
<profile>
<activation>
<property>
<name>environment</name>
<value>test</value>
</property>
</activation>
</profile>
</profiles>
and then redefine property value in a child pom.
精彩评论