Fix: there was a problem with pom construction if there were two or more plugins with dependencies elements.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@727855 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2008-12-18 23:35:31 +00:00
parent 77c278e5d1
commit e24f7564f7
3 changed files with 48 additions and 3 deletions

View File

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

View File

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

View File

@ -0,0 +1,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sonatype.nexus</groupId>
<artifactId>nexus-configuration</artifactId>
<version>1.0</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>modello-plugin-upgrade</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>