Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract required libraries into generated Jar with Gradle

Tags:

java

gradle

jar

I'm trying to build a (fat) jar with gradle to the likes of what is being generated by eclipse when choosing export->runnable jar and the option Extract required libraries into generated.

Eclipse extracts all linked jars into the new jar. In ant this looks like this:

<zipfileset excludes="META-INF/*.SF" src="./lib/soot-trunk.jar"/>

How can I do the same thing with gradle?

like image 296
Martin Schäf Avatar asked Oct 31 '22 23:10

Martin Schäf


1 Answers

In order to create a fat jar this plugin is used. You need to invoke a shadowJar task.

like image 196
Opal Avatar answered Nov 15 '22 05:11

Opal