mirror of https://github.com/apache/maven.git
Fixing CI. Had to move the addPlugin(..) call back to its original spot, and expose a new method in MavenProject to inject PluginManagement info to a Plugin instance that's passed in as a parameter.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@344294 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
adefb99e33
commit
eb1651be3c
|
@ -1351,15 +1351,17 @@ public class DefaultLifecycleExecutor
|
|||
throw new BuildFailureException( message );
|
||||
}
|
||||
|
||||
// this has been simplified from the old code that injected the plugin management stuff, since
|
||||
// pluginManagement injection is now handled by the project method.
|
||||
project.addPlugin( plugin );
|
||||
project.injectPluginManagementInfo( plugin );
|
||||
|
||||
if ( pluginDescriptor == null )
|
||||
{
|
||||
pluginDescriptor = verifyPlugin( plugin, project, session.getSettings(), session.getLocalRepository() );
|
||||
}
|
||||
|
||||
// this has been simplified from the old code that injected the plugin management stuff, since
|
||||
// pluginManagement injection is now handled by the project method.
|
||||
project.addPlugin( plugin );
|
||||
|
||||
MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( goal );
|
||||
if ( mojoDescriptor == null )
|
||||
{
|
||||
|
|
|
@ -917,7 +917,7 @@ public class MavenProject
|
|||
{
|
||||
if ( buildOverlay == null )
|
||||
{
|
||||
buildOverlay = new BuildOverlay( model.getBuild() );
|
||||
buildOverlay = new BuildOverlay( getModelBuild() );
|
||||
}
|
||||
|
||||
return buildOverlay;
|
||||
|
@ -1113,7 +1113,7 @@ public class MavenProject
|
|||
return pluginMgmt;
|
||||
}
|
||||
|
||||
public void addPlugin( Plugin plugin )
|
||||
private Build getModelBuild()
|
||||
{
|
||||
Build build = model.getBuild();
|
||||
|
||||
|
@ -1124,9 +1124,25 @@ public class MavenProject
|
|||
model.setBuild( build );
|
||||
}
|
||||
|
||||
return build;
|
||||
}
|
||||
|
||||
public void addPlugin( Plugin plugin )
|
||||
{
|
||||
Build build = getModelBuild();
|
||||
|
||||
if ( !build.getPluginsAsMap().containsKey( plugin.getKey() ) )
|
||||
{
|
||||
PluginManagement pm = build.getPluginManagement();
|
||||
injectPluginManagementInfo( plugin );
|
||||
|
||||
build.addPlugin( plugin );
|
||||
build.flushPluginMap();
|
||||
}
|
||||
}
|
||||
|
||||
public void injectPluginManagementInfo( Plugin plugin )
|
||||
{
|
||||
PluginManagement pm = getModelBuild().getPluginManagement();
|
||||
|
||||
if ( pm != null )
|
||||
{
|
||||
|
@ -1140,11 +1156,6 @@ public class MavenProject
|
|||
|
||||
ModelUtils.mergePluginDefinitions( plugin, pmPlugin, false );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
build.addPlugin( plugin );
|
||||
build.flushPluginMap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue