[MNG-7438] add execution id to "configuring mojo" debug message

[DEBUG] Configuring mojo execution
'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test:default-test'
with basic configurator

rephrase "Configuring" to "Loading" mojo "from plugin realm"
to differentiate from "configuring mojo" = apply configuration

rename populatePluginFields(..) private method
to populateMojoExecutionFields(..) to better match the intent
This commit is contained in:
Hervé Boutemy 2022-03-22 08:12:56 +01:00 committed by Hervé Boutemy
parent 1ad5a1b1e9
commit 3c6009cbf4
1 changed files with 8 additions and 6 deletions

View File

@ -515,7 +515,7 @@ public class DefaultMavenPluginManager
if ( logger.isDebugEnabled() )
{
logger.debug( "Configuring mojo " + mojoDescriptor.getId() + " from plugin realm " + pluginRealm );
logger.debug( "Loading mojo " + mojoDescriptor.getId() + " from plugin realm " + pluginRealm );
}
// We are forcing the use of the plugin realm for all lookups that might occur during
@ -609,7 +609,8 @@ public class DefaultMavenPluginManager
ExpressionEvaluator expressionEvaluator = new PluginParameterExpressionEvaluator( session, mojoExecution );
populatePluginFields( mojo, mojoDescriptor, pluginRealm, pomConfiguration, expressionEvaluator );
populateMojoExecutionFields( mojo, mojoExecution.getExecutionId(), mojoDescriptor, pluginRealm,
pomConfiguration, expressionEvaluator );
return mojo;
}
@ -620,8 +621,9 @@ public class DefaultMavenPluginManager
}
}
private void populatePluginFields( Object mojo, MojoDescriptor mojoDescriptor, ClassRealm pluginRealm,
PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator )
private void populateMojoExecutionFields( Object mojo, String executionId, MojoDescriptor mojoDescriptor,
ClassRealm pluginRealm, PlexusConfiguration configuration,
ExpressionEvaluator expressionEvaluator )
throws PluginConfigurationException
{
ComponentConfigurator configurator = null;
@ -644,8 +646,8 @@ public class DefaultMavenPluginManager
ValidatingConfigurationListener validator =
new ValidatingConfigurationListener( mojo, mojoDescriptor, listener, expressionEvaluator );
logger.debug(
"Configuring mojo '" + mojoDescriptor.getId() + "' with " + configuratorId + " configurator -->" );
logger.debug( "Configuring mojo execution '" + mojoDescriptor.getId() + ':' + executionId + "' with "
+ configuratorId + " configurator -->" );
configurator.configureComponent( mojo, configuration, expressionEvaluator, pluginRealm, validator );