Post

Today I found out about something really puzzling. I noticed that each new Java release of my Arconia Framework to Maven Central ended up being around 200MB. That's a lot! How could that be possible? 😱 Let me tell you what was the problem and how I got it down to 8MB.

Maven Central requires every library published there to provide a dedicated JavaDoc JAR file. Even though I don't need it, it's a requirement, so I configured my Java project to generate that. It turns out that, by default, each JavaDoc JAR comes with a bundle of font files of 4,1MB 🧨 Absurd!

What does that mean? Every Java artifact you publish to Maven Central has an extra 4,1MB of font files. Imagine how's that multiplied by the number of libraries published there? 💥 Since Java 23, you can disable the inclusion of the font files, but it should really be disabled the default!

So now I'm adding this configuration to all my Java projects. For the Arconia Framework, that meant going from 200MB to 8MB total release size (many artifacts). Considering the new publishing limits set by Sonatype, that makes a huge difference! Also, no wonder the disk storage costs are so high!

0 reposts2 likes

And why is the option called „no fonts“? That’s backward. There should be an „include fonts“ option instead. Then we can always discuss what the default should be -- I do see your point there too.