Search code examples
javamavenjavadocmaven-site-pluginmaven-javadoc-plugin

How to avoid calling javadoc more than once if creating a site?


I would like to deploy an artifact together with javadoc and a Maven site. I use

clean javadoc:jar site deploy site:deploy

(the split between site and site:deploy is just to avoid the deployment of a site if deploy fails).

Now the javadoc is created twice - once in javadoc:jar and once in site. Is it possible to create it just once and use it both for the javadoc-jar in Nexus and the Maven site?


Solution

  • I'm pretty sure the plugin is missing a check if the output is already generated as part of the Maven session. Would be a nice improvement to verify if the output is generated after Maven had started. (and let's add a force-parameter to enforce the creation anyway).