Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can bind the execution of each plugin to the same phase and they will be executed in the order you specify. Note they will be executed after the deploy goal has run, so you might want to bind them to the previous phase (install)</p> <p>Update: to ensure the <em>execution-before</em> and <em>execution-after</em> goals are executed around the dependency plugin execution, you'll need to ensure they are defined in separate plugins. Otherwise the two configurations will be merged and executed sequentially.</p> <p>If the two executions need to be defined in the same plugin, you can do this by defining a custom lifecycle and invoking that lifecycle before your Mojo is executed via the execute annotation. In <a href="https://stackoverflow.com/questions/1427740/how-do-i-execute-a-set-of-goals-before-my-maven-plugin-runs/1427783#1427783">this answer</a> I described how to create a custom lifecycle and force it to be invoked before a plugin is run. If you configure the <em>execute-after</em> goal to invoke the dependency-plugin you'll get the execution order you want (you could even invoke the <em>execute-before</em> goal in that lifecycle as well).</p> <p>The example below will execute the three plugins in order during the deploy phase:</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;custom.url.plugin&lt;/groupId&gt; &lt;artifactId&gt;maven-url-plugin&lt;/artifactId&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;deploy&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;execution-before&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;version&gt;2.1&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;deploy&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;unpack&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;custom.url.plugin&lt;/groupId&gt; &lt;!--specify final execution in a different plugin to avoid the configurations being merged--&gt; &lt;artifactId&gt;maven-url-2-plugin&lt;/artifactId&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;deploy&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;execution-after&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre>
 

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