I am reading Maven documentation and came across the name uber-jar
.
What does an uber-jar
mean and what are its features/advantages?
The AEM Uber jar includes all AEM APIs as a single dependency in your Maven project's pom. xml . It is always a best practice to include the Uber Jar as a single dependency instead of including individual AEM API dependencies.
The Uber JAR is a JAR where all of the application's compiled code along with the dependencies are grouped together so, that the programmer may find easy if he needs to deploy it somewhere as the dependencies come along with the JAR. The Uber JAR is also known as Fat JAR.
Utility to generate a single jar file containing all the resources referenced by a given jar file. As well as the contents of the named jar file itself, the contents of any jar files referenced in the Class-Path line of that file's Manifest will be included, and so on recursively.
Über
is the German word for above
or over
(it's actually cognate with the English over
).
Hence, in this context, an uber-jar is an "over-jar", one level up from a simple JAR (a), 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) I probably shouldn't have to explain what a JAR is to a Java developer but I'll include it for completeness. It's a Java archive, basically a single file that typically contains a number of Java class files along with associated metadata and resources.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With