title: How to run build twice so that I can get two artifacts using different dependencies?
body: <p>I've got a Maven project and we want to build two separate jars, one containing 32-bit libraries and one containing 64-bit libraries.</p>
  
  <p>Our current build will produce either 32 or 64-bit artifacts depending on the operating system on which the build is run.  </p>
  
  <p>An overview of how we're currently set up:</p>
  
  <pre><code>    &lt;properties&gt;
              &lt;env.arch&gt;${sun.arch.data.model}&lt;/env.arch&gt;
      &lt;/properties&gt;
  
      &lt;build&gt;
      &lt;pluginManagement&gt;
  
      &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                &lt;execution&gt;
                      &lt;id&gt;copy-native&lt;/id&gt;
                      &lt;phase&gt;process-resources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                      &lt;artifactItems&gt;
                      &lt;artifactItem&gt;
                          &lt;groupId&gt;artifact-for-${env.arch}&lt;/groupId&gt;
                          &lt;artifactId&gt;artifact.name&lt;/artifactId&gt;
                      &lt;/artifactItem&gt;
                          ...
  
                     &lt;plugin&gt;
                         &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
                         &lt;executions&gt;
                             &lt;execution&gt;
                                 &lt;phase&gt;package&lt;/phase&gt;
                             &lt;/execution&gt;
                         &lt;/executions&gt;
  </code></pre>
  
  <p>So what it's doing is copying the dependencies that match the value of our property for <code>${env.arch}</code>, then building the jar using the <code>maven-jar-plugin</code>.</p>
  
  <p>What we need to be able to do is produce 2 jars from one build... one containing the 32 bit dependencies and one containing the 64 bit dependencies.</p>
  
  <p>Can anyone offer any guidance to how we can get this done?</p>
  
  <p>Thanks</p>