Details
Description
Having multiple profile activation conditions behaves in an unexpected manner. It doesn't cause a build failure, but the actual algorithm for activating a profile is very different from expected. My expectation was that if you include multiple conditions, they are ANDed together. However what appears to happen is that the conditions overwrite each other.
If an <os> condition is added, it overrides any <property> or <file> conditions regardless of their results.
If a <file> condition is added, it overrides any <property> condition regardless of results
The following table gives a sample of conditions matched, and whether the profile was activated as a result:
Property File OS Result Expected
T T - T T
T F - F F
F T - T F
F F - F F
T - T T T
T - F F F
F - T T F
F - F F F
F F T T F
T T F F F
Issue Links
- is related to
-
MNG-4516
Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
-
-
MNG-1753
support improved property based profile activation
-
- relates to
-
MNG-4565
Multiple profile activation conditions does not work
-
-
MNG-4225
Plugin dependencies are incorrectly included as needed artifacts in IBM JDK 1.5 sr8 and IBM JDK 1.6
-
-
MNG-1753
support improved property based profile activation
-
-
MNG-3328
Allow multiple profile activation properties.
-
If the intention is that multiple conditions are not supported currently for maven activation, it would be much better to fail with an error message rather than current behaviour.