o Fixed plugin validator to consider only the first plugin descriptor

git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@778142 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-05-24 13:17:47 +00:00
parent fa03325f35
commit 9f4dcc0c53
1 changed files with 12 additions and 0 deletions

View File

@ -27,6 +27,8 @@ public class MavenPluginValidator
private List<String> errors = new ArrayList<String>();
private boolean firstDescriptor = true;
public MavenPluginValidator( Artifact pluginArtifact )
{
this.pluginArtifact = pluginArtifact;
@ -34,6 +36,16 @@ public class MavenPluginValidator
public void validate( PluginDescriptor pluginDescriptor )
{
/*
* NOTE: For plugins that depend on other plugin artifacts the plugin realm contains more than one plugin
* descriptor. However, only the first descriptor is of interest.
*/
if ( !firstDescriptor )
{
return;
}
firstDescriptor = false;
if ( !pluginArtifact.getGroupId().equals( pluginDescriptor.getGroupId() ) )
{
errors.add( "Plugin's descriptor contains the wrong group ID: " + pluginDescriptor.getGroupId() );