Some of my colleagues lack discipline and not always write documentation of their classes(not always = never). I was trying to force them to write documentation by setting project warnings for missing comment javadocs. We got two source folders 'src' and 'tests' - obviously not all @Test methods needs documentation and this warning there is redundant. But now all undocumented tests got these annoying warnings, the project got hundreds of warnings and I'm afraid that some real dangerous warnings will be missed(because there are hundreds of useless ones).
How to set warnings only on the 'src' folder, and ignore the warnings on 'tests' folder?
Shift-Alt-J is a useful keyboard shortcut in Eclipse for creating Javadoc comment templates.
Step 1 − Open eclipse, select the option Project →Generate Javadoc. Step 2 − Select the javadoc.exe file from the bin folder of java installation directory, select the destination folder for the generated java doc and select Next. finish button.
Typically, it is located under JAVA_HOME's bin directory. For example, C:\Program Files\Java\jdk1. 7.0_21\bin\javadoc.exe, on Windows platform. Select the project and packages for which you want to generate Javadoc.
I'm afraid there is no setting to disable missing javadoc validation strictly for Test classes/methods. There even was a suggestion posted on Eclipse bugzilla here but eventually it came to an dead end.
The only, nonelegant way of solving this issue is by annotating those test methods with @SuppressWarnings("javadoc")
annotation.
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