<div dir="ltr"><div>Please provide a way to exclude files or packages from a particular Jar. For example, I may not want Multimap.class in the Guava Jar.</div><div><br></div><div>Is this compatible with Proguard's and Graal VM's to trim fat Jars? Both of these will eliminate unused classes, methods, and fields to reduce the size of the fat Jar.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 6, 2023 at 3:17 PM Glavo <<a href="mailto:zjx001202@gmail.com">zjx001202@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hey everyone,</div><div dir="ltr"><br></div><div dir="ltr">Recently, I have been busy developing a new JPMS-friendly Java program packaging format: JApp (<a href="https://github.com/Glavo/japp" target="_blank">https://github.com/Glavo/japp</a>).</div><div dir="ltr"><br></div><div dir="ltr">JApp is intended as a better alternative to shadow jar (fat jar).</div><div dir="ltr">Users need to specify the module path and classpath when creating a JApp file.</div><div dir="ltr">Resources in all module path/classpath entries (JAR or directory) are packaged into a single japp file, </div><div dir="ltr">but unlike shadow jars, japp isolates resources from different module path/classpath entries.</div><div dir="ltr"><br></div><div dir="ltr">For example, we can create a japp file with the following command:</div><div dir="ltr"><br></div><div dir="ltr"> japp create -o myapp.japp \</div><div dir="ltr"><span style="white-space:normal"><span style="white-space:pre-wrap"> </span>--module-path commons-lang3-3.14.0.jar:commons-io-2.15.1.jar \</span></div><div dir="ltr"> --classpath guava-32.1.3-jre.jar:gson-2.10.1.jar</div><div dir="ltr"> </div><div dir="ltr"><br></div><div dir="ltr">This will create a japp file named `myjapp.japp` that contains resources from four jar files.</div><div dir="ltr">At runtime, the URIs for the resources from the four JAR files each look like this:</div><div dir="ltr"><br></div><div dir="ltr"><span style="white-space:normal"><span style="white-space:pre-wrap"> </span>japp:/modules/org.apache.commons.lang3/org/apache/commons/lang3/ObjectUtils.class</span></div><div dir="ltr"><span style="white-space:normal"><span style="white-space:pre-wrap"> </span>japp:/modules/<a href="http://org.apache.commons.io/org/apache/commons/io/IOUtils.class" target="_blank">org.apache.commons.io/org/apache/commons/io/IOUtils.class</a></span></div><div dir="ltr"><span style="white-space:normal"><span style="white-space:pre-wrap"> </span>japp:/classpath/guava-32.1.3-jre.jar/com/google/common/collect/Multimap.class</span></div><div dir="ltr"><span style="white-space:normal"><span style="white-space:pre-wrap"> </span>japp:/classpath/gson-2.10.1.jar/com/google/gson/Gson.class</span></div><div dir="ltr"><span style="white-space:normal"> </span></div><div dir="ltr">At runtime, each entry in the module path and classpath is independent, </div><div dir="ltr">just like passing the `--classpath`/`--module-path` option directly to the `java` command.</div><div dir="ltr"><br></div><div dir="ltr">By sharing the class constant pool, using zstd as the compression method, and </div><div dir="ltr">compressing the file metadata, japp files are generally smaller than shadow jars.</div><div dir="ltr"><br></div><div dir="ltr">JApp files also support specifying some conditions, such as requirements for the Java version.</div><div dir="ltr">JApp selects the Java runtime to use to run the program based on these conditions.</div><div dir="ltr"><br></div><div dir="ltr">Here is its GitHub repository, for more features and detailed instructions please refer to the README:</div><div dir="ltr"><br></div><div dir="ltr"> <a href="https://github.com/Glavo/japp" target="_blank">https://github.com/Glavo/japp</a></div><div dir="ltr"><br></div><div dir="ltr">Now that the basic features of JApp are complete, I'm sharing it here in the hope</div><div dir="ltr">that more people will try it and give feedback.</div><div dir="ltr"><br></div><div dir="ltr">Thank you to everyone who is willing to read this email!</div><div dir="ltr"><br></div><div dir="ltr">Glavo</div></div></div></div></div></div></div></div>
</blockquote></div>