Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] How to ensure that "import-package" results in getting packages only from bundles specified in "require-bundle"?

On 5/4/16, 5:21 PM, "tycho-user-bounces@xxxxxxxxxxx on behalf of David M.
Karr" <tycho-user-bounces@xxxxxxxxxxx on behalf of
davidmichaelkarr@xxxxxxxxx> wrote:

>On 05/04/2016 01:58 PM, Tom Bryan (tombry) wrote:
>> Require-Bundle and Import-Package serve the same purpose in different
>> ways.
>>
>> Require-Bundle specifies that the current plug-in depends on those
>> specific bundles.  At runtime, if it doesn't find those bundles, it will
>> fail to load.  Eclipse makes those bundles (and any of their exported
>> packages) available to your plug-in.


>I this this is telling me that I really have no choice but to directly
>embed the antlr jar (using "maven-dependency-plugin") into each plugin
>that requires those classes (fortunately, it does appear that only one
>of my plugins requires those classes).  I am assuming that if a class in
>a bundle is looking for a class, if it finds it in the same bundle
>(albeit referenced by "Build-Classpath"), it will not attempt to resolve
>those classes in any other bundle?
>
>Version constraints won't help me, as the checkstyle bundle is packaging
>the same version of antlr that I need.


No, in that case, just remove the Import-Package statements for antlr.
Specify your own bundle that provides antlr using Require-Bundle, and I
think you should be fine.  (My project does something similar with other
third party libraries.  I has never been a problem for our RCP.)

---Tom



Back to the top