Re: Alternative to fatJar - modular solution?

2021-10-08 Thread Ioi Lam
As a proof of concept, I wrote a quick-and-dirty demo that can load Jigsaw modules from a Uber-JAR file:     https://github.com/iklam/tools/tree/main/jigsaw/uberjar Glavo, would something like this fit your needs? I think something like this could be done outside the JDK (in frameworks like S

Re: Alternative to fatJar - modular solution?

2021-10-08 Thread Samuel Audet
One problem is that frameworks like Spring Boot need to scan the classes that are available in a module, to get a list of the names of all the classes, among other things. The JDK provides no standard way to do that. For example, how would you implement a class like this one? https://github.com/sp

Re: Alternative to fatJar - modular solution?

2021-10-08 Thread Samuel Audet
Well, we can still use ZipInputStream just to list files from a JAR, but it's not exactly efficient. Would anyone want to make class scanning 10x slower just to support modules? Probably not Samuel On Sat, Oct 9, 2021, 13:34 Samuel Audet wrote: > One problem is that frameworks like Spring Boot

Re: Alternative to fatJar - modular solution?

2021-10-08 Thread Alan Bateman
On 09/10/2021 05:34, Samuel Audet wrote: One problem is that frameworks like Spring Boot need to scan the classes that are available in a module, to get a list of the names of all the classes, among other things. The JDK provides no standard way to do that. For example, how would you implement a

Re: Alternative to fatJar - modular solution?

2021-10-08 Thread Ioi Lam
A module can indicate its main class by setting the ModuleMainClass attribute in its module-info.class. This can be done by running with "jar --main-class=xxx" when creating a modular JAR file. The module system allows you to enumerate all the modules in a ModuleLayer. For each module, you can

Re: Alternative to fatJar - modular solution?

2021-10-08 Thread Alan Bateman
On 06/10/2021 18:24, Glavo wrote: For a long time, unpacking and repackaging all dependencies into a file called fatJar was the first choice for single file distribution of Java programs. However, the compatibility of this solution with JPMS is very poor - it breaks up all the modules and works w