w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
package-info.java package annotations to affect all classes, including ones in sub packages

It looks like there is no way to do this. I have added a static analysis checkstyle check for those package-info.java to make sure they are always there. See: http://checkstyle.sourceforge.net/config_javadoc.html for more details. Then if you run checkstyle static analysis on the project, it will complain for any missing package-info.java file.

Finally, to suppress the checkstyle rule on the tests, and on the package where the package annotation definition exists use this suppression rule:

<suppress checks="JavadocPackage"
files="PackageNonnull.java|[/\]src[/\]test[/\]java[/\]"/>




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.