title: Maven duplicates all my .class files in the JAR
body: <p>I've been having running optimizers on my JAR. I've always wondered why. Today I wanted to replace single <code>.class</code> file, and when I opened the jar, I looked at this in the <code>/cz/autoclient/</code> directory:</p>
  
  <p><img src="https://i.stack.imgur.com/flQFJ.png" alt="image description"></p>
  
  <p>No wonder archivers couldn't handle that mess. I found <a href="https://stackoverflow.com/a/7467971/607407">some advice on <code>maven-compiler-plugin</code></a> configuration, that didn't help. This is my build configuration in the <code>pom.xml</code>:</p>
  
  <pre><code>  &lt;build&gt;
      &lt;testSourceDirectory&gt;${test.dir}&lt;/testSourceDirectory&gt;
      &lt;sourceDirectory&gt;${src.dir}&lt;/sourceDirectory&gt;
      &lt;resources&gt;
        &lt;resource&gt;
          &lt;directory&gt;${resource.dir}&lt;/directory&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.2&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.8&lt;/source&gt;
            &lt;target&gt;1.8&lt;/target&gt;
            &lt;compilerArgument&gt;-proc:none&lt;/compilerArgument&gt;
          &lt;/configuration&gt;
        &lt;/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.2-beta-4&lt;/version&gt;
          &lt;configuration&gt;
            &lt;descriptorRefs&gt;
              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
            &lt;/descriptorRefs&gt;
            &lt;archive&gt;
              &lt;manifest&gt;
                &lt;mainClass&gt;cz.autoclient.Main&lt;/mainClass&gt;
              &lt;/manifest&gt;
            &lt;/archive&gt;
          &lt;/configuration&gt;
          &lt;executions&gt;
            &lt;execution&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;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.5&lt;/version&gt;
          &lt;configuration&gt;
            &lt;archive&gt;
              &lt;manifest&gt;
                &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                &lt;classpathPrefix&gt;src/&lt;/classpathPrefix&gt;
                &lt;mainClass&gt;cz.autoclient.Main&lt;/mainClass&gt;
              &lt;/manifest&gt;
            &lt;/archive&gt;
            &lt;outputDirectory&gt;${project.build.directory}/&lt;/outputDirectory&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
  
      &lt;/plugins&gt;
  
    &lt;/build&gt;
  </code></pre>
  
  <p>I really need to resolve it. Apart of the JAR optimizers, it also breaks java official tools:</p>
  
  <pre><code>jar uf AutoClient.jar version
  java.util.zip.ZipException: duplicate entry: cz/autoclient/autoclick/ColorPixel.class
          at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:233)
          at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109)
          at sun.tools.jar.Main.update(Main.java:630)
          at sun.tools.jar.Main.run(Main.java:269)
          at sun.tools.jar.Main.main(Main.java:1233)
  </code></pre>
  
  <p>What causes the duplicate class files and how to resolve this issue? Only files in <code>/cz/autoclient/</code> - that's the compiled source - seem to be duplicated.</p>