Questions tagged [fatjar]
134 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
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
79
votes
8 answers
How do I create an executable fat JAR with Gradle with implementation dependencies?
I've got a simple project in Gradle 4.6 and would like to make an executable JAR of it. I've tried shadow, gradle-fatjar-plugin, gradle-one-jar, spring-boot-gradle-plugin plugins but neither of them adds my dependencies declared as implementation (I…

Dmitry Senkovich
- 5,521
- 8
- 37
- 74
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
26
votes
4 answers
Gradle - FatJar - Could not find or load main class
I know that question was asked a lot and has many answers, but i still get it and I don't understand why...
I am trying to generate a .jar from a projet with dependencies with gradle.
I have a class src/main/java/Launcher.java, in which I have my…

Hadrien
- 386
- 1
- 3
- 11
12
votes
1 answer
JDK11/JavaFX: How do I make a fat jar without build/depdency management?
I think it goes without saying that I should be able to use Oracle's own JDK with JavaFX (from gluonhq) to build a distributable jar file that users can just USE.
After an exhaustive search, much reading (24 hours or more over the last few…

chrips
- 4,996
- 5
- 24
- 48
11
votes
8 answers
ShadowJar: No value has been specified for property 'mainClassName'
In tweaking my buildfile, I seem to have encountered a bug with mainClassName:
thufir@dur:~/NetBeansProjects/HelloSeleniumWorld$
thufir@dur:~/NetBeansProjects/HelloSeleniumWorld$ ./gradlew clean ShadowJar --stacktrace
> Task :shadowJar…

Thufir
- 8,216
- 28
- 125
- 273
8
votes
1 answer
Gradle fat jar does not contain libraries
I have created a simple Gradle Java project. The build.gradle file looks like this:
plugins {
id 'java'
}
repositories {
mavenCentral()
}
dependencies {
implementation group: 'org.apache.commons', name: 'commons-lang3', version:…

Harold L. Brown
- 8,423
- 11
- 57
- 109
7
votes
4 answers
Create fat jar from kotlin multiplatform project
I recently switched from old 1.2 multiplatform into 1.3. Difference is, there's one one build.gradle file per multiplatform module (I got 5 of them) so a lot less configuration.
However I can't seem to be able to configure creating runnable fat jar…

K.H.
- 1,383
- 13
- 33
7
votes
2 answers
Not able to create JAR file for gradle project
I want to create a jar file which I can upload on AWS, but every time I run the command gradle jar from command prompt I get the following error.
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution…

iDeveloper
- 940
- 1
- 10
- 45
6
votes
1 answer
gradle: exclude a dependency in making fatJar
There are lots of repeated answers on how to exclude an individual file from a fatJar. Typically, the file is excluded are in META-INF and they are excluded either because of a filename conflict, or because it is a signature copied from a dependency…

Tankman六四
- 1,638
- 2
- 13
- 19
4
votes
1 answer
Fat aar does not include modules resources in Android
I want to generate a fat-aar of an app module and use it as a dependency in another app.
I have used this library to generate the fat-aar.
I have an app module which is converted as a library module and a feature module called splash and Splash…

hasan_shaikh
- 1,434
- 1
- 15
- 38
4
votes
1 answer
How to create a fat Jar in Gradle with Kotlin DSL and plugin
I did a lot of research on how to create fat jars with Gradle.
However, I can not figure out how to it with Kotlin DSL and a plugin.
I have this code:
plugins {
application
id("org.openjfx.javafxplugin") version "0.0.9"
…

weisbrja
- 164
- 10
4
votes
1 answer
java.lang.NoClassDefFoundError: Could not initialize class - Kotlin Object
I have a multi modular Gradle project with Kotlin.
One of the modules have the main method and dependencies to others. I need to create an executable jar from this module. So I have tried to do that by creating a Jar task like this
jar {
…

Andranik
- 2,729
- 1
- 29
- 45
4
votes
1 answer
Shadow Gradle Plugin for Android
Has someone had any success in using Shadow Gradle Plugin to generate AAR? I am getting an error Could not find method shadowJar(). This is my configuration
plugins {
id 'com.android.library'
id 'kotlin-android'
id…

gelojavonitalla
- 41
- 5