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
This commit is contained in:
Britton Isbell 2008-11-12 17:31:07 +00:00
parent cac8f6eedf
commit bf5d38a186
2 changed files with 4 additions and 2 deletions

View File

@ -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 );
}
}
}

View File

@ -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<ModelProperty> sort( List<ModelProperty> properties, String baseUri )
public static List<ModelProperty> sort( List<ModelProperty> properties, String baseUri )
{
if ( properties == null )
{