4

I cannot find a description of how the maven-shade-plugin minimizeJar option do filter out classes.

In the doc it only say:

Besides user-specified filters, the plugin can also be configured to automatically remove all classes
of dependencies that are not used by the project, thereby minimizing the resulting uber JAR:

Because I don't see the point of including the content of unused dependencies (provided or test, and their transitive dependencies) I expect the plugin to not not include them by default. And thus I understood that minimizeJar would in some way determine which specific classes of required dependencies are not effectively being used and remove those from the shaded-jar.

But in my situation, the dependency tree is complex and I don't want to take any risk. So I didn't use this minimizeJar option. However, I get a really big shaded-jar that contains the classes of dependencies that seems included only in a test dependency (see this question).

Question: Is there some proper explanation of what does the minimizeJar option?

Subquestion: how safe is its usage?

Juh_
  • 14,628
  • 8
  • 59
  • 92

0 Answers0