[MNG-6114] Profiles from the global settings should be ordered before profiles 
from the user settings.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/f4ac51d3
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f4ac51d3
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f4ac51d3

Branch: refs/heads/MNG-6114
Commit: f4ac51d3fbdd65d68af9da3666298b5d54a0cf1b
Parents: a3cdfbb
Author: Christian Schulte <schu...@apache.org>
Authored: Sat Nov 12 21:06:19 2016 +0100
Committer: Christian Schulte <schu...@apache.org>
Committed: Tue Jan 31 22:54:14 2017 +0100

----------------------------------------------------------------------
 .../org/apache/maven/settings/merge/MavenSettingsMerger.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/f4ac51d3/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java
----------------------------------------------------------------------
diff --git 
a/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java
 
b/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java
index 8d9f67b..cb5f6c1 100644
--- 
a/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java
+++ 
b/maven-settings-builder/src/main/java/org/apache/maven/settings/merge/MavenSettingsMerger.java
@@ -111,6 +111,7 @@ public class MavenSettingsMerger
                                                                        String 
recessiveSourceLevel )
     {
         Map<String, T> dominantById = mapById( dominant );
+        final List<T> identifiables = new ArrayList<>( recessive.size() );
 
         for ( T identifiable : recessive )
         {
@@ -118,9 +119,11 @@ public class MavenSettingsMerger
             {
                 identifiable.setSourceLevel( recessiveSourceLevel );
 
-                dominant.add( identifiable );
+                identifiables.add( identifiable );
             }
         }
+
+        dominant.addAll( 0, identifiables );
     }
 
     /**

Reply via email to