Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Eclipse Add required plug-ins from adding fragments

I am working on RCP application which contains plug-ins(functionality) and fragments(tests) in Eclipse Luna. "Add required plug-in" adds plug-in with all its fragments even if fragment isn't necessary. How can I force eclipse to make absolute minimum with "add required plug-ins" action? (just adding plug-in without fragment)

Here is snippet of my Manifest:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: My Plugin
Bundle-SymbolicName: com.something.myplugin;singleton:=true
Bundle-Version: 1.0.0
Bundle-Vendor: XYZ
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-ExtensibleAPI: true
Require-Bundle:...
Export-Package:...
like image 287
Pavel Fencl Avatar asked Feb 12 '15 11:02

Pavel Fencl


People also ask

How do I create a fragment in Eclipse IDE?

The Eclipse IDE supports the creation of fragments via fragment projects . To create a fragment project select File New Other… Plug-in Development Fragment Project. 1.2. Typical use cases for fragments

What is a plug-in fragment?

- Eclipsepedia FAQ What is a plug-in fragment? FAQ What is a plug-in fragment? Sometimes it is useful to make part of a plug-in optional, allowing it to be installed, uninstalled, or updated independently from the rest of the plug-in.

How to install plug-ins in Eclipse?

In general, the best way to install plug-ins is to use the Eclipse Marketplace: From the main Eclipse menu, go to Help/Eclipse Marketplace… Search for the desired plugin and click the ” Install ” button.

What is fragment project in OSGi?

Using fragment projects 1.1. What are fragments in OSGi? A fragment is an optional attachment to another plug-in. This other plug-in is called the host plug-in . At runtime the fragment is merged with its host plug-in.


1 Answers

If dependencies are marked as "optional" you can uncheck the box "include optional dependencies when computing required plugins" to avoid including them.

Otherwise my workaround approach is to select appropriate plugins by hand (usually by deselecting them after "select required" action) then save the "run configuration" and share it on the source versioning system for reuse. Unfortunately this is not very resistant to platform changes, e.g. fragments appropriate for linux64 are not the same as win64 in my fragment examples. So name the configurations appropriately.

For tests, I've had some success automating deployment of eclipse + install of specific features using command-line, where with some scripting you can control the plugins and versions you are using with more ease than using the click-click gui.

Again this allows to build and store eclipse configurations in some reusable form. Debug is accomplished by checking out the projects you are debugging in the eclipse built from command line, then running a vanilla debug instance "all platform and workspace plugins". You do need JDT+debug components though, so for RCP I'm not sure how that would work.

Fragments are a pain, in my experience, consider using features if you can, the ui and p2 system deal with it much better.

like image 92
Yann TM Avatar answered Sep 28 '22 09:09

Yann TM