Where in the pom.xml do I configure the Javadoc Plugin?

Like all other site report plugins, the Javadoc Plugin goes in the <reporting/> section of your pom.xml.

Where do I put Javadoc resources like HTML files or images?

All javadoc resources like HTML files, images could be put in the ${basedir}/src/main/javadoc directory.

See Using Javadoc Resources for more information.

How to know exactly the Javadoc command line?

The Javadoc Plugin calls the Javadoc tool with argument files, i.e. files called 'options', 'packages' and 'argfile' (or 'files' with Jdk < 1.4): ${project.reporting.outputDirectory}/apidocs/javadoc.exe(or .sh) \ @options \ @packages | @argfile

These argument files are generated at runtime depending the Javadoc Plugin configuration and are deleted when the Javadoc Plugin ended.

To preserve them, just add <debug>true<debug> in your Javadoc Plugin configuration. In this case, an additional script file will be created.

How to add additional Javadoc parameters?

You could need to add more Javadoc parameters to be process by the Javadoc Tool (i.e. for doclet).

For this, you should use the <additionalparam/> parameter in your Javadoc Plugin configuration.

How to add additional Javadoc options?

You could need to add more J options (i.e. runtime system java options that runs Javadoc tool like -J-Xss) to be process by the Javadoc Tool. For this, you should use the <additionalJOption/> parameter in your Javadoc Plugin configuration.

The Javadoc Plugin calls the Javadoc tool with J options, i.e.: ${project.reporting.outputDirectory}/apidocs/javadoc.exe(or .sh) \ -J-Xss128m \ @options \ @packages | @argfile

How to increase Javadoc heap size?

If you need to increase the Javadoc heap size, you should use the <minmemory/> and <maxmemory/> parameters in your Javadoc Plugin configuration. For instance: ... org.apache.maven.plugins maven-javadoc-plugin ... 128m 1g ... ... ...

Note: The memory unit depends on the JVM used. The units supported could be: k, kb, m, mb, g, gb, t, tb. If no unit specified, the default unit is m.

How to add proxy support?

To specify a proxy in the Javadoc tool, you need to configure an active proxy in your settings.xml. Read the Configuring a proxy guide for more information.

The Javadoc Plugin calls the Javadoc tool with networking J options, i.e.: ${project.reporting.outputDirectory}/apidocs/javadoc.exe(or .sh) \ -J-Dhttp.proxySet=true \ -J-Dhttp.proxyHost=http://localhost \ -J-Dhttp.proxyPort=80 \ -J-Dhttp.nonProxyHosts="www.google.com|*.somewhere.com" \ -J-Dhttp.proxyUser="toto" \ -J-Dhttp.proxyPassword="toto" \ @options \ @packages | @argfile

How to have less output?

Just set the <quiet/> parameter to true in your Javadoc Plugin configuration.

How to remove test Javadocs report?

You need to configure the <reportSets/> parameter. Read the Selective Javadocs Reports part for more information.

How to deploy javadoc jar?

Basically, you need to call mvn clean javadoc:jar deploy. If you want to include the javadoc jar in a release process, you need to attach it in the release profile, for instance: ... release org.apache.maven.plugins maven-javadoc-plugin attach-javadocs jar ...

To deploy the Javadoc jar on a given Maven repository, you could call: mvn deploy:deploy-file \ -DgroupId=<group-id> \ -DartifactId=<artifact-id> \ -Dversion=<version> \ -Dfile=<path-to-file> \ -Dpackaging=jar \ -DrepositoryId=<repository-id> \ -Durl=dav:http://www.myrepository.com/m2 \ -Dclassifier=javadoc