Converting plain JARs to Java modules
Alan Bateman
Alan.Bateman at oracle.com
Mon Nov 7 02:22:24 PST 2011
On 07/11/2011 09:47, Glyn Normington wrote:
> Thanks for those responses. I see that semi-automatic conversion of a existing JAR file to a modular JAR file is possible.
>
> In case it's not obvious, please note that support for package level dependencies would permit a fully automatic conversion because it would then not be necessary to know the module name corresponding to each package dependency. A fully automatic converstion could be particularly useful in automatically serving up modularised versions of existing JARs, e.g. in a front end to Maven central.
At least for Maven artifacts then you can generate a module name from
the maven coordinates. In the current prototype then it uses
artifactId at version when installing a Maven artifact as a module. It
could be argued that the groupId should be in there too but exact
mapping TBD. In any case, you don't know what the exported types are.
As regards static analysis then it will clearly be useful as a migration
aid but it wouldn't catch everything. Mandy pointed out the class
analyzer that we currently use in the build and there is clearly
potential to do more.
-Alan.
More information about the jigsaw-dev
mailing list