title: how to integrate proguard using https in spring boot maven app using Java 11?
body: <p>I am trying to obfuscate a .jar app using Spring Boot 2.3.2, Java 11, Proguard maven plugin 2.3.1 and Proguard base 6.2.2 . My pom.xml looks like this:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>          &lt;plugin&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;assembly&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;single&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;configuration&gt;
                              &lt;descriptorRefs&gt;
                                  &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                              &lt;/descriptorRefs&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&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.3.1&lt;/version&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;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;obfuscate&gt;true&lt;/obfuscate&gt;
                        &lt;options&gt;
                          &lt;option&gt;-allowaccessmodification&lt;/option&gt;
                          &lt;option&gt;-dontoptimize&lt;/option&gt;
                          &lt;option&gt;-dontshrink&lt;/option&gt;
                          &lt;option&gt;-dontwarn&lt;/option&gt;
                          &lt;option&gt;-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
                          SourceFile,LineNumberTable,*Annotation*,EnclosingMethod&lt;/option&gt;
                          &lt;option&gt;-keep class !main { *; }&lt;/option&gt;
                          &lt;option&gt;-keep class service { *; }&lt;/option&gt;
                          &lt;option&gt;-keep class org.apache.** &lt;/option&gt;
                          &lt;option&gt;-ignorewarnings&lt;/option&gt;
                          &lt;option&gt;-keepclassmembers class * {
                              @org.springframework.beans.factory.annotation.Autowired *;
                              @org.springframework.beans.factory.annotation.Value *;
                              @org.springframework.boot.SpringApplication *;
                              @org.springframework.boot.autoconfigure.SpringBootApplication *;
                              @org.springframework.scheduling.annotation.EnableAsync *;
                              @org.springframework.context.event.EventListener *;
                              @org.springframework.boot.context.event.ApplicationReadyEvent *;
                              @org.apache.commons.lang3.exception.ExceptionUtils *;
                              @org.apache.http.conn.ConnectTimeoutException *;
                              @org.apache.http.conn.HttpHostConnectException *;
                              }
                          &lt;/option&gt;
                          &lt;option&gt;-keepdirectories /src/main/resources/** &lt;/option&gt;
                      &lt;/options&gt;
                      &lt;libs&gt;.. &lt;/libs&gt;
                       &lt;archive&gt;
                                              &lt;manifest&gt;
                                                  &lt;mainClass&gt; main &lt;/mainClass&gt;
                                                  &lt;packageName&gt;package&lt;/packageName&gt;
                                              &lt;/manifest&gt;
                                          &lt;/archive&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>During the execution process, I get this err:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:ssl/cert.p12'
  at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:161) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) ~[spring-context-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
  at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at com.app.AppGatewayApplication.main(AppGatewayApplication.java:178) ~[classes!/:0.0.1-SNAPSHOT]
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
  at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
  at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[appGateway-0.0.1-SNAPSHOT_proguard_base.jar:0.0.1-SNAPSHOT]
  at org.springframework.boot.loader.Launcher.launch(Launcher.java:109) ~[appGateway-0.0.1-SNAPSHOT_proguard_base.jar:0.0.1-SNAPSHOT]
  at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[appGateway-0.0.1-SNAPSHOT_proguard_base.jar:0.0.1-SNAPSHOT]
  at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[appGateway-0.0.1-SNAPSHOT_proguard_base.jar:0.0.1-SNAPSHOT]
  Caused by: java.lang.IllegalStateException: org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:ssl/cert.p12'
  at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.getKeyManagers(SslBuilderCustomizer.java:125) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.customize(SslBuilderCustomizer.java:75) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.web.embedded.undertow.UndertowWebServerFactoryDelegate.createBuilder(UndertowWebServerFactoryDelegate.java:162) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.getWebServer(UndertowServletWebServerFactory.java:266) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:158) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  ... 17 common frames omitted
  Caused by: org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:ssl/cert.p12'
  at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.loadStore(SslBuilderCustomizer.java:188) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.loadKeyStore(SslBuilderCustomizer.java:169) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.getKeyStore(SslBuilderCustomizer.java:143) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.getKeyManagers(SslBuilderCustomizer.java:110) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  ... 22 common frames omitted
  Caused by: java.io.IOException: DerInputStream.getLength(): lengthTag=111, too big.
  at java.base/sun.security.util.DerInputStream.getLength(DerInputStream.java:606) ~[na:na]
  at java.base/sun.security.util.DerValue.init(DerValue.java:390) ~[na:na]
  at java.base/sun.security.util.DerValue.&lt;init&gt;(DerValue.java:331) ~[na:na]
  at java.base/sun.security.util.DerValue.&lt;init&gt;(DerValue.java:344) ~[na:na]
  at java.base/sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1993) ~[na:na]
  at java.base/sun.security.util.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:222) ~[na:na]
  at java.base/java.security.KeyStore.load(KeyStore.java:1479) ~[na:na]
  at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.loadStore(SslBuilderCustomizer.java:184) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE]
  ... 25 common frames omitted</code></pre>
  </div>
  </div>
  </p>
  <p>I tried to use -keepdirectories option but the file that is not found previously is in src/main/resources/ssl, so I'm not sure if proguard knows how to find it and not obfuscate.</p>