javagradlejaruberjarshadowjar

Unable to build FatJAR using the shadowJar plugin in Gradle


I have tried pretty much everything and for some reason, no JAR file gets built under my build folder.

Here is build.gradle:

plugins {
    id 'java'
    id 'com.github.johnrengelman.shadow' version '7.0.0'
}

group 'org.prithvidiamond1'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.javacord:javacord:3.3.2'
}

task stage(dependsOn: ['build', 'shadowJar', 'clean']) {
    build.mustRunAfter clean
}

Can anybody help me out with this?

For extra context, here is the output from the console when I run the build.gradle script:

15:50:12: Executing task ' stage'...

> Task :clean
> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
> Task :jar
> Task :assemble
> Task :compileTestJava NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test NO-SOURCE
> Task :check UP-TO-DATE
> Task :build
> Task :shadowJar
> Task :stage

BUILD SUCCESSFUL in 1s
4 actionable tasks: 4 executed
15:50:13: Task execution finished ' stage'.

Solution

  • The answer was that IntelliJ IDEA didn't update the file in the directory quick enough, it was there all along.