title: maven-assembly-plugin run multiple times, configure to run only once
body: <p>Small question regarding maven-assembly-plugin please.</p>
  <p>I am currently configuring as follow:</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.3.0&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;build&lt;/id&gt;
                          &lt;configuration&gt;
                              &lt;archive&gt;
                                  &lt;manifest&gt;
                                      &lt;mainClass&gt;my.Main&lt;/mainClass&gt;
                                  &lt;/manifest&gt;
                              &lt;/archive&gt;
                              &lt;descriptorRefs&gt;
                                  &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                              &lt;/descriptorRefs&gt;
                              &lt;finalName&gt;${project.artifactId}-mymain&lt;/finalName&gt;
                              &lt;outputDirectory&gt;./&lt;/outputDirectory&gt;
                          &lt;/configuration&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>This has nothing special, copied from the official website on how to configure.</p>
  <p>Now, we use a CI tool, the CI tool, which we do not control, will run the following steps (we cannot change it)</p>
  <pre><code>compile:
  maven  -DskipTests clean package
  
  test
  maven verify
  
  stage
  maven -skipTests deploy
  </code></pre>
  <p>It will run the three steps separately, again, nothing I can do about it.</p>
  <p>Now, the thing it, it seems with the current <code>maven-assembly-plugin</code> as configured above, the uber jar is built once each stage, resulting in a total of 3 jars being built.</p>
  <p>How to configure the plugin, to avoid being built and rebuilt, hoping to be built only in one specific phase please?</p>
  <p>Thank you</p>