geibi :
I'm working on an Eclipse plugin, and at a certain point I want to export a Java Project to a .jar-file. Eclipse does offer a functionality to do this (by right-click on project -> Export), but I don't know how to call it out of code.
Can someone help me out?
geibi :
Update: I found an working solution
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();