Java google checkstyle Maven

不问归期 提交于 2019-11-30 17:47:03
rveach

Token "METHOD_REF" was not found in Acceptable tokens list in check com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck

You are trying to use a newer configuration with an old version of Checkstyle.

The configuration at https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml is in master which is dependent on the snapshot version of checkstyle.

If you are using google configuration without any modifications, you need to use the one that comes embedded in checkstyle. See https://stackoverflow.com/a/35486365/1016482

Otherwise you can integrate a newer version of checkstyle to work with maven. See https://stackoverflow.com/a/27359107/1016482

I was using version 3.0.0 (which is the newest one right now) of the maven-checkstyle-plugin and I still got the error. I solved it by adding the following dependency to the plugin.

 <dependency>
     <groupId>com.puppycrawl.tools</groupId>
     <artifactId>checkstyle</artifactId>
     <version>8.11</version>
 </dependency>

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