tycho icon indicating copy to clipboard operation
tycho copied to clipboard

Tycho does not handle multi-release OSGi bundles

Open davenice opened this issue 3 years ago • 1 comments

I have fallen over the issue documented at https://bugs.eclipse.org/bugs/show_bug.cgi?id=542905

Eclipse and OSGi support multi-release OSGi bundles. In my case I've got a Java 9+ MANIFEST.MF that introduces package imports for javax.xml.bind. These imports are not present in the default MANIFEST.MF.

If I build this using an environment based on Java 8, all is good. If I build this using an environment based on Java 11, the compilation fails because the extra package import is not resolved.

davenice avatar Oct 07 '21 09:10 davenice

package imports for javax.xml.bind. These imports are not present in the default MANIFEST.MF

javax.* package have to be imported also with pre java 9 so you better always import them if required.

If I build this using an environment based on Java 11, the compilation fails because the extra package import is not resolved.

can you provide a reproducer and/or more detailed error message?

laeubi avatar Oct 11 '21 13:10 laeubi

@davenice are you still interested in this and maybe provide an integration-test to demonstrate the issue?

laeubi avatar Jan 09 '23 07:01 laeubi

An example for a MR build can now be found here:

  • https://github.com/eclipse-platform/eclipse.platform/pull/346

laeubi avatar Mar 06 '23 06:03 laeubi

One complication is that we currently resolve for multiple platforms but we do not for multiple java versions also of course the classpath is only resolved once.

As Multi-Relase jar have a very limited scope (e.g. only import-package can change across versions), I think a pragmatic solution would be to simply query for the additional packages in the target platform and add the jars accordingly.

laeubi avatar Mar 06 '23 06:03 laeubi