title: ProGuard doesn't obfuscate JAR with dependencies
body: <p>I have a project with the <code>pom.xml</code> file given below. When I issue the command <code>mvn clean compile assembly:single install</code> I want Maven to generate a JAR, which contains</p>
  
  <ul>
  <li>all the dependencies and</li>
  <li>obfuscated version of my code.</li>
  </ul>
  
  <p>It doesn't work - my code is not obfuscated in the "jar-with-dependencies" file.</p>
  
  <p>When I run <code>mvn clean compile install</code> the resulting file contains obfuscated code of my application, but no dependencies.</p>
  
  <p>What can I do in order to have a JAR file with all the dependencies and my obfuscated code?</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
      &lt;artifactId&gt;myproduct&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;properties&gt;
          &lt;restlet-version&gt;2.3.5&lt;/restlet-version&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.spongepowered&lt;/groupId&gt;
              &lt;artifactId&gt;spongeapi&lt;/artifactId&gt;
              &lt;version&gt;3.0.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.12&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.easytesting&lt;/groupId&gt;
              &lt;artifactId&gt;fest-assert-core&lt;/artifactId&gt;
              &lt;version&gt;2.0M8&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
              &lt;version&gt;1.10.19&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.restlet.jse&lt;/groupId&gt;
              &lt;artifactId&gt;org.restlet&lt;/artifactId&gt;
              &lt;version&gt;${restlet-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.restlet.jse&lt;/groupId&gt;
              &lt;artifactId&gt;org.restlet.ext.jackson&lt;/artifactId&gt;
              &lt;version&gt;${restlet-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;
              &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;${project.basedir}/src/main/resources&lt;/directory&gt;
                  &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.3&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;templating-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.0-alpha-3&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;filter-src&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;filter-sources&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                      &lt;/descriptorRefs&gt;
                  &lt;/configuration&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.0.8&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;5.2&lt;/proguardVersion&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;-dontnote&lt;/option&gt;
                          &lt;option&gt;-keepattributes Signature&lt;/option&gt;
                          &lt;option&gt;-keep class com.mycompany.MyPlugin { *; }&lt;/option&gt;
                      &lt;/options&gt;
                      &lt;libs&gt;
                          &lt;lib&gt;${java.home}/lib/rt.jar&lt;/lib&gt;
                      &lt;/libs&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&lt;/version&gt;
                              &lt;scope&gt;runtime&lt;/scope&gt;
                          &lt;/dependency&gt;
                      &lt;/dependencies&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>Update 1 (17.01.2016 19:54 MSK):</strong> Changed the ProGuard configuration like shown below, but <code>mvn clean compile assembly:single</code> still produces a JAR with unobfuscated class files.</p>
  
  <pre><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.8&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;5.2&lt;/proguardVersion&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;-dontnote&lt;/option&gt;
              &lt;option&gt;-keepattributes Signature&lt;/option&gt;
              &lt;option&gt;-keep class com.mycompany.MyPlugin { *; }&lt;/option&gt;
          &lt;/options&gt;
          &lt;injar&gt;${project.build.finalName}-jar-with-dependencies.jar&lt;/injar&gt;
          &lt;libs&gt;
              &lt;lib&gt;${java.home}/lib/rt.jar&lt;/lib&gt;
          &lt;/libs&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&lt;/version&gt;
                  &lt;scope&gt;runtime&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p><strong>Update 2 (17.01.2016 20:29 MSK):</strong> <code>mvn clean compile assembly:single install</code> fails. The last messages can be seen <a href="https://www.evernote.com/shard/s35/sh/278de801-ac5c-41d5-bd12-55e4c006b1af/0cc6004df2b49c34ff6198e4a7e52875" rel="noreferrer">here</a>.</p>