Search code examples
javacheckstylemaven-checkstyle-plugin

Disable missing javadoc comments in checkstye.xml


I am trying to disable "missing javadoc comments" error in my checkstyle.xml in a Maven project. I tried to add the following module but it didn't work:

<!-- No need for Javadoc -->
    <module name="JavadocType">
        <property name="severity" value="ignore"/>
    </module>
    <module name="JavadocMethod">
        <property name="severity" value="ignore"/>
    </module>
    <module name="JavadocVariable">
        <property name="severity" value="ignore"/>
    </module>

Is there any particular module I can add to disable all javadoc comments check or any kind of changes I can make to a Maven dependency?


Solution

  • Apparently, there were some mismatches in Checkstyle releases and the Maven Checkstyle plugin. There is a way the problem with Checkstyle can be solved: MVN plugin with Checkstyle latest version provided (so far it was 8.5):

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <dependencies>
            <dependency>
                <groupId>com.puppycrawl.tools</groupId>
                <artifactId>checkstyle</artifactId>
                <version>8.5</version>
            </dependency>
        </dependencies>
    </plugin>
    

    As you can see, it uses an older version of Checkstyle. However, you need to use an older plugin in your IDE as well.