chrisdchristo / capsule-maven-plugin

Capsule Maven Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Large size difference between shaded JAR and Capsule JAR

johnament opened this issue · comments

It was requested to look at Capsule to package Hammock based apps. I decided to try out the maven plugin which can be seen here: https://github.com/hammock-project/microprofile-samples/tree/capsule

The problem is that the default distribution is 10 mb (shaded JAR). The Capsule equivalent is 98 mb. That seems a bit off to me. Any idea what I might be doing wrong?

Can you look inside the JARs to see where the difference is?

Well, its like comparing apples and oranges. I'm not sure what Maven's default compression level is, and I'm not sure what yours is either. It seems like its very little compression though.

http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jar.html

Ultimately, the two JARs should contain the same files, only in the case of Capsule, the files will be inside unexploded JARs in the capsule. The large difference in size suggests that maybe the capsule contains many more files. JAR files are easy to introspect, so the comparison should be relatively simple.

@johnament Did you checkout the fact that you are flexible to define what is packaged inside the capsule jar, i.e regarding dependencies. Most likely you are packaging all dependencies required, in what we tend to call a 'fat' jar. If you want a smaller capsule payload, you could consider excluding dependencies and have them be downloaded and cached at runtime.

Closing due to inactivity.