Java 类org.apache.maven.plugin.PluginManager 实例源码

项目:intellij-ce-playground    文件:MavenEmbedder.java   
@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;
}
项目:tools-idea    文件:MavenEmbedder.java   
@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;
}
项目:pkg-maven-plugin    文件:WagonUploaderTest.java   
@Test
public void testConstructor() throws Exception {
    Assert.assertEquals(expectedUrl,
            (String) getValueOfFieldInObject("url", wu));
    Assert.assertEquals(up.getLog(), (Log) getValueOfFieldInObject("l", wu));
    Assert.assertEquals(ws.getMojo().getProject(),
            (MavenProject) getValueOfFieldInObject("project", wu));
    Assert.assertEquals(ws.getMojo().getPluginManager(),
            (PluginManager) getValueOfFieldInObject("pluginManager", wu));
    Assert.assertEquals(ws.getMojo().getSession(),
            (MavenSession) getValueOfFieldInObject("session", wu));
    Assert.assertEquals(expectedPackageFile,
            (File) getValueOfFieldInObject("packageFile", wu));
}
项目:pkg-maven-plugin    文件:AbstractPackagingMojo.java   
public PluginManager getPluginManager() {
    return pluginManager;
}