Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle checkstyleTest fails "CheckstyleException: Property 'allowMissingPropertyJavadoc' does not exist"

I get this error while running checkstyle on my custom test configuration - functionalTest.

Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - cannot initialize module JavadocMethod - Property 'allowMissingPropertyJavadoc' does not exist, please check the documentation at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:477) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198) at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.createRootModule(CheckstyleAntTask.java:412) ... 117 more Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module JavadocMethod - Property 'allowMissingPropertyJavadoc' does not exist, please check the documentation at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:136) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198) at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:472) ... 119 more Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property 'allowMissingPropertyJavadoc' does not exist, please check the documentation at com.puppycrawl.tools.checkstyle.api.AutomaticBean.tryCopyProperty(AutomaticBean.java:223) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:191) at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:131) ... 121 more

I see this field is set to true, in checkstyle.xml,

but I still get this error.

like image 497
Prakash Tanaji Avatar asked Oct 03 '19 07:10

Prakash Tanaji


People also ask

How do I use Checkstyle plugin in Gradle?

plugins { id 'checkstyle' } The plugin adds a number of tasks to the project that perform the quality checks. You can execute the checks by running gradle check. Note that Checkstyle will run with the same Java version used to run Gradle.

What are the dependencies of the Checkstyle plugin?

The Checkstyle plugin adds the following dependencies to tasks defined by the Java plugin. Depends on: All Checkstyle tasks, including checkstyleMain and checkstyleTest. By default, the Checkstyle plugin expects configuration files to be placed in the root project, but this can be changed.

How do I check the quality of a Gradle project?

Example 1. Using the Checkstyle plugin The plugin adds a number of tasks to the project that perform the quality checks. You can execute the checks by running gradle check. Note that Checkstyle will run with the same Java version used to run Gradle. The Checkstyle plugin adds the following tasks to the project:

How to customize the HTML report generated by the Checkstyle task?

The HTML report generated by the Checkstyle task can be customized using a XSLT stylesheet, for example to highlight specific errors or change its appearance: Example 3. Customizing the HTML report View a sample Checkstyle stylesheet.


1 Answers

Property 'allowMissingPropertyJavadoc' does not exist

https://checkstyle.org/releasenotes.html#Release_8.25

The property was removed in 8.25 as the functionality was moved to a new check, MissingJavadocMethodCheck, in 8.20. Since it was moved, the original check just kept the property to not break configuration and be deprecated. It was now removed.

I suggest you add MissingJavadocMethodCheck to continue the same behavior as before. for example:

<module name="MissingJavadocMethodCheck">
  <property name="allowMissingPropertyJavadoc" value="true"/>
</module>
like image 146
rveach Avatar answered Sep 28 '22 15:09

rveach