[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/6d17c079 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/6d17c079 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/6d17c079 Branch: refs/heads/MNG-6114 Commit: 6d17c0796c751f723c0e748d3fa8bb4df893ff59 Parents: 34afec6 Author: Christian Schulte <schu...@apache.org> Authored: Sat Nov 12 21:06:19 2016 +0100 Committer: Christian Schulte <schu...@apache.org> Committed: Wed Mar 8 19:43: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/6d17c079/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 ); } /**