com.atlassian.plugin.Plugin.getPluginArtifact()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中com.atlassian.plugin.Plugin.getPluginArtifact()方法的一些代码示例,展示了Plugin.getPluginArtifact()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.getPluginArtifact()方法的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
方法名:getPluginArtifact

Plugin.getPluginArtifact介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core

@Override
public ModuleDescriptor<?> createModule(final Plugin plugin, final Element module, final ModuleDescriptorFactory moduleDescriptorFactory) {
  if (plugin instanceof DefaultDynamicPlugin) {
    InputStream pluginDescriptor = null;
    try {
      final PluginArtifact pluginArtifact = plugin.getPluginArtifact();
      pluginDescriptor = pluginArtifact.getResourceAsStream(pluginDescriptorFileName);
      final DescriptorParser parser = descriptorParserFactory.getInstance(pluginDescriptor, ImmutableSet.of());
      return parser.addModule(moduleDescriptorFactory, plugin, module);
    } finally {
      IOUtils.closeQuietly(pluginDescriptor);
    }
  }
  return null;
}

代码示例来源:origin: com.atlassian.jira/jira-core

@PluginEventListener
public void onPluginUninstalledEvent(final PluginUninstalledEvent uninstalledEvent)
{
  final Plugin plugin = uninstalledEvent.getPlugin();
  final String pluginKey = plugin.getKey();
  log.debug(String.format("Plugin with key '%s' has been uninstalled.", pluginKey));
  pluginVersionStore.deleteByKey(pluginKey);
  // null indicates that the plugin is not artifact backed
  final PluginArtifact pluginArtifact = plugin.getPluginArtifact();
  if (pluginArtifact != null)
  {
    eventPublisher.publish(new JiraHomeChangeEvent(FILE_DELETED, PLUGIN,
        new File(pluginPath.getInstalledPluginsDirectory(),
            pluginArtifact.getName())));
  }
}

相关文章