title: Spring Boot Maven Project Obfuscation with Proguard
body: <p>I am using Java 11, Spring Boot 2.2.4  and Proguard 6.2.2.</p>
  
  <p>My pom.xml for proguard as follows</p>
  
  <pre><code>&lt;build&gt;
      &lt;finalName&gt;${artifactId}&lt;/finalName&gt;
      &lt;plugins&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;com.github.wvengen&lt;/groupId&gt;
              &lt;artifactId&gt;proguard-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.2.0&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;proguard&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;proguardVersion&gt;6.2.2&lt;/proguardVersion&gt;
                  &lt;injar&gt;${project.build.finalName}.jar&lt;/injar&gt;
                  &lt;outjar&gt;${project.build.finalName}.jar&lt;/outjar&gt;
                  &lt;includeDependency&gt;true&lt;/includeDependency&gt;
  
                  &lt;obfuscate&gt;true&lt;/obfuscate&gt;
                  &lt;proguardInclude&gt;${basedir}/proguard.conf&lt;/proguardInclude&gt;
                  &lt;injarNotExistsSkip&gt;true&lt;/injarNotExistsSkip&gt;
                  &lt;libs&gt;
                      &lt;lib&gt;${java.home}/jmods&lt;/lib&gt;
                      &lt;lib&gt;${java.home}/lib&lt;/lib&gt;
                  &lt;/libs&gt;
                  &lt;archive&gt;
                      &lt;manifest&gt;
                          &lt;mainClass&gt;Application&lt;/mainClass&gt;
                          &lt;packageName&gt;com.abc&lt;/packageName&gt;
                      &lt;/manifest&gt;
                  &lt;/archive&gt;
              &lt;/configuration&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;net.sf.proguard&lt;/groupId&gt;
                      &lt;artifactId&gt;proguard-base&lt;/artifactId&gt;
                      &lt;version&gt;6.2.2&lt;/version&gt;
                      &lt;scope&gt;runtime&lt;/scope&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;repackage&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;mainClass&gt;com.abc.Application&lt;/mainClass&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>My Proguard configuration (proguard.conf) as follows</p>
  
  <pre><code>-ignorewarnings
  -dontshrink
  -dontoptimize
  -keepdirectories
  -adaptclassstrings
  -useuniqueclassmembernames
  -dontusemixedcaseclassnames
  -flattenpackagehierarchy 'com.abc'
  -keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod
  
  -keep class com.abc.Application
  -keep class * extends org.springframework.boot.ApplicationRunner
  
  -keepclasseswithmembers public class * {
      public static void main(java.lang.String[]);
  }
  
  -keepclassmembers enum  * {
      public static **[] values();
      public static ** valueOf(java.lang.String);
  }
  
  -keepclasseswithmembers,includedescriptorclasses,allowshrinking class * {
      native &lt;methods&gt;;
  }
  </code></pre>
  
  <p>When I run the obfucated jar,  I am getting below error</p>
  
  <p>Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/spring-boot-starter-data-jpa-2.2.4.RELEASE.jar</p>
  
  <p>Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/spring-boot-starter-data-jpa-2.2.4.RELEASE.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</p>