What is an uber jar?

后端 未结 7 1359
旧时难觅i
旧时难觅i 2020-11-22 10:03

I am reading Maven documentation and came across the name \'uber-jar\'.

What does an uber-jar mean and what are its features/advantages?

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 10:20

    ubar jar is also known as fat jar i.e. jar with dependencies.
    There are three common methods for constructing an uber jar:

    1. Unshaded: Unpack all JAR files, then repack them into a single JAR. Works with Java's default class loader. Tools maven-assembly-plugin
    2. Shaded: Same as unshaded, but rename (i.e., "shade") all packages of all dependencies. Works with Java's default class loader. Avoids some (not all) dependency version clashes. Tools maven-shade-plugin
    3. JAR of JARs: The final JAR file contains the other JAR files embedded within. Avoids dependency version clashes. All resource files are preserved. Tools: Eclipse JAR File Exporter

    for more

提交回复
热议问题