I am using checkstyle 5.5 for my project and building using Jenkins 1.462.
My project builds successfully, but every java class in my project causes Checkstyle to create a high priority, TreeWalker error like below:
ProductComparisonService.java:0, TreeWalker, Priority: High Got an
exception – java.lang.ClassCastException: antlr.CommonToken cannot be
cast to antlr.TokenNo description available. Please upgrade to latest checkstyle version.
I tried upgrading to checkstyle 5.6 but that did not solve the problem. I’d appreciate any ideas.
You have a conflicting version of antlr(works) in some other plugin that you’re using, and that is interfering in the classloader. You need to unload that other plugin.
I haven’t myself tested, but here are some recommended tools that might be able to find the offending jar for you: