This example demonstrates how to use post-processing to obfuscate jar files that use non-conformant folders (such as BOOT-INF
).
This example will use a Spring Boot starter application.
Basically, the process runs through the following steps:
- compile and package the Spring Boot Application
- extract
classes
fromBOOT_INF
- use a standard obfuscation scheme which will leave libraries unobfuscated
- package the classes from the obfuscated JAR back into the JAR packaged in step 1
The steps are illustrated with command line instructions below.
# package the spring boot application with obfuscated application classes
mvn clean package
gradle clean build
ant clean obfuscate