mirror of https://github.com/apache/maven.git
Forcing collision of plugin-execution id's in non-inherited, direct-goal invocation scenarios.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@191621 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bea9eca2f6
commit
7acd75ed8a
|
@ -243,13 +243,16 @@ public class DefaultMavenProjectBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
MavenProject project = assembleLineage( model, lineage, aggregatedRemoteWagonRepositories, localRepository );
|
MavenProject project = assembleLineage( model, lineage, aggregatedRemoteWagonRepositories, localRepository );
|
||||||
|
|
||||||
|
// we don't have to force the collision exception for superModel here, it's already been done in getSuperModel()
|
||||||
Model previous = superModel;
|
Model previous = superModel;
|
||||||
|
|
||||||
for ( Iterator i = lineage.iterator(); i.hasNext(); )
|
for ( Iterator i = lineage.iterator(); i.hasNext(); )
|
||||||
{
|
{
|
||||||
Model current = ( (MavenProject) i.next() ).getModel();
|
Model current = ( (MavenProject) i.next() ).getModel();
|
||||||
|
|
||||||
|
forcePluginExecutionIdCollision( current );
|
||||||
|
|
||||||
modelInheritanceAssembler.assembleModelInheritance( current, previous );
|
modelInheritanceAssembler.assembleModelInheritance( current, previous );
|
||||||
|
|
||||||
previous = current;
|
previous = current;
|
||||||
|
@ -266,6 +269,28 @@ public class DefaultMavenProjectBuilder
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void forcePluginExecutionIdCollision( Model model )
|
||||||
|
{
|
||||||
|
Build build = model.getBuild();
|
||||||
|
|
||||||
|
if ( build != null )
|
||||||
|
{
|
||||||
|
List plugins = build.getPlugins();
|
||||||
|
|
||||||
|
if ( plugins != null )
|
||||||
|
{
|
||||||
|
for ( Iterator it = plugins.iterator(); it.hasNext(); )
|
||||||
|
{
|
||||||
|
Plugin plugin = (Plugin) it.next();
|
||||||
|
|
||||||
|
// this will force an IllegalStateException, even if we don't have to do inheritance assembly.
|
||||||
|
plugin.getExecutionsAsMap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo can this take in a model instead of a project and still be successful?
|
* @todo can this take in a model instead of a project and still be successful?
|
||||||
* @todo In fact, does project REALLY need a MavenProject as a parent? Couldn't it have just a wrapper around a
|
* @todo In fact, does project REALLY need a MavenProject as a parent? Couldn't it have just a wrapper around a
|
||||||
|
@ -541,7 +566,11 @@ public class DefaultMavenProjectBuilder
|
||||||
{
|
{
|
||||||
URL url = DefaultMavenProjectBuilder.class.getResource( "pom-" + MAVEN_MODEL_VERSION + ".xml" );
|
URL url = DefaultMavenProjectBuilder.class.getResource( "pom-" + MAVEN_MODEL_VERSION + ".xml" );
|
||||||
|
|
||||||
return readModel( url );
|
Model superModel = readModel( url );
|
||||||
|
|
||||||
|
forcePluginExecutionIdCollision( superModel );
|
||||||
|
|
||||||
|
return superModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void contextualize( Context context )
|
public void contextualize( Context context )
|
||||||
|
|
Loading…
Reference in New Issue