Search code examples
javagradleshadowjar

Execution optimizations have been disabled for shadowJar and reobfShadowJar task


I have been having trouble getting shadowJar working properly it either gives me warning or doesn't get applied when I fix the warning by adding jar.dependsOn shadowJar.

anyone knows why this happens and how I can fix the warning and get a working shadowJar?

Log: https://gist.github.com/poqdavid/c16e6f3ff66ec496cc574f4ca9dcd9d2#file-log1-log
Build script: https://gist.github.com/poqdavid/c16e6f3ff66ec496cc574f4ca9dcd9d2#file-build-gradle

Gradle version: 7.4
Shadow version: 7.1.2


Solution

  • I managed to get it working properly by adding tasks.shadowJar.dependsOn('reobfJar')

    and also apparently, it's a problem with shadowJar itself https://github.com/johnrengelman/shadow/issues/713