Hello, Anyone know benefit using shadowJar rather ...
# gradle
d
Hello, Anyone know benefit using shadowJar rather than using gradle application plugin to create single executable jar?
r
Gradle
application
plugin generates jars which contain only current module stuff. To run the app you still need to provide all the dependencies in claasspath. Shadow, on the other hand, generates so called fat jar, which contains both app classes and all the dependencies and can be run as is without setting up environment.
d
i see thank u
g
To run the app you still need to provide all the dependencies in claasspath.
Not like that, application creates executable jar and all required dependencies as separate jars and a script that runs it and configures classpath
a
Unfortunately I've run into a problem on Windows 8 using application plug-in. It was cmd was too long due to explicit jar names as arguments to java -cp. Work around is a semi manual step. Either customize the plugin to generate a different bat file or edit it after it is generated. For my project the 'fat' jat was 'only' 50 mb so I went with that solution. Ran into this 3-4 months back, maybe it's fixed by now. Not sure
g
Fat jar imo is good solution