I am reading Maven documentation and came across the name 'uber-jar'.
What does an uber-jar mean and what are its features/advantages?
I am reading Maven documentation and came across the name 'uber-jar'.
What does an uber-jar mean and what are its features/advantages?
Paxdiablo definition is really good.
In addition, please consider delivering an uber-jar is sometimes quite interesting, if you really want to distribute a software and don't want customer to have 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 :
A cleaner solution is to provide thir 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 :
ubar jar is also known as fat jar i.e. jar with dependencies.
There are three common methods for constructing an uber jar:
for more
Über
is the German word forabove
orover
, as in a line from a previous national anthem:Deutschland, Deutschland, über alles
(Germany, Germany above all else).Hence, in this context, an uber-jar is an "over-jar", one level up from a simple "jar", defined as one that contains both your package and all its dependencies in one single JAR file. The name can be thought to come from the same stable as ultrageek, superman, hyperspace, and metadata, which all have similar meanings of "beyond the normal".
The advantage is that you can distribute your uber-jar and not care at all whether or not dependencies are installed at the destination, as your uber-jar actually has no dependencies.
All the dependencies of your own stuff within the uber-jar are also within that uber-jar. As are all dependencies of those dependencies. And so on.
A self-contained, executable Java archive. In the case of WildFly Swarm uberjars, it is a single .jar file containing your application, the portions of WildFly required to support it, an internal Maven repository of dependencies, plus a shim to bootstrap it all. see this