Questions tagged [uberjar]

An Uber JAR (AKA fat JAR or super JAR) is a JAR file that contains both the package and all its dependencies in one single JAR file. The advantage is that you can distribute an Uber JAR and not care at all whether or not dependencies are installed at the destination, as an Uber JAR actually has no dependencies.

181 questions
367
votes
7 answers

What is an uber JAR file?

I am reading Maven documentation and came across the name uber-jar. What does an uber-jar mean and what are its features/advantages?
Ashay Batwal
  • 5,415
  • 7
  • 25
  • 30
187
votes
6 answers

What is a fat JAR?

I've heard people say that they create a fat JAR and deploy it. What do they actually mean ?
erwaman
  • 3,307
  • 3
  • 28
  • 29
165
votes
19 answers

Using Gradle to build a JAR with dependencies

I have a multiproject build and I put a task to build a fat JAR in one of the subprojects. I created the task similar to the one described in this cookbook. jar { from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } …
Ben McCann
  • 18,548
  • 25
  • 83
  • 101
100
votes
3 answers

How to build an Uber JAR (Fat JAR) using SBT within IntelliJ IDEA?

I'm using SBT (within IntelliJ IDEA) to build a simple Scala project. I would like to know what is the simplest way to build an Uber JAR file (aka Fat JAR, Super JAR). I'm currently using SBT but when I'm submiting my JAR file to Apache Spark I get…
Yves M.
  • 29,855
  • 23
  • 108
  • 144
76
votes
13 answers

Easiest way to merge a release into one JAR file

Is there a tool or script which easily merges a bunch of JAR files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable. The concrete case is a Java restructured text tool. I would like to run it with…
tovare
  • 4,027
  • 5
  • 29
  • 30
73
votes
10 answers

gradle - how do I build a jar with a lib dir with other jars in it?

In gradle - how can I embed jars inside my build output jar in the lib directory (specifially the lib/enttoolkit.jar and lib/mail.jar)?
phil swenson
  • 8,564
  • 20
  • 74
  • 99
59
votes
8 answers

Building a self-executable JAR with Gradle and Kotlin

I've written a simple Kotlin source file in order to get started, and a Gradle script file. But I can't figure out how to add the main function to the manifest, so that the JAR could be self-executable. Here is my build.gradle script : buildscript…
loloof64
  • 5,252
  • 12
  • 41
  • 78
52
votes
5 answers

Create standalone jar using SBT

I was a heavy Maven user and now I'm gradually using SBT for some of my projects. I'd like to know how could I use SBT to create a standalone Java project? This project should be packaged as a JAR file and this JAR file would be used as a dependency…
joesan
  • 13,963
  • 27
  • 95
  • 232
45
votes
1 answer

How can I remove module-info.class warning for a shaded .jar?

I'm packaging a Spring Boot app into an uber jar using the maven-shade plugin. Simple, right? Well, it is except as of recently I'm getting the following warning at the end of mvn clean package: [WARNING] Discovered module-info.class. Shading will…
42
votes
4 answers

Building an uberjar with Gradle

I want to build an uberjar (AKA fatjar) that includes all the transitive dependencies of the project. What lines do I need to add to build.gradle? This is what I currently have: task uberjar(type: Jar) { from…
missingfaktor
  • 90,905
  • 62
  • 285
  • 365
28
votes
8 answers

Why does format("kafka") fail with "Failed to find data source: kafka." (even with uber-jar)?

I use HDP-2.6.3.0 with Spark2 package 2.2.0. I'm trying to write a Kafka consumer, using the Structured Streaming API, but I'm getting the following error after submit the job to the cluster: Exception in thread "main"…
28
votes
4 answers

Is it possible to create an "uber" jar containing the project classes and the project dependencies as jars with a custom manifest file?

I'm trying to create a executable jar(using maven) that contains the project classes and it's dependencies with a manifest file that has the entry for the main class and the class path entry that points to the dependencies packed in the root of the…
please delete me
  • 295
  • 1
  • 3
  • 6
13
votes
3 answers

Using Maven shade plugin in a multi module project - NullPointerException

I have a scenario where-in I need to create an uber jar of a multi module maven project including all modules and their dependencies. I tried using maven shade plugin. but it seems to work only when I use it at the module level. If I add the plugin…
Manoj
  • 1,384
  • 4
  • 14
  • 19
13
votes
2 answers

How To Specify main class when using fatjar plugin in gradle.build

I am interested in building a single jar containing all the module dependencies and external jars in a single executable jar file which I will be able to run with java -jar myApp.jar. I have module A which is dependent on module B. Currently I'm…
Ella Nikolic
  • 301
  • 1
  • 2
  • 9
13
votes
2 answers

make lein uberjar without source files

I'm using 'lein uberjar' to make a executable jar file of my project. the jar is created correctly and runs as expected. I just want to know if it is possible to NOT include my source .clj files in the generated .jar, since I'm planning to…
weeanon
  • 133
  • 5
1
2 3
12 13