Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4
-
None
-
all
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.