use of org.codehaus.plexus.component.repository.ComponentDescriptor in project intellij-community by JetBrains.
the class MavenEmbedder method setImplementation.
public static <T> void setImplementation(PlexusContainer container, Class<T> componentClass, Class<? extends T> implementationClass) {
ComponentDescriptor d = container.getComponentDescriptor(componentClass.getName());
d.setImplementation(implementationClass.getName());
}
use of org.codehaus.plexus.component.repository.ComponentDescriptor in project intellij-community by JetBrains.
the class MavenServerEmbedderTest method _testResolvingProjectWithRegisteredExtensions.
public void _testResolvingProjectWithRegisteredExtensions() throws Exception {
ComponentDescriptor desc = new ComponentDescriptor();
desc.setRole(ArtifactHandler.ROLE);
desc.setRoleHint("foo");
desc.setImplementation(MyArtifactHandler.class.getName());
myEmbedderImpl.getContainer().addComponentDescriptor(desc);
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<dependencies>" + " <dependency>" + " <groupId>junit</groupId>" + " <artifactId>junit</artifactId>" + " <version>3.8.1</version>" + " <scope>test</scope>" + " <type>foo</type>" + " </dependency>" + "</dependencies>");
myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
MavenServerExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.<String>emptyList(), Collections.<String>emptyList());
assertNotNull(result.projectData);
assertOrderedElementsAreEqual(result.unresolvedArtifacts);
MavenModel p = result.projectData.mavenModel;
assertEquals(1, p.getDependencies().size());
assertEquals("pom", p.getDependencies().get(0).getExtension());
}
Aggregations