Details
-
Type:
New Feature
-
Status:
Open
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
Description
<shameless copy-paste from the mailing list>
I think I'm missing the concept of 'fat jar' in Gradle. Many times
when I worked on a library/console app I needed to stick all
dependencies in single jar. It would be great if java plugin added
extra task that could produce fat jar (or mavenized:
jar-with-dependencies) out of the box.
It would be easy to provide such a fatJar task for the default jar task. This would be the framework way of doing things (like Maven does).
But it would be much cooler, if there were the pattern fat<JarName> which works for any jar that is related to source directories. To make this possible we need a richer abstraction for source directories which we plan to do for 0.8. If we have such source dir objects you could also define a jar like:
task mySrcJar {
add srcDir // srcDir is not String but a rich object, which knows all of the srcDir including its classpath
fat = true
}
This would work with any project layout, not just with single src root projects. And it would enable to provide a rule for a pattern like above.
Toolset over Framework rules ![]()
<you bet!>
Hi Szczepan,
Thomas Kinnen was kind to provide a solution for fat-jar creation - see http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-Creatingafatjar
It is not a fully-fledged solution, but can be sufficient in some cases.
–
Tomek