Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Resolution of packages containing "impl" in their names

I've forced maven-bundle-plugin to export all the packages with version 1.0.0.
I've also removed the "x-internal" directive. The relevant configuration MANIFEST configuration of the maven-bundle-plugin is just:

<!-- Include "impl" packages in the bundle -->
<Private-Package>
  org.bubblecloud.zigbee.api.cluster.impl,
  org.bubblecloud.zigbee.api.cluster.impl.*,
  org.bubblecloud.zigbee.network.impl,
  org.bubblecloud.zigbee.api.device.impl,
  org.bubblecloud.zigbee.network.impl
</Private-Package>
  <!-- By default "impl" packages are not added to the "Export-Package"
  header of the MANIFEST. Even if they are explicitly added, Eclipse refuses
  to resolve imports from other bundles unless "x-internal:=true" (Equinox
  specific) is specified -->
<Export-Package>
  {local-packages};version="1.0.0",
  org.bubblecloud.zigbee.api.cluster.impl;version="1.0.0",
  org.bubblecloud.zigbee.api.cluster.impl.*;version="1.0.0",
  org.bubblecloud.zigbee.network.impl;version="1.0.0",
  org.bubblecloud.zigbee.api.device.impl;version="1.0.0",
  org.bubblecloud.zigbee.network.impl;version="1.0.0"
</Export-Package>

The generated MANIFEST:

http://pastebin.com/5CSt7Vj0

I've removed "version" from the Import-Package header of the dependent bundle.

It does not make any difference.

Here's the tycho resolution debug log (mvn -X -Dtycho.debug.resolver=true):

http://pastebin.com/Fa0U1Nfp

Thanks!

On 21/12/2015 20:24, Dirk Fauth wrote:

From my experience using a qualifier in the versions in import package is causing troubles. What should the qualifier be resolved to when determining the version range?

You are complaining that other packages are resolved well with the SNAPSHOT qualifier in import  package. But have you tried to get rid of it for the import package statements? It should be ok for export package afaik, but for import package it doesn't make sense, since you specify the minimum requirement you need, and the qualifier (as it can be anything) contains no information that can be verified.

Am 21.12.2015 19:18 schrieb "De Alti, Cristiano" <Cristiano.DeAlti@xxxxxxxxxxxx>:
Thanks Lee,
  Please see below

On 21/12/2015 18:57, Lee Carver wrote:
Cristiano -

If you are trying to OSGi-ify a third-party library (TPL), I've had a lot of success with a "wrapper" jar that contains the raw TPL jar as an embedded member. 

One of the more complex examples is this OSGi bundling for JOGL:


By tweaking the Export-Package element, it is possible to expose all sort of internal packages.

I've already done this. The MANIFEST of the osgified library exports all I need.
The problem is with Tycho not resolving the packages containing the "impl" word in their names.
Let me know if you have any questions.

Thanks
- Lee

On Mon, Dec 21, 2015 at 2:35 AM, De Alti, Cristiano <Cristiano.DeAlti@xxxxxxxxxxxx> wrote:

Hello,

  Il looks like Tycho has problems resolving the imports from bundles exporting packages which contain "impl" in their names.

I understand that importing "impl" or "internal" packages is a bad idea and that other plugins (e.g. maven-bundle-plugin) by default don't export these packages but I'm trying to OSGi-fy an existing third party library and I need to import all of it's packages in another bundle.


Tycho complains (only) on these packages:


Resolution errors:
   Bundle org.eclipse.kura.protocol.zigbee - Missing Constraint: Import-Package: org.bubblecloud.zigbee.api.cluster.impl.api.core; version="2.0.3.SNAPSHOT"
   Bundle org.eclipse.kura.protocol.zigbee - Missing Constraint: Import-Package: org.bubblecloud.zigbee.network.impl; version="2.0.3.SNAPSHOT"


Note that the OSGi-fied library exports the packages in the MANIFEST, for example:


org.bubblecloud.zigbee.network.impl;x-internal:=false;version="2.0.3.SNAPSHOT"


I had to add the "x-internal:=false" to suppress Eclipse "Access restriction" errors.


The above happens with Tycho 0.20 and 0.24.


Is there something else I could try before giving up and embedding the third party jar to the lib/ directory of my bundle?


Is this behavior (filtering "impl" packages) documented anywhere?


Regards,

  Cristiano


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user

--
Cristiano De Alti
Principal Software Engineer

direct:    +39 0433 485468

EUROTECH
Imagine.Build.Succeed.
HEADQUARTERS
EUROTECH S.p.A. – Via Fratelli Solari, 3/a | 33020 Amaro UD | Italy | Tel. +39. 0433 485411  | Fax +39. 0433 485499 |
Cap. Soc. 8.878.946,00 € I.V. | P.IVA / C.F.: IT 01791330309 | REA Udine 196115
www.eurotech.com
____________________________________

Il presente messaggio ed ogni suo allegato sono da intendersi inviati esclusivamente agli effettivi destinatari e potrebbero essere soggetti a restrizioni legali. Se avete ricevuto questo messaggio per errore vi invitiamo a darne immediata notifica al mittente e cancellarlo dal vostro sistema. Qualsiasi altro uso di questo messaggio da parte vostra e' strettamente proibito.
 
This e-mail, and any file attached to it, is meant only for the intended recipient of the transmission and may be a communication privileged by law. If you have received it in error, please notify the sender immediately and delete the original from your system. Any other use of this e-mail by you is strictly forbidden.
____________________________________
 
Per favore, pensate all’ambiente prima di stampare questa e-mail. Please consider the environment before printing this e-mail.

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user

--
Cristiano De Alti
Principal Software Engineer

direct:    +39 0433 485468

EUROTECH
Imagine.Build.Succeed.
HEADQUARTERS
EUROTECH S.p.A. – Via Fratelli Solari, 3/a | 33020 Amaro UD | Italy | Tel. +39. 0433 485411  | Fax +39. 0433 485499 |
Cap. Soc. 8.878.946,00 € I.V. | P.IVA / C.F.: IT 01791330309 | REA Udine 196115
www.eurotech.com
____________________________________

Il presente messaggio ed ogni suo allegato sono da intendersi inviati esclusivamente agli effettivi destinatari e potrebbero essere soggetti a restrizioni legali. Se avete ricevuto questo messaggio per errore vi invitiamo a darne immediata notifica al mittente e cancellarlo dal vostro sistema. Qualsiasi altro uso di questo messaggio da parte vostra e' strettamente proibito.
 
This e-mail, and any file attached to it, is meant only for the intended recipient of the transmission and may be a communication privileged by law. If you have received it in error, please notify the sender immediately and delete the original from your system. Any other use of this e-mail by you is strictly forbidden.
____________________________________
 
Per favore, pensate all’ambiente prima di stampare questa e-mail. Please consider the environment before printing this e-mail.

Back to the top