如何教 checkstyle 忽略我的自定义 javadoc 标签?
我有一个附加到某些方法和类的自定义 javadoc 标记 (@todo
)。这就是 checkstyle 所说的:
[ERROR] Foo.java[0:null] Got an exception - java.lang.IllegalArgumentException:
the name [todo] is not a valid Javadoc tag name
是否可以教 checkstyle 忽略这些标签?
我尝试按照指定的此处进行配置:
<module name="JavadocType">
<property name="allowUnknownTags" value="true"/>
</module>
但收到一条消息:
... cannot initialize module TreeWalker - Property
'allowUnknownTags' in module JavadocType does not exist,
please check the documentation
此外,我需要使用这些标签不仅适用于类型,还适用于包、方法和变量。
附注这是 maven-checkstyle-plugin
2.6
I have a custom javadoc tag (@todo
) attached to some methods and classes. This is what checkstyle says:
[ERROR] Foo.java[0:null] Got an exception - java.lang.IllegalArgumentException:
the name [todo] is not a valid Javadoc tag name
Is it possible to teach checkstyle to ignore these tags?
I tried to configure as specified here:
<module name="JavadocType">
<property name="allowUnknownTags" value="true"/>
</module>
But got a message:
... cannot initialize module TreeWalker - Property
'allowUnknownTags' in module JavadocType does not exist,
please check the documentation
Moreover, I need to use these tags not only for types, but also for packages, methods, and variables.
ps. It's maven-checkstyle-plugin
2.6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法使用此属性,因为 Maven Checkstyle 插件使用 Checkstyle 5.0,而
allowUnknownTags
属性是在 Checkstyle 5.1 中引入的。 (请参阅 Checkstyle 发行说明)You can't use this property because the Maven Checkstyle Plugin uses Checkstyle 5.0 whereas the
allowUnknownTags
property was introduced in Checkstyle 5.1. (See the Checkstyle Release Notes)