public void execute(Object object, ComponentManager manager, ClassRealm lookupRealm) throws PhaseExecutionException { try { ComponentDescriptor<?> descriptor = manager.getComponentDescriptor(); String configuratorId = descriptor.getComponentConfigurator(); if (StringUtils.isEmpty(configuratorId)) { configuratorId = DEFAULT_CONFIGURATOR_ID; } ComponentConfigurator componentConfigurator = manager.getContainer().lookup(ComponentConfigurator.class, configuratorId); PlexusConfiguration configuration = manager.getContainer().getConfigurationSource().getConfiguration(descriptor); if (configuration != null) { ClassRealm realm = manager.getRealm(); componentConfigurator.configureComponent(object, configuration, realm); } } catch (ComponentLookupException e) { throw new PhaseExecutionException( "Unable to auto-configure component as its configurator could not be found", e); } catch (ComponentConfigurationException e) { throw new PhaseExecutionException("Unable to auto-configure component", e); } }