2

I am working to solve spring boot jar obfuscation with yguard with gradle scripting. But not bale to succeded till now after long hours.

Can someone point me with any good documentation or examples

obfuscation works with plain jar , but after adding spring boot jar lot of issues. I am not obfuscating org(spring boot loader classes inside boot jar) folder. I am getting error ...

Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/HikariCP-3.4.2.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file
Slok
  • 576
  • 1
  • 12
  • 27

1 Answers1

2

Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/HikariCP-3.4.2.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file

As per your highligted error message, I suggest configure not to compress the jar.

The jar and war plugins have an entryCompression property. If set to ZipEntryCompression.STORED the entries of the archive are left uncompressed.

Example:

jar {
     entryCompression = ZipEntryCompression.STORED
}

From Gradle API Documentation

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.

fabfas
  • 2,200
  • 1
  • 21
  • 21