Linked Questions
15 questions linked to/from How do I create an executable fat JAR with Gradle with implementation dependencies?
8 votes
1 answer
4k views
Gradle fat jar does not contain libraries [duplicate]
I have created a simple Gradle Java project. The build.gradle file looks like this: plugins { id 'java' } repositories { mavenCentral() } dependencies { implementation group: 'org....
211 votes
12 answers
377k views
Creating runnable JAR with Gradle
Until now I created runnable JAR files via the Eclipse "Export..." functionallity but now I switched to IntelliJ IDEA and Gradle for build automation. Some articles here suggest the "application" ...
125 votes
9 answers
236k views
Add resources and config files to your JAR using Gradle
How do I add config files or any other resources into my jar using gradle? My project structure: src/main/java/com/perseus/.. --- Java packages (source files) src/main/java/config/*.xml --- ...
96 votes
14 answers
142k views
Gradle "Entry .classpath is a duplicate but no duplicate handling strategy has been set"
I'm trying to build a gradle project but, when I try $ gradle build I get the following output: Starting a Gradle Daemon (subsequent builds will be faster) > Task :jar FAILED FAILURE: Build failed ...
85 votes
6 answers
51k views
How to create a fat JAR with Gradle Kotlin script?
As titled, I'd like to know how to modify the gradle.build.kts in order to have a task to create a unique jar with all the dependencies (kotlin lib included) inside. I found this sample in Groovy: //...
43 votes
5 answers
52k views
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)...
50 votes
2 answers
36k views
What is the difference between registering and creating in Gradle Kotlin DSL
There are two methods of creating, i.e. tasks, in Gradle (5.0+): tasks { val javadocJar by creating(Jar::class) { val javadoc by tasks from(javadoc) classifier = "javadoc"...
3 votes
1 answer
10k views
Java Gradle Build: NoClassDefFoundError
My build.gradle file is as following apply plugin: 'java' sourceCompatibility = 1.8 repositories { mavenCentral() } dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' ...
5 votes
1 answer
6k views
absolute versus relative path names in jar manifest
I want to reference a jar file in fixed location for use by multiple executable jars rather than include that jar in each of the executables. I have the following setup which works fine commons-math3-...
0 votes
1 answer
2k views
Include dependencies in Zip file created with Gradle's Zip task using 'into' (before v4 it worked fine)
I am working in an old project which was using Gradle Wrapper v3.2.1, but I want to update it to the latest version (currently v5.4.1). I have tried updating it to v4.10.2 first but it fails too, so ...
0 votes
0 answers
549 views
Gradle Build Script Upgrade from 6.x to 7.x
I'm working on upgrading a Gradle build script from Gradle 6.9.4 to 7.x (or newer), for a SpringBoot based Java 11 web application. The original script is included below and it works correctly. The ...
2 votes
0 answers
296 views
NoClassDefFoundError : cannot find main class in jar file
After countless days of trying to find an answer to my question, I've decided to post it here. I've been developping a monitoring application for my company, and as I'm about to distribute it, the jar ...
0 votes
1 answer
313 views
How do i define the right class path to my executable jar file?
I am having problem with creating an executable JAR file where i can double click an icon and make my program start. I've made a fun little app for my friend for him to try this Xmas, but i've spent ...
-1 votes
1 answer
134 views
build.gradle / JACo MP3 Player
I'm making Minecraft Forge MOD. It uses JACo MP3 Player, but I got runtime error when I install it to its client. It causes an error when triggering the library event in-game: [Client thread/INFO]: [...
0 votes
0 answers
59 views
Grade not able to create FAT jar but maven works
I used gradle to try to create a fat jar from this answer How do I create an executable fat JAR with Gradle with implementation dependencies? tasks.jar { manifest.attributes["Main-Class"] = &...