Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In your <code>pom.xml</code>, you define two types of executions:</p> <ul> <li>One is linked to the <code>clean</code> phase</li> <li>One is linked to the <code>deploy</code> phase. Note, by the way, that for Maven, <code>deploy</code> does <strong>not</strong> mean <em>deploy my (web-)application on a server</em> but <em>deploy the artifact on a remote repository</em>. Please read the <a href="http://maven.apache.org/plugins/maven-deploy-plugin/"><code>deploy</code> plugin information</a> for more details.</li> </ul> <p>So if you run the command <strong>mvn deploy</strong>, when the Maven lifecycle reaches the <code>deploy</code> phase, it will run the plugin execution (the second one in your <code>pom.xml</code>).</p> <p>However, in your case, you are <strong>not</strong> running the default Maven lifecycle, as your command is <strong>mvn antrun:run</strong> (I am not considering the <code>clean</code> goal here as it does not matter for the problem). This can be translated in Maven to <em>run the antrun plugin, with the goal run</em>. The problem with that is that you do not define any configuration (which contains the Ant tasks) for a <em>direct</em> call to your Ant plugin.</p> <p>So two solutions:</p> <ul> <li>Bind the second execution to the <code>install</code> phase, and then run the <code>mvn clean install</code> instead of <code>mvn antrun:run</code>. Note that in this case, you will run the whole Maven lifecycle (i.e. compilation, tests, packaging).</li> <li>Create a configuration of this plugin that is <strong>not</strong> related to any execution. In XML point of view, simply add (or move) the second <code>&lt;configuration&gt;</code> block to be a child of the <code>&lt;plugin&gt;</code> definition.</li> </ul> <p>If you choose the second solution, you will have a <code>pom.xml</code> like this one:</p> <pre><code> &lt;plugin&gt; &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt; &lt;version&gt;1.6&lt;/version&gt; &lt;!-- For cleaning --&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;clean&lt;/id&gt; &lt;configuration&gt; &lt;task&gt; &lt;echo&gt;Cleaning deployed website&lt;/echo&gt; &lt;/task&gt; &lt;tasks&gt; &lt;delete dir="${deployRoot}/mydir/${env}"/&gt; &lt;/tasks&gt; &lt;/configuration&gt; &lt;phase&gt;clean&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;run&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;tasks&gt; &lt;echo&gt;Copying website artifact to deployment &lt;/echo&gt; ... &lt;/tasks&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload