title: How to assembly a project after using proguard-maven-plugin
body: <p>I am trying to add an obfuscation step while packaging my app. I supposed that I had to insert the Proguard plugin between the compiler plugin and the assembly (the assembly just put all of my app and dependencies into one single jar).</p>
  
  <pre><code>&lt;build&gt;
      &lt;finalName&gt;myApp&lt;/finalName&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.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.7&lt;/source&gt;
                  &lt;target&gt;1.7&lt;/target&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.11&lt;/version&gt;
               &lt;executions&gt;
                    &lt;execution&gt;
                    &lt;id&gt;obfuscation-packaging&lt;/id&gt;
                    &lt;phase&gt;package&lt;/phase&gt;
                    &lt;goals&gt;
                        &lt;goal&gt;proguard&lt;/goal&gt;
                    &lt;/goals&gt;
                    &lt;configuration&gt;
                        &lt;proguardVersion&gt;5.2&lt;/proguardVersion&gt;
                        &lt;obfuscate&gt;true&lt;/obfuscate&gt;
                        &lt;attach&gt;true&lt;/attach&gt;
                        &lt;appendClassifier&gt;false&lt;/appendClassifier&gt;
                        &lt;addMavenDescriptor&gt;true&lt;/addMavenDescriptor&gt;
                        &lt;injar&gt;${project.build.finalName}.jar&lt;/injar&gt;
                        &lt;outjar&gt;${project.build.finalName}.jar&lt;/outjar&gt;
                        &lt;injarNotExistsSkip&gt;true&lt;/injarNotExistsSkip&gt;
                        &lt;libs&gt;
                            &lt;lib&gt;${java.home}/lib/rt.jar&lt;/lib&gt;
                        &lt;/libs&gt;
  
                        &lt;options&gt;
                            ...
                        &lt;/options&gt;
                    &lt;/configuration&gt;
                &lt;/execution&gt;
            &lt;/executions&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;/dependency&gt;
            &lt;/dependencies&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;create-executable-jar&lt;/id&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;single&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;descriptors&gt;
                              &lt;descriptor&gt;assembly.xml&lt;/descriptor&gt;
                          &lt;/descriptors&gt;
                          &lt;archive&gt;
                              &lt;manifest&gt;
                                  &lt;mainClass&gt;myApp.Main&lt;/mainClass&gt;
                              &lt;/manifest&gt;
                          &lt;/archive&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>The compiling works fine, so does the obfuscation, but the assembly seems to be made with the normal jar, not the obfuscated one.</p>
  
  <p>Here is my assembly.xml if needed:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;assembly&gt;
         &lt;id&gt;with-dep&lt;/id&gt;
         &lt;formats&gt;
           &lt;format&gt;jar&lt;/format&gt;
         &lt;/formats&gt;
         &lt;includeBaseDirectory&gt;false&lt;/includeBaseDirectory&gt;
         &lt;dependencySets&gt;
           &lt;dependencySet&gt;
             &lt;!-- unpack les dépendances avant de les inclures dans le jar final de l'application --&gt;
             &lt;unpack&gt;true&lt;/unpack&gt;
             &lt;scope&gt;runtime&lt;/scope&gt;
             &lt;useProjectArtifact&gt;false&lt;/useProjectArtifact&gt;
           &lt;/dependencySet&gt;
         &lt;/dependencySets&gt;
         &lt;fileSets&gt;
           &lt;fileSet&gt;
             &lt;directory&gt;${project.build.outputDirectory}&lt;/directory&gt;
             &lt;outputDirectory&gt;&lt;/outputDirectory&gt;
           &lt;/fileSet&gt;
         &lt;/fileSets&gt;
      &lt;/assembly&gt;
  </code></pre>
  
  <p>In the end, myApp.jar is obfuscated, but myApp-with-dep.jar is not...
  I also precise that I'm not quite sure about the configuration of my proguard plugin. If you see something weird, say it.</p>
  
  <p>Thanks for your time.</p>