From the course: Introducing Maven
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Uber JARs
- [Instructor] An Uber Jar is a special build and packaging routine that has more to do with dependencies than packaging or build. So, what is an Uber, or a shaded JAR? In my mind's eye, an Uber JAR is a WAR file to run outside of a web container. Now, while that isn't exactly what it is, it's a great analogy, because just like a WAR file, a shaded JAR contains all of the source code that you write for your application. In addition, also like a WAR file, it contains all the dependencies that you need to run your application. Unlike a WAR file, however, it can be executable. Now, what this means is that you can actually package your application in a shaded JAR and hand it to somebody to run, and they don't have to do anything to bring the dependencies onto the class path, and you can even package in a shaded JAR something like embedded Tomcat to run a web application as a JAR file. Before we build our shaded JAR, I want to run a command to show you what's included in the standard JAR…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.