Since Checkstyle 5.0


Checks that each Java package has a Javadoc file used for commenting. By default, it only allows a file, but can be configured to allow a package.html file.

A violation will be reported if both files exist as this is not allowed by the Javadoc tool.


name description type default value since
allowLegacy Allow legacy package.html file to be used. boolean false 5.0
fileExtensions Specify the file extensions of the files to process. String[] .java 5.0


To configure the check:

<module name="Checker">
  <module name="JavadocPackage"/>

To configure the check to use legacy package.html file when file is absent:

<module name="JavadocPackage">
  <property name="allowLegacy" value="true"/>

Example of Usage

Violation Messages

All messages can be customized if the default message doesn't suit you. Please see the documentation to learn how to.


Parent Module