title: Obfuscate jar with embedded jar
body: <p>I want to obfuscate jar with embedded jar for Java mail:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
      &lt;groupId&gt;com.sun.mail&lt;/groupId&gt;
      &lt;artifactId&gt;javax.mail&lt;/artifactId&gt;
      &lt;version&gt;1.5.4&lt;/version&gt;
      &lt;type&gt;jar&lt;/type&gt;
  &lt;/dependency&gt;
  ......
  &lt;plugin&gt;
      &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
      &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.0.0&lt;/version&gt;
      &lt;extensions&gt;true&lt;/extensions&gt;
      &lt;configuration&gt;
          &lt;instructions&gt;
              &lt;!-- Embed dependency into the bundle--&gt;
              &lt;Embed-Dependency&gt;javax.mail;inline=true&lt;/Embed-Dependency&gt;
              &lt;Bundle-Version&gt;${project.version}&lt;/Bundle-Version&gt;
              &lt;Bundle-SymbolicName&gt;${project.artifactId}&lt;/Bundle-SymbolicName&gt;
          &lt;/instructions&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>Proguard configuration</p>
  
  <pre class="lang-xml prettyprint-override"><code>&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.0.11&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;5.2.1&lt;/version&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;5.2.1&lt;/proguardVersion&gt;
          &lt;obfuscate&gt;true&lt;/obfuscate&gt;
          &lt;injarNotExistsSkip&gt;true&lt;/injarNotExistsSkip&gt;
          &lt;injar&gt;${project.build.finalName}.jar&lt;/injar&gt;
          &lt;outjar&gt;${project.build.finalName}.jar&lt;/outjar&gt;
          &lt;options&gt;
              &lt;option&gt;-keep public class org.package.engine.osgi.impl&lt;/option&gt;
              &lt;option&gt;-keep public interface org.package.engine.osgi&lt;/option&gt;
          &lt;/options&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.sun.mail&lt;/groupId&gt;
                  &lt;artifactId&gt;javax.mail&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
          &lt;libs&gt;
              &lt;lib&gt;${java.home}/lib/rt.jar&lt;/lib&gt;
              &lt;lib&gt;${java.home}/lib/jce.jar&lt;/lib&gt;
              &lt;lib&gt;${java.home}/lib/ext/jfxrt.jar&lt;/lib&gt;
          &lt;/libs&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I get this error during compilation time</p>
  
  <pre><code>proguard jar: C:\Users\user\.m2\repository\net\sf\proguard\proguard-base\5.2.1\proguard-base-5.2.1.jar
       [proguard] ProGuard, version 5.2.1     
       [proguard] Reading library jar [C:\Users\user\.m2\repository\org\osgi\org.osgi.core\6.0.0\org.osgi.core-6.0.0.jar]
       [proguard] Reading library jar [C:\Users\user\.m2\repository\org\apache\karaf\shell\org.apache.karaf.shell.core\4.0.1\org.apache.karaf.shell.core-4.0.1.jar]
       [proguard] Reading library jar [C:\Users\user\.m2\repository\jline\jline\2.12\jline-2.12.jar]               
       .............         
       [proguard]       Maybe this is library method 'java.util.Comparators$NullComparator { java.util.Comparator reversed(); }'
       [proguard] Warning: there were 1 instances of library classes depending on program classes.
       [proguard]          You must avoid such dependencies, since the program classes will
       [proguard]          be processed, while the library classes will remain unchanged.
       [proguard]          (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
       [proguard] Error: Please correct the above warnings first.
       [proguard] Note: there were 5 accesses to class members by means of introspection.
       [proguard]       You should consider explicitly keeping the mentioned class members
       [proguard]       (using '-keep' or '-keepclassmembers').
       [proguard]       (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
  </code></pre>
  
  <p>Full error stack <a href="http://pastebin.com/hmhv0Yvs" rel="noreferrer">http://pastebin.com/hmhv0Yvs</a></p>