Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4
-
Fix Version/s: 2.0.5
-
Component/s: Reactor and workspace
-
Labels:None
-
Environment:all
-
Complexity:Intermediate
-
Number of attachments :
Description
The order in which profiles are activated is currently random.
Say you have two profiles:
<profile>
<id>default</id>
<properties>
<test>DEFAULT</test>
</properties>
</profile>
<profile>
<id>override</id>
<properties>
<test>OVERRIDE</test>
</properties>
</profile>
and you run
mvn projecthelp:effective-pom -Pdefault,override
on any pom, then then <properties> section at the bottom will
probably show
<test>DEFAULT</test>
.
The same happens if you specify '<activeProfiles><activeProfile>default</..></..>' and run with 'mvn -Poverride'.
This breaks overriding settings since the merge order is random because DefaultProfileManager uses
a HashMap to add active profiles, and HashMap iterators are random.
Proposed fix is to use a LinkedHashMap.
Fixed in trunk revision 408021.
Merged in 2.0.x branch in revision 408023.