Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to define a maven goal with a variable?
    primarykey
    data
    text
    <p>My question comes from wanting to run javadoc:aggregate for all projects except one, where I want to run javadoc:javadoc (because this one project has a sub-module that needs to use the sourcepath setting in its maven-javadoc-plugin config, as it has generated code as well as source).</p> <p>And as I understand it there is a bug which means that the sourcepath setting is ignored if you run the aggregate goal. I tried it myself and it did not work and I found: <a href="http://jira.codehaus.org/browse/MJAVADOC-311" rel="nofollow">http://jira.codehaus.org/browse/MJAVADOC-311</a></p> <p>I have a parent POM which defines the plugin config:</p> <pre><code>&lt;properties&gt; &lt;javadoc-goal&gt;aggregate&lt;/javadoc-goal&gt; &lt;properties&gt; </code></pre> <p>i.e.</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;generate-javadoc&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;${javadoc-goal}&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; ... &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>Then I have several projects which inherit from this project. The one where I need to run javadoc instead of aggregate would define:</p> <pre><code>&lt;javadoc-goal&gt;javadoc&lt;/javadoc-goal&gt; </code></pre> <p>and its sub-module would define its sourcepath:</p> <pre><code>&lt;reporting&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;sourcepath&gt;${basedir}/src/main/java:${basedir}/src/generated/java&lt;/sourcepath&gt; &lt;/configuration&gt; ... &lt;/plugin&gt; &lt;/plugins&gt; &lt;/reporting&gt; </code></pre> <p>I am guessing that the answer to my question is no, because when I try and install my parent POM it looks like it is treating the variable as a literal, which I found weird because you can use them in so many other places:</p> <pre><code>[ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] '${javadoc-goal}' was specified in an execution, but not found in the plugin </code></pre> <p>If I cannot do this, any ideas for working around this problem?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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