From bf5d38a186cc189168d4b58e0e3073a7c13ae01f Mon Sep 17 00:00:00 2001 From: Britton Isbell Date: Wed, 12 Nov 2008 17:31:07 +0000 Subject: [PATCH] Fix for IT 3827. On joins between model containers during the applying of plugin management, transform rule was reversing the plugin config element order. Now do a reverse sort prior to join, so elements end up in correct order. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@713429 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/project/builder/PomClassicTransformer.java | 4 +++- .../apache/maven/shared/model/ModelTransformerContext.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java index 1fd53ae968..aabd7fb316 100644 --- a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java +++ b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java @@ -184,7 +184,9 @@ public final class PomClassicTransformer ModelContainerAction action = dependencyContainer.containerAction( managementContainer ); if ( action.equals( ModelContainerAction.JOIN ) || action.equals( ModelContainerAction.DELETE ) ) { - source.join( dependencyContainer, managementContainer ); + ModelContainer reverseSortedContainer = new ArtifactModelContainerFactory().create( + ModelTransformerContext.sort(dependencyContainer.getProperties(), ProjectUri.Build.Plugins.Plugin.xUri) ); + source.join( reverseSortedContainer, managementContainer ); } } } diff --git a/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelTransformerContext.java b/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelTransformerContext.java index ef4abb7614..792af4b23b 100644 --- a/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelTransformerContext.java +++ b/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelTransformerContext.java @@ -340,7 +340,7 @@ public final class ModelTransformerContext * @param baseUri the base URI of every model property * @return sorted list of model properties */ - protected static List sort( List properties, String baseUri ) + public static List sort( List properties, String baseUri ) { if ( properties == null ) {