[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] Eclipse plug-ins as automatic modules in Java 9?

> Hence, I propose to make this a rule for future releases that all bundles
> should have this manifest header, where the value should be identical to
> the value of Bundle-SymbolicName.

+1 and +1 for having PDE support (https://bugs.eclipse.org/525660).

Dani



From:        Stephan Herrmann <stephan.herrmann@xxxxxxxxx>
To:        Cross project issues <cross-project-issues-dev@xxxxxxxxxxx>
Date:        05.10.2017 23:10
Subject:        [cross-project-issues-dev] Eclipse plug-ins as automatic modules in        Java 9?
Sent by:        cross-project-issues-dev-bounces@xxxxxxxxxxx




Hi,

I just noticed by chance that none of the artifacts we are producing
are consumable as "automatic modules" in Java 9 speak.

The reason is: JPMS defines an algorithm how names for automatic modules
are derived from the jar file name. Unfortunately, the spec expects any
version to be separated from the name by "-", whereas our files use "_".

As a result a jar file like
   org.eclipse.equinox.common_3.9.0.v20170207.jar
is interpreted as an automatic module named
   org.eclipse.equinox.common.3.9.0.v20170207
(cutting off the version fails, then "_" is converted to ".").

Since that module name is not a legal Java identifier, the given jar file
cannot be referenced in any "requires" clause of a Java 9 module.

While all this is very unfortunate, Java 9 provides a means for a systematic
solution: adding an Automatic-Module-Name header to MANIFEST.MF.

Hence, I propose to make this a rule for future releases that all bundles
should have this manifest header, where the value should be identical to
the value of Bundle-SymbolicName.

There may not yet be any consumers of Eclipse plug-ins as Java 9 modules,
but as we know that several of our artifacts are being consumed outside OSGi,
I am sure that clients will expect our artifacts to be consumable as Java 9
modules sooner or later. And then a general solution looks cleaner to me
then doing this for selected artifacts only.

best,
Stephan

Reference for naming of automatic modules:
https://urldefense.proofpoint.com/v2/url?u=http-3A__cr.openjdk.java.net_-7Emr_jigsaw_spec_api_java_lang_module_ModuleFinder.html-23of-2Djava.nio.file.Path...-2D&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=1UITCR5rxUZHSFczvfaNFK4ymEbEiccRX7VKchpqz0Y&m=FWDhRdiRFAyj2GifD6YtSPozyA79w_jtZw9lzRvzXmQ&s=XcH8c6YPP7EckLYSnqp6AdGT8fQ934MzrpR0aoghrPg&e=
_______________________________________________
cross-project-issues-dev mailing list
cross-project-issues-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-3A__dev.eclipse.org_mailman_listinfo_cross-2Dproject-2Dissues-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=1UITCR5rxUZHSFczvfaNFK4ymEbEiccRX7VKchpqz0Y&m=FWDhRdiRFAyj2GifD6YtSPozyA79w_jtZw9lzRvzXmQ&s=TUeYYSzSWs-W0BoYl-4_ccfQ3dBF8gLi1SzDLrNvedo&e=