public void customizeComponents() throws RemoteException { // replace some plexus components myContainer.addComponent(getComponent(ArtifactFactory.class, "ide"), ArtifactFactory.ROLE); myContainer.addComponent(getComponent(ArtifactResolver.class, "ide"), ArtifactResolver.ROLE); myContainer.addComponent(getComponent(RepositoryMetadataManager.class, "ide"), RepositoryMetadataManager.class.getName()); myContainer.addComponent(getComponent(PluginDescriptorCache.class, "ide"), PluginDescriptorCache.class.getName()); myContainer.addComponent(getComponent(ModelInterpolator.class, "ide"), ModelInterpolator.class.getName()); myContainer.addComponent(getComponent(org.apache.maven.project.interpolation.ModelInterpolator.class, "ide"), org.apache.maven.project.interpolation.ModelInterpolator.ROLE); }
public synchronized PluginDescriptor getPluginDescriptor( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ) throws PluginResolutionException, PluginDescriptorParsingException, InvalidPluginDescriptorException { PluginDescriptorCache.Key cacheKey = pluginDescriptorCache.createKey( plugin, repositories, session ); PluginDescriptor pluginDescriptor = pluginDescriptorCache.get( cacheKey ); if ( pluginDescriptor == null ) { org.sonatype.aether.artifact.Artifact artifact = pluginDependenciesResolver.resolve( plugin, repositories, session ); Artifact pluginArtifact = RepositoryUtils.toArtifact( artifact ); pluginDescriptor = extractPluginDescriptor( pluginArtifact, plugin ); pluginDescriptor.setRequiredMavenVersion( artifact.getProperty( "requiredMavenVersion", null ) ); pluginDescriptorCache.put( cacheKey, pluginDescriptor ); } pluginDescriptor.setPlugin( plugin ); return pluginDescriptor; }