Best approach Gradle multi-module project: generate just one global javadoc

Using @eric_deandrea 's version I got an exception:

package javax.portlet does not exist

which has resolved by adding the following code to the task:

options.addStringOption("sourcepath", "")

Google did not get me the correct answer, hope this will help others.