5

I have a fat jar created using maven 3.5.

I am trying to reduce the size of fat jar. Can someone let me know how I can determine the size of the larger dependencies? If a dependency A brings in B & C . Then the size of A should be the sum of the size of A, B & C.

Is there a way to do this in maven 3.5?

tuk
  • 5,941
  • 14
  • 79
  • 162
  • 8
    Maybe use `mvn dependency:copy-dependencies` and look at individual jar sizes under `target\dependency`. Then use `mvn dependency:tree` to figure out how dependencies are imported – Daniele Feb 20 '19 at 15:47
  • This answer can help : https://stackoverflow.com/a/35094282/369946 The question is the same like yours. But it forces you to do it for each dependency – Matt Feb 20 '19 at 15:55
  • 2
    Shouldn't you analyse which dependencies you need and which not? What does it help you to know the largest dependency if you need that dependency? – J Fabian Meier Feb 20 '19 at 17:50
  • @JFabianMeier In my case, I could challenge the need for that dependency and either (only) code what I need or use alternative lighter dependency. Or not, but at least I'd like to know – Juh_ Aug 10 '23 at 12:22
  • @Daniele I know it's old but you should make that an answer. It's actually very practical – Juh_ Aug 10 '23 at 12:30

0 Answers0