public PlexusConfiguration getConfiguration( ComponentDescriptor componentDescriptor ) { if ( componentDescriptor.hasConfiguration() ) { return componentDescriptor.getConfiguration(); } return null; } }
overrideDom = Xpp3DomBuilder.build( new StringReader( override.getConfiguration().toString() ) ); if ( target.getConfiguration() != null ) targetDom = Xpp3DomBuilder.build( new StringReader( target.getConfiguration().toString() ) );
public void execute( Object object, ComponentManager manager, ClassRealm lookupRealm ) throws PhaseExecutionException { if ( object instanceof Configurable ) { try { ( (Configurable) object ).configure( manager.getComponentDescriptor().getConfiguration() ); } catch ( PlexusConfigurationException e ) { throw new PhaseExecutionException( "Error occurred during phase execution", e ); } } } }
public PlexusConfiguration getConfiguration( ComponentDescriptor componentDescriptor ) { if ( componentDescriptor.hasConfiguration() ) { return componentDescriptor.getConfiguration(); } return null; } }
PlexusConfiguration configuration = descriptor.getConfiguration(); if (configuration != null) { for (String name : configuration.getAttributeNames()) {
public void customize(PlexusContainer plexusContainer) { //MEVENIDE-634 ComponentDescriptor desc = plexusContainer.getComponentDescriptor(KnownHostsProvider.ROLE, "file"); //NOI18N desc.getConfiguration().getChild("hostKeyChecking").setValue("no"); //NOI18N //MEVENIDE-634 desc = plexusContainer.getComponentDescriptor(KnownHostsProvider.ROLE, "null"); //NOI18N desc.getConfiguration().getChild("hostKeyChecking").setValue("no"); //NOI18N } });
overrideDom = Xpp3DomBuilder.build( new StringReader( override.getConfiguration().toString() ) ); if ( target.getConfiguration() != null ) targetDom = Xpp3DomBuilder.build( new StringReader( target.getConfiguration().toString() ) );
public void execute( Object object, ComponentManager manager, ClassRealm lookupRealm ) throws PhaseExecutionException { if ( object instanceof Configurable ) { try { ( (Configurable) object ).configure( manager.getComponentDescriptor().getConfiguration() ); } catch ( PlexusConfigurationException e ) { throw new PhaseExecutionException( "Error occurred during phase execution", e ); } } } }
protected void addChildConfiguration(final ComponentDescriptor<?> component, final PlexusConfiguration config) { // assert component != null; // assert config != null; if (!component.hasConfiguration()) { component.setConfiguration(new XmlPlexusConfiguration("configuration")); } component.getConfiguration().addChild(config); }
public void customize(PlexusContainer plexusContainer) { ComponentDescriptor desc = plexusContainer.getComponentDescriptor(ArtifactFactory.ROLE); desc.setImplementation(NbArtifactFactory.class.getName()); //NOI18N desc = plexusContainer.getComponentDescriptor("org.apache.maven.extension.ExtensionManager"); desc.setImplementation(NbExtensionManager.class.getName()); //NOI18N desc = plexusContainer.getComponentDescriptor("org.apache.maven.workspace.MavenWorkspaceStore"); desc.setImplementation(NbMavenWorkspaceStore.class.getName()); //NOI18N desc = plexusContainer.getComponentDescriptor(ArtifactResolver.ROLE); desc.setImplementation(NbArtifactResolver.class.getName()); //NOI18N desc = plexusContainer.getComponentDescriptor(WagonManager.ROLE); desc.setImplementation(NbWagonManager.class.getName()); //NOI18N //MEVENIDE-634 desc = plexusContainer.getComponentDescriptor(KnownHostsProvider.ROLE, "file"); //NOI18N desc.getConfiguration().getChild("hostKeyChecking").setValue("no"); //NOI18N //MEVENIDE-634 desc = plexusContainer.getComponentDescriptor(KnownHostsProvider.ROLE, "null"); //NOI18N desc.getConfiguration().getChild("hostKeyChecking").setValue("no"); //NOI18N } });
public void customize(PlexusContainer plexusContainer) { //have custom lifecycle executor to collect all projects in reactor.. ComponentDescriptor desc = plexusContainer.getComponentDescriptor(LifecycleExecutor.ROLE); desc.setImplementation(MyLifecycleExecutor.class.getName()); //NOI18N try { PlexusConfiguration oldConf = desc.getConfiguration(); XmlPlexusConfiguration conf = new XmlPlexusConfiguration(oldConf.getName()); copyConfig(oldConf, conf); desc.setConfiguration(conf); } catch (PlexusConfigurationException ex) { ex.printStackTrace(); } desc = plexusContainer.getComponentDescriptor(BuildPlanner.class.getName()); desc.setImplementation(NBBuildPlanner.class.getName()); //NOI18N try { PlexusConfiguration oldConf = desc.getConfiguration(); XmlPlexusConfiguration conf = new XmlPlexusConfiguration(oldConf.getName()); copyConfig(oldConf, conf); desc.setConfiguration(conf); } catch (PlexusConfigurationException ex) { ex.printStackTrace(); } } });
public List getLifecyclePhases() throws MavenEmbedderException { List phases = new ArrayList(); ComponentDescriptor descriptor = embedder.getContainer().getComponentDescriptor( LifecycleExecutor.ROLE ); PlexusConfiguration configuration = descriptor.getConfiguration(); PlexusConfiguration[] phasesConfigurations = configuration.getChild( "lifecycles" ).getChild( 0 ).getChild( "phases" ).getChildren( "phase" ); try { for ( int i = 0; i < phasesConfigurations.length; i++ ) { phases.add( phasesConfigurations[i].getValue() ); } } catch ( PlexusConfigurationException e ) { throw new MavenEmbedderException( "Cannot retrieve default lifecycle phasesConfigurations.", e ); } return phases; }
public void customize(PlexusContainer plexusContainer) { try { ComponentDescriptor desc = new ComponentDescriptor(); desc.setRole(TransferListener.class.getName()); plexusContainer.addComponentDescriptor(desc); desc.setImplementation("org.codehaus.mevenide.netbeans.embedder.exec.ProgressTransferListener"); //NOI18N desc = plexusContainer.getComponentDescriptor(WagonManager.ROLE); ComponentRequirement requirement = new ComponentRequirement(); requirement.setRole(TransferListener.class.getName()); desc.addRequirement(requirement); //MEVENIDE-634 desc = plexusContainer.getComponentDescriptor(KnownHostsProvider.ROLE, "file"); desc.getConfiguration().getChild("hostKeyChecking").setValue("no"); //MEVENIDE-634 desc = plexusContainer.getComponentDescriptor(KnownHostsProvider.ROLE, "null"); desc.getConfiguration().getChild("hostKeyChecking").setValue("no"); } catch (ComponentRepositoryException ex) { ex.printStackTrace(); } } });
private void writeComponents( XMLWriter w, List componentDescriptors ) throws ComponentDescriptorCreatorException, PlexusConfigurationException { w.startElement( "components" ); for ( Iterator i = componentDescriptors.iterator(); i.hasNext(); ) { w.startElement( "component" ); ComponentDescriptor cd = (ComponentDescriptor) i.next(); element( w, "role", cd.getRole() ); element( w, "role-hint", cd.getRoleHint() ); element( w, "implementation", cd.getImplementation() ); element( w, "instantiation-strategy", cd.getInstantiationStrategy() ); element( w, "lifecycle-handler", cd.getLifecycleHandler() ); writeRequirements( w, cd.getRequirements() ); writeConfiguration( w, cd.getConfiguration() ); w.endElement(); } w.endElement(); }
"Duplicate component found, merging:" + "\n Original: " + orig.getRealmId() + ": " + orig.getRole() + " [" + orig.getRoleHint() + "] impl=" + orig.getImplementation() + "\n Config: " + orig.getConfiguration() + "\n New: " + componentDescriptor.getRealmId() + ": " + componentDescriptor.getRole() + " [" + orig.getRoleHint() + "] impl=" + componentDescriptor.getImplementation() + "\n Config: " + orig.getConfiguration() ); + orig.getRealmId() + ": " + orig.getRole() + " [" + orig.getRoleHint() + "] impl=" + orig.getImplementation() + "\n Config: " + orig.getConfiguration() + "\n New: " + componentDescriptor.getRealmId() + ": " + componentDescriptor.getRole() + " [" + orig.getRoleHint() + "] impl=" + componentDescriptor.getImplementation() + "\n Config: " + orig.getConfiguration() );
desc.setImplementation("org.codehaus.mevenide.netbeans.embedder.exec.MyLifecycleExecutor"); //NOI18N try { PlexusConfiguration oldConf = desc.getConfiguration(); XmlPlexusConfiguration conf = new XmlPlexusConfiguration(oldConf.getName()); copyConfig(oldConf, conf); desc.setImplementation("org.codehaus.mevenide.netbeans.embedder.exec.NBBuildPlanner"); //NOI18N try { PlexusConfiguration oldConf = desc.getConfiguration(); XmlPlexusConfiguration conf = new XmlPlexusConfiguration(oldConf.getName()); copyConfig(oldConf, conf);
manager.getComponentDescriptor().getConfiguration(), new ServletExpressionEvaluator( servletContext ), realm );
desc.getConfiguration().getChild("hostKeyChecking").setValue("no"); desc.getConfiguration().getChild("hostKeyChecking").setValue("no");
writeConfiguration( w, cd.getConfiguration() );
PlexusConfiguration configuration = descriptor.getConfiguration(); if (configuration != null) { for (String name : configuration.getAttributeNames()) {