【问题标题】:Is there a way to programatically start eclipse export function有没有办法以编程方式启动 eclipse 导出功能
【发布时间】:2019-11-22 00:37:28
【问题描述】:

我正在开发一个 Eclipse 插件,并且在某个时候我想将一个 Java 项目导出到一个 .jar 文件。 Eclipse 确实提供了执行此操作的功能(通过右键单击项目-> 导出),但我不知道如何从代码中调用它。

谁能帮帮我?

【问题讨论】:

  • 您是否尝试过使用 Maven 等构建工具?

标签: java eclipse jar eclipse-plugin export


【解决方案1】:

更新:我找到了一个可行的解决方案

FeatureExportInfo info = new FeatureExportInfo();
info.useJarFormat = true;
info.items = bundlesToExport.toArray(); //bundlesToExport is a ArrayList<IModel>
PluginExportOperation exportJob = new PluginExportOperation(info, "Export selected bundles");
exportJob.setUser(true);
exportJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
exportJob.schedule();

【讨论】:

    猜你喜欢
    • 2021-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多