On Mon, 28 Aug 2017 07:32:36 +0200, Plamen Totev <plamen.iv.to...@gmail.com> wrote:

Hi,

On Fri, Aug 25, 2017 at 6:57 PM, Robert Scholte <rfscho...@apache.org> wrote:
I'm having a look at the JarArchiver of the plexus-archiver project as used
by maven-jar-plugin.
This archiver does some MANIFEST and index stuff already, so it kind of
makes sense to add the module-descriptor logic here as well.

I think it is a good idea to make Plexus Archiver module aware. I can
help you with it if you want.

All help is appreciated, Java 9 came with quite some extra work for us.


Also I took a look at the changes in the JDK jar tool and I notice a
couple of things that it does:

1. The structure of the jar produced is such that the module info
entries are placed after the manifest and before the rest of the
files. Plexus Archiver does not handle  the module info entries
differently and they are placed in random order among the rest of the
files.

IIRC Plexus Archiver is already capable to put the manifest file up front. The same should be possible with the module descriptor.

2. It adds/replaces some additional information to the module
description such as the list of packages it contains, the hashes of
the modules, module version, main class.

seems like an Archive needs to get a module(descriptor?) next to the manifest when there are so much extra options

3. There is verification that the module descriptor is consistent -
exported/opened/provided  packages/classes are actually presented in
the jar file.

 See #2

I have to double check which of those are part of the specification
and which are OpenJdk specific. In any case it sounds like a good idea
to have some verification (3.) and to update the packages field with
the packages that are actually packaged. The module hashes seem to be
OpenJdk specific but they do sound like a nice feature. Maybe we
should do some(or all) of the above thing as well, what do you think?


I think we need to focus on version and mainClass first, that's probably the first things users will ask and which is really visible to them. If the extra checks are not required I consider them as nice to have checks and pick them up later.

The points above convince we even more that the Plexus Archiver should
be module aware and the component to verify/modify the module
descriptors.

BTW what do you think - should we have a new class ModuleJarArchiver
that extends JarArchiver or just to modify JarArchiver. There is no
new packaging type and from this POV it does sounds logical to just
modify the JarArchiver. But on other hand it is extended by
WarArchiver & co so they'll become module aware as well. Not
completely sure if that is ok. I guess they should be ok as they do
not contain any code(modules or not) in their root folder, right? Or I
am wrong?

I think so. Otherwise we'll have to add an abstraction layer.


Regards,
Plamen Totev

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to