Hi I am trying to achieve something like this:
In a parent pom, I have
Compil
Yes you can activate the profile depending one or variety of parameters like env
variables.
<project>
...
<profiles>
<profile>
<id>development</id>
<activation>
<property>
<name>!environment.type</name>
</property>
</activation>
</profile>
</profiles>
</project>
If you are trying to have different packaging depending on X than you can use the assembly plugin and do your magic there http://maven.apache.org/plugins/maven-assembly-plugin/
More on the activation property
As of Maven 3.0, profiles in the POM can also be activated based on properties from active profiles from the settings.xml.
You can check the sample given here :
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
It won't work since...
To begin with:
And why it would not work from the parent down to the children:
Many have gone here before you and failed.
One might wonder what you are really trying to do. Are you building different artifacts from the same source project? Perhaps you need a few more Maven modules to take care of things.