jbang icon indicating copy to clipboard operation
jbang copied to clipboard

Consider reducing fatjar by excluding ide-deps

Open ennishol opened this issue 4 months ago • 5 comments

I ran fatjar export and found:

du -sh META-INF/*

57M     META-INF/ide-deps

1.6M    META-INF/maven

236K    META-INF/template-html-builder.css
4.0K    META-INF/thirdparty-LICENSE
272K    META-INF/versions

57m of ide-deps. Can it be excluded/removed from the resulting fatjar?

Thanks you!

ennishol avatar Aug 15 '25 14:08 ennishol

which jar is that? What did you export?

maxandersen avatar Aug 16 '25 05:08 maxandersen

@maxandersen Steps to reproduce:

  • jbang init -t qcli quarkusCli.java
  • ./quarkusCli.java
  • jbang export fatjar quarkusCli.java
  • unzip quarkusCli-fatjar.jar
  • du -sh META-INF/*

ennishol avatar Aug 18 '25 08:08 ennishol

ah this is more quarkus integration specific - afaics jbang doesn't put these in the build result.

its https://github.com/quarkusio/quarkus/blob/main/core/launcher/src/main/java/io/quarkus/launcher/JBangIntegration.java that affects what ends up in the .jar file after jbang compiled core code.

but yes, those deps seems to be unnecessarily added - or at least shouldn't need to be add unless you run in quarkus devmode (-Dquarkus.dev) but even then I'm surprised they even end up there.

Want to take a crack at fixing or figuring it out?

in any case best if you open issue on quarkusio and link to this as I'm 98% sure its pure quarkus fix - but might need some hooks on jbang side to make most efficient.

maxandersen avatar Aug 18 '25 09:08 maxandersen

But I'm actually quite surprised to see those ide-deps in the fat jar, because they don't exist in the quarkusCli jar itself, nor do they appear in the quarkus-core jar. So where are they coming from?

Edit: ok, they come from the quarkus-ide-launcher dependency.

quintesse avatar Aug 18 '25 09:08 quintesse

Yeah - and i think that dependency is added "too eagerly" by the Quarkus integration.

maxandersen avatar Aug 18 '25 10:08 maxandersen