package-info.java package annotations to affect all classes, including ones in sub packages

£可爱£侵袭症+ 提交于 2019-12-05 22:38:21

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[/\\]"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!