[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Support for Java 9 modules

On 05.10.2017 22:26, Thomas Watson wrote:
I think we should be explicit in deciding what our automatic module name is instead of depending on what the file name is on disk. Anyone can rename our bundle file names on disk, that does not change what its OSGi Bundle-SymbolicName is. Therefore I would advocate we use the Automatic-Module-Name header so we have explicit control over the name which cannot be changed simply by renaming the file.

Makes sense.

Did you mean to put an underscore _ in for the separator of the version? I would have expected org.eclipse.equinox.common_3.9.0.v20170207.jar

Correct, jar file with underscore, automatic module name then converts underscore to dot. Sorry for confusion.

I don't have a good idea on how hard it would be to change the build and consumption of the artifacts with a - (dash) vs _ (underscore). I do know the osgi.bundles property supports both. It was a bit tricky to get it to play nicely with discovering both bundles with dash and bundles with underscore.

OK, I was only aware of magic in p2, maybe p2 translates arbitrary file names to canonical file names during installation? If so, that wouldn't help the issue at hand.

I'll bring the matter of Automatic-Module-Name to the table at cross-project.


    ----- Original message -----
    From: Stephan Herrmann <stephan.herrmann@xxxxxxxxx>
    Sent by: equinox-dev-bounces@xxxxxxxxxxx
    To: equinox-dev@xxxxxxxxxxx
    Subject: Re: [equinox-dev] Support for Java 9 modules
    Date: Thu, Oct 5, 2017 2:00 PM
    We (JDT) have just been toying with the opposite direction:
    add module-info.java to an existing OSGi bundle.
    I only then noticed that none of our OSGi bundles can be
    consumed as automatic JPMS modules, because the algorithm
    for names of automatic modules, fails to cut off the version
    from jar files like
     ÂÂ Âorg.eclipse.equinox.common.3.9.0.v20170207.jar
    Due to lack of a separating "-" we end up with an illegal
    module name of
     ÂÂ Âorg.eclipse.equinox.common.3.9.0.v20170207

    I'm not even sure if this is a useful exercise, but in case
    it might be: should we recommend / request that all future
    releases of Eclipse plug-ins specify a legal module name
    via Automatic-Module-Name manifest attribute?

    Or could the names of jar files be adjusted to use "-" as in
     ÂÂ Âorg.eclipse.equinox.common-3.9.0.v20170207.jar

    I believe, p2 could absorb this change, no? It would then be
    an issue of convincing tools like PDE and tycho to produce jars
    with a modified naming scheme? (Or CBI aggregator for that matter).