[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-jigsaw-dev
Subject:    =?UTF-8?B?QWRkIHBvc2liaWxpdHkgdG8gYWRkIGN1c3RvbSBNb2R1bGVSZWFkZXJGYWN0?= =?UTF-8?B?b3J5IHRvIE1vZHVsZ
From:       Alex Sviridov <ooo_saturn7 () mail ! ru>
Date:       2018-09-28 9:01:51
Message-ID: 1538125311.924227368 () f450 ! i ! mail ! ru
[Download RAW message or body]

From java 9 we can create JPMS layers and dynamically add modules to it. At the same \
time different types of java archives can be JPMS modules - .jar, .war, .ear. \
However, the problem is that it is possible to add only .jar archives by default. I \
opened an issue here  https://bugs.openjdk.java.net/browse/JDK-8203330  and as it was \
found out it is necessary to implement custom ModuleFinder. 

Trying to implement ModuleFinder I understood that it is necessary to rewrite (or \
take from) the "half" of jdk.intenal what is a very bad way. 

Lets' consider what I need to add .war arhives to JPMS layer. I need: 1) to \
understand if I can work with this type of archive or I can not (if .war is \
supported) 2). to map file location, for example instead of "module-info.java" I must \
find "WEB-INF/classes/module-info.java" etc. For that I don't need to create \
ModuleDescriptor, ModuleReference, ModuleFinder. 

So I suggest to overload ModuleFinder.of() method adding as a parameter custom \
ModuleReaderFactory. For example to add ModuleFinder#of(ModuleReaderFactory factory, \
Path... entries). ModuleReaderFactory must have such method - createModuleReader(Path \
path). Such solution will also help Jakarta EE developers a lot of. 


Best regards, Pavel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic