Yes, this is how I think it will work best: a tooling story. But Java 9 modules are not a finalized design yet, so the Bnd devs are not looking at anything to do this yet.
If you have ideas/opinions of this topic of Bnd changes, you should take it to the bndtools-users@ mail list.
--
BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
----- Original message -----
From: Matt Sicker <boa...@gmail.com>
Sent by: osgi-dev-boun...@mail.osgi.org
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Cc:
Subject: Re: [osgi-dev] Deriving Java 9 module descriptors from OSGi metadata?
Date: Sat, Feb 25, 2017 4:58 PM
Perhaps bnd could be enhanced to handle it, but I'd imagine you'd just have two build plugins generating metadata from the same project model.On 25 February 2017 at 13:26, <list+org.o...@io7m.com> wrote:Hello!
I'm curious if anyone's given any thought to deriving Java 9 module
descriptors from OSGi manifests.
Right now, in a pre-JDK9 world, it's standard practice to produce jar
files that are OSGi bundles when used in an OSGi context, and ordinary
pile-of-classes jar files when used on the Java classpath. In other
words, builds generally produce a single jar file that:
- Works as an OSGi bundle when used in an OSGi context
- Works as an ordinary jar when used on the classpath
However, when JDK9 appears, it introduces the concept of modular jars.
Those work somewhat differently and require the addition of a module
descriptor in the JAR file (assuming that "automatic modules" are not
used). In other words, a build should (assuming that compatibility with
older JVMs is desirable) produce a jar file that:
- Works as an OSGi bundle when used in an OSGi context
- Works as a modular jar when used on the module path in Java >= 9
- Works as an ordinary jar when used on the traditional classpath
Given that the information expressible in a Java 9 module descriptor
seems to be a subset of that defined in OSGi manifests, it seems like
it would be possible if not necessarily easy to derive a Java 9 module
descriptor from data given in OSGi manifests as part of the build
process. I personally am not looking forward to having to maintain
two very nearly if not completely identical sets of metadata regarding
the imports and exports of packages.
Anyone looked at this?
M
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev --Matt Sicker <boa...@gmail.com>_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev