17.08.2016 Views

Apache Maven 3 Cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 9<br />

Documentation for an <strong>Apache</strong> <strong>Maven</strong> plugin project can be automatically generated.<br />

The command for doing so is as follows:<br />

$ mvn site<br />

2. Verify that plugin documentation adheres to the <strong>Maven</strong> community standards by<br />

running the command:<br />

$ mvn docck:check<br />

How it works...<br />

The mvn site command will automatically generate a plugin site for your plugin project<br />

based on available information in the project POM file, the src/site folder, and available<br />

reporting plugins.<br />

The <strong>Maven</strong> plugin is an important reporting plugin as it leads to the generation of<br />

documentation for each MOJO and thus for each plugin goal.<br />

The first step for ensuring good documentation is to achieve completeness of the project's<br />

POM file. Make sure all optional elements in the project object model are filled in including<br />

organization details, names, descriptions, URLs, mailing lists, licenses, issue/bug trackers,<br />

source code repositories, and so on.<br />

There's more<br />

Additional recommended reporting plugins for your <strong>Maven</strong> plugin project are:<br />

ff<br />

ff<br />

<strong>Maven</strong> Javadoc plugin<br />

<strong>Maven</strong> JXR plugin<br />

The following example shows how both can be included in your pom.xml file in the<br />

reporting element:<br />

<br />

<br />

<br />

org.apache.maven.plugins<br />

maven-javadoc-plugin<br />

2.4<br />

<br />

128m<br />

512<br />

<br />

<br />

197

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!