title: Maven: Is it possible to create a fat jar containing only dependencies and a jar with only application code?
body: <p>I used following in my <code>pom.xml</code> to create the fat jar:</p>
  
  <pre><code>&lt;plugin&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&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;configuration&gt;
                &lt;descriptorRefs&gt;
                  &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                &lt;/descriptorRefs&gt;
              &lt;/configuration&gt;
        &lt;/plugin&gt;
  </code></pre>
  
  <p>But this includes the application code as well. I want to make 2 jars, one with only application code and another single jar with only dependencies. </p>
  
  <p>I also tried this:</p>
  
  <pre><code>&lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.5.1&lt;/version&gt;
              &lt;executions&gt;
                &lt;execution&gt;
                  &lt;id&gt;copy-dependencies&lt;/id&gt;
                  &lt;phase&gt;package&lt;/phase&gt;
                  &lt;goals&gt;
                  &lt;goal&gt;copy-dependencies&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;configuration&gt;
                  &lt;outputDirectory&gt;${project.build.directory}/lib/&lt;/outputDirectory&gt;
                  &lt;/configuration&gt;
                &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>but it just puts all the dependency jars in a single folder.</p>