diff --git a/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java b/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java index 018613d4a0..72abaed782 100644 --- a/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java +++ b/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java @@ -206,11 +206,11 @@ public class PomTransformer { if(!mc.equals(mc1) && mc.containerAction(mc1).equals(ModelContainerAction.JOIN)) { - exclusionSource.joinWithOriginalOrder(mc, mc1); + exclusionSource.joinWithOriginalOrder(mc1, mc); } } } - + managementContainer = new ArtifactModelContainerFactory().create( transformDependencyManagement( exclusionSource.getModelProperties() ) ); ModelContainerAction action = dependencyContainer.containerAction( managementContainer ); diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java index d5b868a3c4..f7238f02d4 100644 --- a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java +++ b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java @@ -295,6 +295,8 @@ public final class PomClassicDomainModel //TODO: Should add all collections from ProjectUri s.addAll(PomTransformer.URIS); s.add(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.xUri); + s.add(ProjectUri.DependencyManagement.Dependencies.Dependency.Exclusions.xUri); + s.add(ProjectUri.Dependencies.Dependency.Exclusions.xUri); s.add(ProjectUri.Build.Plugins.Plugin.Executions.xUri); s.add(ProjectUri.Build.Plugins.Plugin.Executions.Execution.Goals.xURI); s.add(ProjectUri.Reporting.Plugins.Plugin.ReportSets.xUri); diff --git a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java index 1db1814ca9..7811ab1dc0 100644 --- a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java @@ -96,7 +96,6 @@ public class PomConstructionTest { PomTestWrapper pom = buildPom( "duplicate-exclusions-dependency/sub" ); assertEquals( 1, ( (List) pom.getValue( "dependencies[1]/exclusions" ) ).size() ); - System.out.println(pom.getDomainModel().asString()); }