How to disable maven profile in child module?

I have a profile defined in the parent pom.xml and activated by the property. In the child module I need to deactivate it. How can this be done (this is Maven 3)?

ps. As far as I know, this cannot be done legally ( MNG-4565 , MNG-5083 ), but what is the possible workaround?

+4
source share
1 answer

It depends. Lipstick children should not deny the behavior of the parent poet (this is similar to the LSP for the assembly process). It might be a good idea to define a profile in the parent pump, but only activate it in the baby pumps where you really need it.

If you cannot do this, you can activate the profile in the parent pump using the property with the exact value:

 <profiles> <profile> <activation> <property> <name>environment</name> <value>test</value> </property> </activation> </profile> </profiles> 

and then override the property value in the child folder.

-3
source

All Articles