title: How can I create a tar file that contains my jar-with-dependacies along with other files?
body: <p>Currently I am able to create a tar that contains my jar and other files, but because the jar-with-dependancies is built after the tar file, it is not included. How can I get maven to build the jar-with-dependancies first so it will be included in the tar?</p>
  
  <p>pom:  </p>
  
  <pre><code>        &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;3.1.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;descriptorRefs&gt;
                      &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                  &lt;/descriptorRefs&gt;
  
                  &lt;descriptors&gt;
                      &lt;descriptor&gt;src/assembly/bin.xml&lt;/descriptor&gt;
                  &lt;/descriptors&gt;
                  &lt;finalName&gt;JAR-NAME-${project.version}&lt;/finalName&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;make-assembly&lt;/id&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;
  </code></pre>
  
  <p>bin.xml:  </p>
  
  <pre><code>&lt;assembly&gt;
      &lt;id&gt;bin&lt;/id&gt;
  
      &lt;formats&gt;
          &lt;format&gt;tar.gz&lt;/format&gt;
      &lt;/formats&gt;
  
      &lt;fileSets&gt;
          &lt;fileSet&gt;
              &lt;directory&gt;target&lt;/directory&gt;
              &lt;outputDirectory&gt;bin&lt;/outputDirectory&gt;
              &lt;includes&gt;
                  &lt;include&gt;JAR-NAME-*.jar&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/fileSet&gt;
  
          &lt;fileSet&gt;
              // Unrelated files
          &lt;/fileSet&gt;
  
          &lt;fileSet&gt;
              // Unrelated files
          &lt;/fileSet&gt;
      &lt;/fileSets&gt;
  &lt;/assembly&gt;
  </code></pre>