Converting plain JARs to Java modules

Peter Kriens peter.kriens at aqute.biz
Wed Nov 9 01:19:04 PST 2011


Yup, then you're screwed ... :-)

However, for non OSGi bundles I think you could calculate an educated guess of their package versions based on the existing poms if you do it once for the whole of maven central.

Kind regards,

	Peter Kriens

On 9 nov. 2011, at 10:15, Glyn Normington wrote:

> Actually, the scenario I had in mind was generating, fully automatically, Java modules from today's content of Maven central. So we shouldn't assume we can recompile the dependencies in that scenario.
> 
> Regards,
> Glyn
> 
> On 9 Nov 2011, at 09:12, Peter Kriens wrote:
> 
>> An annotation in the package-info.java source can easily provide a package version that could then be encoded in the class files by the compiler. 
>> 
>> Notice that due to their smaller granularity packages are much easier to version semantically than jars.
>> 
>> Kind regards,
>> 
>> 	Peter Kriens
>> 
>> 
>> On 9 nov. 2011, at 10:06, Glyn Normington wrote:
>> 
>>> Those points of unreliability of Maven POMs and the locality of the conversion are strong arguments in favour of support for package-level dependencies and a JAR->module converter generating such dependencies. The only downside I am aware of is that a fully automatic tool needs to leave the package import version ranges wide open as it can't guess the correct versions needed. I think this is acceptable for a fully automatic conversion.
>>> 
>>> Regards,
>>> Glyn
>>> 
>>> On 8 Nov 2011, at 23:15, Sangjin Lee wrote:
>>> 
>>>> Translating maven POMs into module dependency information is not quite the same as generating it based on the bytecode in my view. We're well too aware that most of the POMs do not contain correct (direct) dependencies for this to be accurate. The generated module dependency information would be as good as the underlying POMs, which is generally not so good.
>>>> 
>>>> Generating OSGi manifests using package-level dependencies can be very accurate, and does not depend much on user input. Furthermore, it is a local operation.
>>>> 
>>>> Regards,
>>>> Sangjin
>>>> 
>>>> On Tue, Nov 8, 2011 at 2:32 PM, <mark.reinhold at oracle.com> wrote:
>>>> 2011/11/7 1:47 -0800, gnormington at vmware.com:
>>>>> ...
>>>>> 
>>>>> 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.
>>>> 
>>>> Yes, I think we understand that.
>>>> 
>>>>>                  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.
>>>> 
>>>> Maven POMs already contain what is, essentially, module-level dependence
>>>> information, so the value of package-level dependences for that case is
>>>> far from clear.  Alan has prototyped a tool which constructs a Jigsaw
>>>> module declaration from a POM; it works well, at least for simple cases,
>>>> though there does seem to be a lot of noise in the POMs published on
>>>> Maven Central.
>>>> 
>>>> - Mark
>>>> 
>>> 
>> 
> 




More information about the jigsaw-dev mailing list