diff --git a/maven-project-builder/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java b/maven-project-builder/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java index 49196e4677..b045272b9e 100644 --- a/maven-project-builder/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java +++ b/maven-project-builder/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java @@ -38,10 +38,11 @@ public final class ArtifactModelContainerFactory ProjectUri.DependencyManagement.Dependencies.Dependency.xUri, ProjectUri.Dependencies.Dependency.xUri, ProjectUri.Reporting.Plugins.Plugin.xUri, ProjectUri.Build.PluginManagement.Plugins.Plugin.xUri, - ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.xUri, + //ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.xUri, - ProjectUri.Build.Plugins.Plugin.xUri, ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.xUri, - ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.Exclusions.Exclusion.xUri, + ProjectUri.Build.Plugins.Plugin.xUri, + //ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.xUri, + // ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.Exclusions.Exclusion.xUri, ProjectUri.Build.Extensions.Extension.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 3e2d099539..c5b1da3acc 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 @@ -67,6 +67,17 @@ public class PomConstructionTest assertModelEquals( tester, "child-descriptor", "build/plugins[1]/executions[1]/goals[1]" ); } + public void testTwoPluginsWithDependencies() + throws Exception + { + File pomFile = new File( testDirectory, "single-test-poms/pluginDependencies.xml" ); + PomArtifactResolver resolver = artifactResolver( "single-test-poms" ); + PomClassicDomainModel model = projectBuilder.buildModel( pomFile, null, resolver ); + PomTestWrapper pom = new PomTestWrapper( model ); + List dependencies = (List) pom.getValue( "build/plugins[1]/dependencies" ); + assertEquals( 1, dependencies.size() ); + } + private PomArtifactResolver artifactResolver( String basedir ) { PomArtifactResolver resolver = new FileBasedPomArtifactResolver( new File( BASE_POM_DIR, basedir ) ); diff --git a/maven-project/src/test/resources-project-builder/single-test-poms/pluginDependencies.xml b/maven-project/src/test/resources-project-builder/single-test-poms/pluginDependencies.xml new file mode 100644 index 0000000000..5a1bba6e07 --- /dev/null +++ b/maven-project/src/test/resources-project-builder/single-test-poms/pluginDependencies.xml @@ -0,0 +1,33 @@ + + 4.0.0 + org.sonatype.nexus + nexus-configuration + 1.0 + + + + org.codehaus.modello + modello-maven-plugin + + + commons-collections + commons-collections + 3.2 + + + + + org.sonatype.plugins + modello-plugin-upgrade + 0.0.1-SNAPSHOT + + + commons-collections + commons-collections + 3.2 + + + + + +