What is an uber jar?

后端 未结 7 1417
旧时难觅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条回答
  •  猫巷女王i
    2020-11-22 10:06

    Paxdiablo's definition is really good.

    In addition, please consider delivering an uber-jar is sometimes quite useful, if you really want to distribute a software and don't want customer to download dependencies by themselves. As a draw back, if their own policy don't allow usage of some library, or if they have to bind some extra-components (slf4j, system compliant libs, arch specialiez libs, ...) this will probably increase difficulties for them.

    You can perform that :

    • basically with maven-assembly-plugin
    • a bit more further with maven-shade-plugin

    A cleaner solution is to provide their library separately; maven-shade-plugin has preconfigured descriptor for that. This is not more complicated to do (with maven and its plugin).

    Finally, a really good solution is to use an OSGI Bundle. There is plenty of good tutorials on that :)

    For further configuration, please read those topics :

    • Should you provide dependent libraries in client jar?
    • Best practices in building and deploying Clojure applications: good tutorials?

提交回复
热议问题