The above example is working as designed. The <activeByDefault/> element is meant to specify that this profile will be activated if no other profiles are active in the build. Therefore, specific activation of any profile will cause this one to be deactivated. The issue with using the logic that the profile should always be applied is this:
1. If it's always applied, why not put it in the POM?
2. If it's active-unless-deactivated, how do you deactivate it?
Changing this feature right now might not make a huge impact on the user community, but it would break backwards compatibility in the strictest sense. Also, it requires defining some mechanism for deactivating profiles. We have one undocumented feature for this, which is:
-P -jboss4x
which would explicitly deactivate the jboss4x profileId, but this is not well tested, and IMO is pretty specific...I'd say that we would need something akin to:
<deactivation>
<!-- stuff similar to the activation section -->
</deactivation>
where the user can specify conditions that will deactivate the profile. Alternately, we could add an element to simply invert the activation logic...meaning the profile is active by default if this element is set, but anything triggered in the activation section will DEACTIVATE the profile...
I dunno which way we should go with this, but my feeling is that it might have to wait for 2.1.
do these two profiles have the same id? How is the profile in the POM triggered?
Can you provide a test case, so we know when this is fixed?