I'm using the Maven Javadoc Plugin. It outputs warnings as follows:
[ERROR] /home/monperrus/spoon/src/main/java/spoon/visitor/CtVisitor.java:144: warning: no @param for <T>
How to display those warnings as [WARNING]
(and not the confusing [ERROR]
)?
The Javadoc generation can be skipped by setting the property maven. javadoc. skip to true [1], i.e.
The magic incantation you need is -Xdoclint:none . This goes on the command line invoking Javadoc.
You need to call mvn javadoc:fix to fix main Java source files (i.e. inside src/main/java directory) or mvn javadoc:test-fix to fix test Java source files (i.e. inside src/test/java directory).
Generally, the first sentence of Javadoc should give a brief description of the class/method/field. Then the full description should follow. And if you want to include any notes, a specialized paragraph with a "Note:" prepended should suffice. Generally if you open (xml-)tags you should close them somewhere.
How to display those warnings as [WARNING] (and not the confusing [ERROR])? How to completely disable Javadoc warnings in Maven?
If you are talking about the javadoc lint warnings introduced in Java 8 then you should be able to do the following. There are multiple ways of specifying the parameters depending on which version of the javadoc plugin you are using.
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <configuration> <additionalparam>-Xdoclint:none</additionalparam> <additionalOptions>-Xdoclint:none</additionalOptions> <additionalJOption>-Xdoclint:none</additionalJOption> </configuration> </plugin> </plugins>
See this good discussion about turning off doclint.
If you are instead just want to get rid of the missing jacadocs warnings then you can use:
<configuration> <additionalparam>-Xdoclint:all -Xdoclint:-missing</additionalparam> <additionalOptions>-Xdoclint:all -Xdoclint:-missing</additionalOptions> <additionalJOptions> <additionalJOption>-Xdoclint:all</additionalJOption> <additionalJOption>-Xdoclint:-missing</additionalJOption> </additionalJOptions> </configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With