Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Jar Compression

Tags:

gradle

jar

Is there a way to get Gradle to NOT compress the files when using the "jar" task?

I can't for the life of me find any reference to setting the compression settings for a jar.

like image 614
George Smith Avatar asked Jan 16 '23 13:01

George Smith


2 Answers

This may only be in the newer version of gradle, but you can now specify entryCompression for your jar task:

ZipEntryCompression entryCompression

The compression level of the entries of the archive. If set to ZipEntryCompression.DEFLATED (the default), each entry is compressed using the DEFLATE algorithm. If set to ZipEntryCompression.STORED the entries of the archive are left uncompressed.

like image 130
KennethJ Avatar answered Jan 18 '23 03:01

KennethJ


Gradle's Jar task doesn't currently support any compression options. To generate an uncompressed Jar, use the Ant task.

like image 45
Peter Niederwieser Avatar answered Jan 18 '23 04:01

Peter Niederwieser