我有一个附加到某些方法和类的自定义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忽略这些标签?
我尝试按指定的here配置:
<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
此外,我需要将这些标签不仅用于类型,还用于包,方法和变量。
PS。它是maven-checkstyle-plugin
2.6
答案 0 :(得分:2)
您不能使用此属性,因为Maven Checkstyle插件使用Checkstyle 5.0,而allowUnknownTags
属性是在Checkstyle 5.1中引入的。 (见Checkstyle Release Notes)