Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problem here is that I don't know what is <strong>expected</strong>. With your current setup, invoking the plugin on the command line would just work:</p> <pre> $ mvn exec:exec [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building Q3491937 [INFO] task-segment: [exec:exec] [INFO] ------------------------------------------------------------------------ [INFO] [exec:exec {execution: default-cli}] [INFO] laptop [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ ... </pre> <p>The global <code>configuration</code> is used, the <code>hostname</code> command is executed (<code>laptop</code> is my hostname). In other words, the plugin works as expected.</p> <p>Now, if you want a plugin to get executed <strong>as part of the build</strong>, you have to <strong>bind</strong> a goal on a specific phase. For example, to bind it on <code>compile</code>:</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.1.1&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;some-execution&lt;/id&gt; &lt;phase&gt;compile&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;exec&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;executable&gt;hostname&lt;/executable&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre> <p>And then:</p> <pre> $ mvn compile [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building Q3491937 [INFO] task-segment: [compile] [INFO] ------------------------------------------------------------------------ [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /home/pascal/Projects/Q3491937/src/main/resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Nothing to compile - all classes are up to date [INFO] [exec:exec {execution: some-execution}] [INFO] laptop [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ ... </pre> <p>Note that you can specify a <code>configuration</code> inside an <code>execution</code>.</p>
 

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