Creating a 'fat jar' and copying it to a directory


(Alan Darkworld) #1

Hello everyone,

I’m new to gradle and I just got my first gradle project up and running! I’m using Eclipse and the gradle Eclipse plug-ins.

What I’d like to do is to create a *.jar file of the entire gradle project that includes all classes of all dependencies (so a really fat jar file that contains everything) and copy it to a location on my hard drive. I’d like to do this on every compile of the project.

I’m certain that this is possible, but being the gradle noob that I am, I couldn’t find the relevant chapter in the documentation :frowning: Unfortunately the DSL intellisense for build.gradle files isn’t very helpful in this case either…

Any help would be much appreciated!


(Peter Niederwieser) #2

It’s a common question, and you should find several answers both here and on Stack Overflow.