title: Java 7 | Obfuscation with Proguard 4.8
body: <p>I'm trying to obfuscate my project in java 7 with Proguard 4.8.</p>
  
  <p>Here is my maven plugin configuration:</p>
  
  <pre><code>            &lt;plugin&gt;
              &lt;groupId&gt;com.pyx4me&lt;/groupId&gt;
              &lt;artifactId&gt;proguard-maven-plugin&lt;/artifactId&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;4.8&lt;/proguardVersion&gt;
                  &lt;obfuscate&gt;true&lt;/obfuscate&gt;
  
                  &lt;options&gt;
                      &lt;option&gt;-ignorewarnings&lt;/option&gt;
                      &lt;option&gt;-dontshrink&lt;/option&gt;
                      &lt;option&gt;-dontoptimize&lt;/option&gt;
                      &lt;option&gt;-allowaccessmodification&lt;/option&gt;
                      &lt;option&gt;-keep class !ua.com.sintez.exceptions.** { *; }&lt;/option&gt;
                  &lt;/options&gt;
                  &lt;injar&gt;${project.build.finalName}.jar&lt;/injar&gt;
                  &lt;outjar&gt;${project.build.finalName}-proguard.jar&lt;/outjar&gt;
                  &lt;outputDirectory&gt;${project.build.directory}&lt;/outputDirectory&gt;
                  &lt;libs&gt;
                      &lt;lib&gt;${java.home}/lib/rt.jar&lt;/lib&gt;
                      &lt;lib&gt;${java.home}/lib/jsse.jar&lt;/lib&gt;
                  &lt;/libs&gt;
                  &lt;addMavenDescriptor&gt;false&lt;/addMavenDescriptor&gt;
              &lt;/configuration&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;net.sf.proguard&lt;/groupId&gt;
                      &lt;artifactId&gt;proguard&lt;/artifactId&gt;
                      &lt;version&gt;4.8&lt;/version&gt;
                      &lt;scope&gt;runtime&lt;/scope&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>I tried to obfuscate only one package "ua.com.mycompany.exceptions" to see if it works at all.
  That package doesn't contain anything concerning JPA. The persistence.xml is in its place and all entities are present there. But when I start the program I get the following error:</p>
  
  <pre><code>        The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units.&lt;br/&gt; 
  java.lang.IllegalArgumentException: Unknown entity bean class: class ua.com.mycompany.entity.Currency, please verify that this class has been marked with the @Entity annotation.&lt;br/&gt; 
  java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager: Exception Description: Problem compiling [select count(p) from Product as p]. 
  The abstract schema type 'Product' is unknown.
  </code></pre>
  
  <p>So I've the following questions:</p>
  
  <ol>
  <li>What may be the cause of that error?</li>
  <li>Is the proguard configuration wrong?</li>
  <li>I'm also getting a huge number of this: <code>Note: duplicate definition of library class ...</code> and numerous warnngs like this: <code>Warning:net.sf.jasperreports.compilers.JavaScriptEvaluator: can't find referenced class org.mozilla.javascript.Context</code>. <br/>Is it okay and if it is, how can I suppress that?</li>
  </ol>