[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [equinox-dev] Two bundles contributing to one package?

Thanks everyone.  I got it working!

 

Our use case is the obvious:  Porting legacy code that has some bad packaging decisions.  We can make most of the package stand-alone, but there are pieces of the package that pull in *lots* of dependencies which we basically don’t want most of the time!

 

John Wells (Aziz)

jwells@xxxxxxxxxxxxx

 


From: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of Jeff McAffer
Sent: Thursday, April 06, 2006 8:58 AM
To: Equinox development mailing list
Subject: Re: [equinox-dev] Two bundles contributing to one package?

 


Just a followup here.  You can (and we do) use Require-Bundle to join splits and then export the package.  This allows people to use Import-Package and get the union of the different splits.  The trick there is to use mandatory attributes to differentiate the various exports.  See
        https://bugs.eclipse.org/bugs/show_bug.cgi?id=134083
for a discussion of what we are doing with the org.eclipse.core.runtime package

Jeff



"Neil Bartlett" <neil@xxxxxxxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

04/06/2006 08:37 AM

Please respond to
Equinox development mailing list

To

"Equinox development mailing list" <equinox-dev@xxxxxxxxxxx>

cc

 

Subject

Re: [equinox-dev] Two bundles contributing to one package?

 

 

 




> Can I have two bundles which contribute to a single package?

Yes, but you have to use Require-Bundle, not Import-Package. See
section 3.13.1 in the OSGi R4 core spec:

"Import-Package takes priority over Require-Bundle, and packages which
are exported by a
required bundle and imported via Import-Package must NOT be treated as
split packages."

Section 3.13.2 goes on to say that split packages are a bad idea in general.

- Neil


On 4/6/06, John Wells <jwells@xxxxxxx> wrote:
> Can I have two bundles which contribute to a single package?
>
> In other words, can I have:
>
> 1.  A bundle A that exports package com.foo with class A
> 2.  A bundle B that exports package com.foo with class B
> 3.  Have a bundle C that imports com.foo and gets access to both A and B
>
> ?
>
> It doesn't seem like I can do this...
>
> I've tried the following:
>
> In BundleA I had the following:
>
> Export-Package: com.foo;name=A
>
> In BundleB I had the following:
>
> Import-Package: com.foo;name=A
> Export-Package: com.foo;name=B
>
> In BundleC I have the following:
>
> Import-Package: com.foo;name=B
>
> Bundle C does not resolve!?!
>
> John Wells (Aziz)
> jwells@xxxxxxxxxxxxx
> _______________________________________________________________________
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>


--
Neil Bartlett
Senior Technical Consultant, Integility Ltd
Tel: +44 (0) 20 7043 8328
Fax: +44 (0) 20 7043 8329

LinkedIn Profile: https://www.linkedin.com/in/neilbartlett
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.