use of org.apache.maven.plugin.PluginManager in project intellij-community by JetBrains.
the class MavenEmbedder method findArtifactTypeHandlers.
@SuppressWarnings({ "unchecked" })
private Map findArtifactTypeHandlers(MavenProject project) {
// end copied from DefaultLifecycleExecutor.findExtensions
Map result = new HashMap();
for (Object each : project.getBuildPlugins()) {
Plugin eachPlugin = (Plugin) each;
if (eachPlugin.isExtensions()) {
try {
PluginManager pluginManager = getComponent(PluginManager.class);
pluginManager.verifyPlugin(eachPlugin, project, mySettings, myLocalRepository);
result.putAll(pluginManager.getPluginComponents(eachPlugin, ArtifactHandler.ROLE));
} catch (Exception e) {
MavenEmbedderLog.LOG.info(e);
continue;
}
for (Object o : result.values()) {
ArtifactHandler handler = (ArtifactHandler) o;
if (project.getPackaging().equals(handler.getPackaging())) {
project.getArtifact().setArtifactHandler(handler);
}
}
}
}
return result;
}
Aggregations