Turn off doclint in JDK 8

Java 8 introduced DocLint which is a quite strict linter for javadoc. By default, the build will be failed if there are any errors while generating the javadocs.

We can disable this check. Refer below to know how to do that.

If you are using the older version of maven-javadoc-plugin (2.10.2 or older). then add the “-Xdoclint:none” inside of the configuration element. Refer below.


<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-javadoc-plugin</artifactId>
      <version>2.10.2</version>
      <configuration>
         <additionalparam>-Xdoclint:none</additionalparam>
      </configuration>
  </plugin>   

If you are using the latest version of maven-javadoc-plugin(3.0.0), then add “none” inside of the configuration element. Refer below.


<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-javadoc-plugin</artifactId>
      <version>3.0.0</version>
      <configuration>
         <doclint>none</doclint>
      </configuration>
  </plugin>

If you would not like to add the entire plugin details, Then you can add these configurations in the global maven properties section. Like below.


<properties>
   <additionalparam>-Xdoclint:none</additionalparam>
</properties>

or

<properties>
   <doclint>none</doclint>
</properties>


Advertisements