Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to package a library as an eclipse plugin for use by another plugin
    text
    copied!<p>I'm trying to build an Eclipse plugin that depends on a library which has to be distributed separate to it. The reasons for that are:</p> <ol> <li>It's a commercial library, while the plugin will be distributed freely. Also, most people won't need it and we don't want to confuse users.</li> <li>There are currently at least two versions of the library in use and we don't want to build two different versions of the plugin. The interface is compatible, so we can ship just one version of the plugin.</li> </ol> <p>The plugin is for an Eclipse-based development environment and the purpose is to provide our library's functionality within that environment. The library itself depends on other free components, which I can bundle with it without a problem.</p> <p>Since I don't know if I'm allowed to say exactly which library it is, but I must keep this unambiguous, let's call the library "L" and the plugin I'm trying to develop "P".</p> <p>I'm using the bnd tool for this and so far I've tried both packaging L as a standalone plugin, and as a plugin fragment.</p> <p>As a standalone plugin, it was accepted by the host eclipse environment and I could list it as a dependency of P and successfully build that. However, at runtime the P plugin didn't see resources from the L library on its classpath. Mainly those in META-INF/services are needed.</p> <p>Next, I tried packaging L as a plugin fragment for P. I hoped this would work, since the specs say, that a fragment's classpath is merged with its host plugin's. This didn't work, because I couldn't use the classes from L as build dependencies of P - putting L in eclipse's plugins directory didn't result in it being recognised as an installed plugin.</p> <p>So I'm stuck. I need L's jars as part of P's runtime and build classpath, while at the same time having them in a separate plugin. Is what I'm trying to do even possible?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload