Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For Maven 3.0.x at least, when not specified, the ID for an execution is default-<em>goalName</em>. So for the example you have, the ID would be <code>default-check</code>. The value <code>default-cli</code> may also be used to configure command line executions.</p> <p>The execution IDs are used when creating the effective POM from the POM itself, any parent POMs (including the Maven super POM), and settings.xml. Maven merges configuration for plugin executions having the same ID across these POMs. Here's an example. Assume this plugin config is in a parent POM (only Maven super POM is higher up in the hierarchy.</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;!-- default-jar is the ID assigned to the jar:jar execution included automatically by Maven. This demonstrates how we can tweak the built-in plugin executions to meet our needs. Note we do not have to specify phase or goals, as those are inherited. In the example we add a configuration block and change the values of the &lt;forceCreation&gt; and &lt;finalName&gt; elements. --&gt; &lt;execution&gt; &lt;id&gt;default-jar&lt;/id&gt; &lt;configuration&gt; &lt;finalName&gt;firstJar&lt;/finalName&gt; &lt;forceCreation&gt;true&lt;/forceCreation&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;!-- Add an execution of the jar plugin to build a jar with the same contents but different name. We assign an execution ID. Because we are not inheriting config for this execution it's our responsibility to specify phase and goals, as well as the config we want. Executions are run in order so this one will run after the default. --&gt; &lt;execution&gt; &lt;id&gt;another-jar&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;jar&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;finalName&gt;duplicateJar&lt;/finalName&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;!-- Configure plugin behavior if we execute the jar:jar goal directly from the command line. Don't bind this to a phase; we don't want to run this as part of the normal lifecycle. --&gt; &lt;execution&gt; &lt;id&gt;default-cli&lt;/id&gt; &lt;configuration&gt; &lt;finalName&gt;cmdLineJar&lt;/finalName&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>With the above config:</p> <ul> <li>mvn clean package - builds firstJar.jar and duplicateJar.jar </li> <li>mvn jar:jar - builds cmdLineJar.jar (note, no clean lifecycle!) </li> <li>mvn clean jar:jar - removes target dir, builds empty (except for manifest) cmdLineJar.jar; because jar:jar does not run the full lifecycle, just one goal</li> <li>mvn clean prepare-package jar:jar - runs lifecycle thru prepare-package, then builds a non-empty cmdLineJar.jar</li> </ul>
    singulars
    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. 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.
 

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