title: What is the correct maven2 phase for deployment into application server?
body: <p>I'm trying to configure <code>pom.xml</code> so that it automatically deploys EAR archive to GlassFish application server. I want to attach this operation to the proper maven <em>execution phase</em>. But can't understand which one is dedicated just for this operation? Deploy? Install? Please, help. This is what I'm doing:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;phase&gt;deploy&lt;/phase&gt;
              &lt;configuration&gt;
                  &lt;tasks&gt;
                      &lt;copy file="${project.build.directory}/${project.build.finalName}.ear" 
                          tofile="${glassfish.home}/domains/domain1/autodeploy"/&gt;
                  &lt;/tasks&gt;
              &lt;/configuration&gt;
              &lt;goals&gt;
                  &lt;goal&gt;run&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>When I'm doing <code>mvn deploy</code>, maven is trying to deploy my artifacts to repository. This is not what I'm going to accomplish. I feel that the execution phase is wrong..</p>