[
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?
|
Hi
"I propose to make this a rule"
Do you mean an informal good practice
or a Manifest editor warning and a quick fix
or a Manifest builder automated edit?
Regards
Ed Willink
On 05/10/2017 22:10, Stephan Herrmann wrote:
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:
http://cr.openjdk.java.net/~mr/jigsaw/spec/api/java/lang/module/ModuleFinder.html#of-java.nio.file.Path...-
_______________________________________________
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://dev.eclipse.org/mailman/listinfo/cross-project-issues-dev
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus