private MojoExecutionConfigurator mojoExecutionConfigurator( MojoExecution mojoExecution ) { String configuratorId = mojoExecution.getMojoDescriptor().getComponentConfigurator(); if ( configuratorId == null ) { configuratorId = "default"; } MojoExecutionConfigurator mojoExecutionConfigurator = mojoExecutionConfigurators.get( configuratorId ); if ( mojoExecutionConfigurator == null ) { // // The plugin has a custom component configurator but does not have a custom mojo execution configurator // so fall back to the default mojo execution configurator. // mojoExecutionConfigurator = mojoExecutionConfigurators.get( "default" ); } return mojoExecutionConfigurator; } }
String configuratorId = mojoDescriptor.getComponentConfigurator();
if ( mojoDescriptor.getComponentConfigurator() != null ) configurator = getContainer().lookup( ComponentConfigurator.class, mojoDescriptor.getComponentConfigurator() );
private MojoExecutionConfigurator mojoExecutionConfigurator(MojoExecution mojoExecution) throws Exception { String configuratorId = mojoExecution.getMojoDescriptor().getComponentConfigurator(); if (configuratorId == null) { configuratorId = "default"; } return container.lookup(MojoExecutionConfigurator.class, configuratorId); }
@Override public Mojo lookupConfiguredMojo(MavenSession session, MojoExecution execution) throws Exception { MavenProject project = session.getCurrentProject(); MojoDescriptor mojoDescriptor = execution.getMojoDescriptor(); Mojo mojo = container.lookup(Mojo.class, mojoDescriptor.getRoleHint()); ExpressionEvaluator evaluator = new PluginParameterExpressionEvaluator(session, execution); mojoExecutionConfigurator(execution).configure(project, execution, true); finalizeMojoConfiguration(execution); PlexusConfiguration mojoConfiguration = new XmlPlexusConfiguration(execution.getConfiguration()); String configuratorHint = "basic"; if (mojoDescriptor.getComponentConfigurator() != null) { configuratorHint = mojoDescriptor.getComponentConfigurator(); } ComponentConfigurator configurator = container.lookup(ComponentConfigurator.class, configuratorHint); configurator.configureComponent(mojo, mojoConfiguration, evaluator, container.getContainerRealm()); return mojo; }
@Override public Mojo lookupConfiguredMojo(MavenSession session, MojoExecution execution) throws Exception { MavenProject project = session.getCurrentProject(); MojoDescriptor mojoDescriptor = execution.getMojoDescriptor(); Mojo mojo = container.lookup(Mojo.class, mojoDescriptor.getRoleHint()); ExpressionEvaluator evaluator = new PluginParameterExpressionEvaluator(session, execution); Xpp3Dom configuration = null; Plugin plugin = project.getPlugin(mojoDescriptor.getPluginDescriptor().getPluginLookupKey()); if (plugin != null) { configuration = (Xpp3Dom) plugin.getConfiguration(); } if (configuration == null) { configuration = new Xpp3Dom("configuration"); } configuration = Xpp3Dom.mergeXpp3Dom(configuration, execution.getConfiguration()); execution.setConfiguration(configuration); finalizeMojoConfiguration(execution); PlexusConfiguration pluginConfiguration = new XmlPlexusConfiguration(execution.getConfiguration()); String configuratorHint = "basic"; if (mojoDescriptor.getComponentConfigurator() != null) { configuratorHint = mojoDescriptor.getComponentConfigurator(); } ComponentConfigurator configurator = container.lookup(ComponentConfigurator.class, configuratorHint); configurator.configureComponent(mojo, pluginConfiguration, evaluator, container.getContainerRealm()); return mojo; }
if ( StringUtils.isNotEmpty( mojoDescriptor.getComponentConfigurator() ) ) w.writeText( mojoDescriptor.getComponentConfigurator() ); w.endElement();
if ( mojoDescriptor.getComponentConfigurator() != null ) w.writeText( mojoDescriptor.getComponentConfigurator() ); w.endElement();
if ( mojoDescriptor.getComponentConfigurator() != null ) w.writeText( mojoDescriptor.getComponentConfigurator() ); w.endElement();
result.setImplementation(mojo.getImplementation()); result.setLanguage(mojo.getLanguage()); result.setConfigurator(mojo.getComponentConfigurator()); result.setInstantiationStrategy(mojo.getInstantiationStrategy()); result.setExecutionStrategy(mojo.getExecutionStrategy());
result.setImplementation(mojo.getImplementation()); result.setLanguage(mojo.getLanguage()); result.setConfigurator(mojo.getComponentConfigurator()); result.setInstantiationStrategy(mojo.getInstantiationStrategy()); result.setExecutionStrategy(mojo.getExecutionStrategy());