Improving error reporting when execution id's collide.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@191669 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2005-06-21 15:36:00 +00:00
parent 6cd2e31078
commit 9dfc1f9962
1 changed files with 15 additions and 5 deletions

View File

@ -267,9 +267,11 @@ public class DefaultMavenProjectBuilder
for ( Iterator i = lineage.iterator(); i.hasNext(); )
{
Model current = ( (MavenProject) i.next() ).getModel();
MavenProject currentProject = (MavenProject) i.next();
Model current = currentProject.getModel();
forcePluginExecutionIdCollision( current );
forcePluginExecutionIdCollision( pomLocation, current );
modelInheritanceAssembler.assembleModelInheritance( current, previous );
@ -288,7 +290,8 @@ public class DefaultMavenProjectBuilder
return project;
}
private void forcePluginExecutionIdCollision( Model model )
private void forcePluginExecutionIdCollision( String pomLocation, Model model )
throws ProjectBuildingException
{
Build build = model.getBuild();
@ -303,7 +306,14 @@ public class DefaultMavenProjectBuilder
Plugin plugin = (Plugin) it.next();
// this will force an IllegalStateException, even if we don't have to do inheritance assembly.
plugin.getExecutionsAsMap();
try
{
plugin.getExecutionsAsMap();
}
catch ( IllegalStateException collisionException )
{
throw new ProjectBuildingException( "Detected illegal plugin-execution configuration in: " + pomLocation, collisionException );
}
}
}
}
@ -600,7 +610,7 @@ public class DefaultMavenProjectBuilder
Model superModel = readModel( url );
forcePluginExecutionIdCollision( superModel );
forcePluginExecutionIdCollision( "<super-POM>", superModel );
return superModel;
}