title: How to generate an obfuscated jar file for a maven project
body: <p>I am working on a java application using maven architecture project in Eclipse IDE and  java 7 </p>
  
  <p>I need to generated an obfuscated a jar file which also must include all the dependencies obfuscated in it I've been checking some solutions around but I´ve been unable to get the desired result. </p>
  
  <p>Some of the places that I've checked are this:</p>
  
  <p><a href="https://stackoverflow.com/questions/17045474/obfuscate-dependencies-to-single-jar-with-proguard">Lin1</a>,<a href="https://stackoverflow.com/questions/21275911/working-maven-obfuscate-example">Link2</a>, <a href="https://stackoverflow.com/questions/8774898/proguard-configuration-on-a-enterprise-java-application">Link3</a></p>
  
  <p>from the two first links I based most of my current implementation</p>
  
  <p>this is my pom.xml file:</p>
  
  <p>pom.xml</p>
  
  <pre><code>&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;modeloconfigurador.cache&lt;/groupId&gt;
      &lt;artifactId&gt;CacheClienteModelC&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;modeloconfigurador.cache&lt;/groupId&gt;
              &lt;artifactId&gt;Serializer&lt;/artifactId&gt;
              &lt;version&gt;1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
              &lt;artifactId&gt;gson&lt;/artifactId&gt;
              &lt;version&gt;2.2.4&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-codec&lt;/groupId&gt;
              &lt;artifactId&gt;commons-codec&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.json&lt;/groupId&gt;
              &lt;artifactId&gt;json&lt;/artifactId&gt;
              &lt;version&gt;20140107&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!--&lt;dependency&gt; --&gt;
          &lt;!--&lt;groupId&gt;com.pyx4me&lt;/groupId&gt; --&gt;
          &lt;!--&lt;artifactId&gt;proguard-maven-plugin&lt;/artifactId&gt; --&gt;
          &lt;!--&lt;version&gt;2.0.4&lt;/version&gt; --&gt;
          &lt;!-- &lt;/dependency&gt; --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sf.proguard&lt;/groupId&gt;
              &lt;artifactId&gt;proguard-base&lt;/artifactId&gt;
              &lt;version&gt;4.10&lt;/version&gt;
          &lt;/dependency&gt;
  
  
      &lt;/dependencies&gt;
  
  
      &lt;build&gt;
          &lt;finalName&gt;CacheClienteModelC&lt;/finalName&gt;
          &lt;plugins&gt;
  
              &lt;!-- download source code in Eclipse, best practice --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.9&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;downloadSources&gt;true&lt;/downloadSources&gt;
                      &lt;downloadJavadocs&gt;false&lt;/downloadJavadocs&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;!-- Set a compiler level --&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;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
  
                      &lt;source&gt;${jdk.version}&lt;/source&gt;
                      &lt;target&gt;${jdk.version}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;!-- Maven Assembly Plugin --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.4.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;!-- get all project dependencies --&gt;
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                      &lt;/descriptorRefs&gt;
                      &lt;!-- MainClass in mainfest make a executable jar --&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;mainClass&gt;main.Main&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
  
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;make-assembly&lt;/id&gt;
                          &lt;!-- bind to the packaging phase --&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;single&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  
              &lt;!-- comienza configuracion proguard --&gt;
  
  
              &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.10&lt;/proguardVersion&gt;
                      &lt;options&gt;
  
                          &lt;injar&gt;${project.build.finalName}.jar&lt;/injar&gt;
                          &lt;outjar&gt;${project.build.finalName}-small.jar&lt;/outjar&gt;
                          &lt;!-- &lt;injar&gt;CacheClienteModelC-jar-with-dependencies.jar&lt;/injar&gt; --&gt;
                          &lt;!-- &lt;outjar&gt;CacheClienteModelC-small.jar&lt;/outjar&gt; --&gt;
                          &lt;option&gt;-allowaccessmodification&lt;/option&gt;
                          &lt;option&gt;-keep public class main.Main { *; }&lt;/option&gt;
                      &lt;/options&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;/libs&gt;
                  &lt;/configuration&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;4.10&lt;/version&gt;
                          &lt;!--&lt;version&gt;5.2.1&lt;/version&gt; --&gt;
                      &lt;/dependency&gt;
  
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
  
  
              &lt;!-- termina configuracion proguard --&gt;
          &lt;/plugins&gt;
  
  
      &lt;/build&gt;
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>the error  I'm getting is the following:</p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal
    com.pyx4me:proguard-maven-plugin:2.0.4:proguard (default) on project
    CacheClienteModelC: Can't rename
    E:\Users\B267481\Documents\ServidorDesarroCreditoAcertum\CacheClienteModelC\target\CacheClienteModelC.jar
    -> [Help 1]</p>
  </blockquote>
  
  <h2>EDIT</h2>
  
  <p>Just to make things more clear
  When I build the project, two diferent jars are generated at the target folder (CacheClienteModelC-jar-with-dependecies.jar and CacheClienteModelC.jar), the file that I try to generate is  CacheClienteModelC-small.jar (obfuscated jar) which is never created.</p>
  
  <p>How should I configure the plugin to obfuscate my project's file? </p>