All I did was to upgrade from 8.1 to 8.2 using a configuration file that worked just fine
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (verify-style) on project sshd:
Failed during checkstyle configuration: cannot initialize module TreeWalker - Unable to instantiate 'FileContentsHolder' class,
it is also not possible to instantiate it as .FileContentsHolder, FileContentsHolderCheck, .FileContentsHolderCheck.
Please recheck that class name is specified as canonical name or read how to configure short name usage http://checkstyle.sourceforge.net/config.html#Packages.
Please also recheck that provided ClassLoader to Checker is configured correctly.
No matter - figured it out from the release notes simply remove
<!-- Enable FileContentsHolder to allow us to in turn turn on suppression comments -->
<module name="FileContentsHolder" />
I’d still consider it as a bug that a Sonar-generated configuration no longer works — especially as the thing seems to be simple here to just ignore that XML tag.
@mirabilos , thanks for raising this issue, please create issue at https://github.com/checkstyle/sonar-checkstyle/issues with details on how you run into such problem, but be aware that sonar plugin is still using old version of checkstyle. If you use checkstyle in sonar and in other CIs - it is better to stay in same versions for consistency of behavior.
Fun thing is, I don’t use Checkstyle directly, only via Sonar and via IntelliJ. So I kinda don’t have that choice.
Maping of versions for checkstyle vs checkstyle-sonar-plugin: https://github.com/checkstyle/sonar-checkstyle/blob/master/README.md
Mapping of checkstyle version vs idea plugin https://github.com/jshiell/checkstyle-idea/blob/master/README.md#version-history
To my mind, it is better to use same version of checkstyle in sonar and idea for consistency of behavior.
Thanks for the lists!
Great idea, but unfortunately, the IDEA (no pun intended) plugin must be kept up-to-date (because it ceases working at all otherwise), and the Sonar plugin is severely lagging behind, so version skew is unavoidable.
, the IDEA (no pun intended) plugin must be kept up-to-date (because it ceases working at all otherwise),
I not following you ... can you describe problem in more details ?
Sonar plugin is severely lagging behind, so version skew is unavoidable.
My bad, too much activity on main project .... I have no time to releases in sync.
Roman Ivanov dixit:
, the IDEA (no pun intended) plugin must be kept up-to-date (because it ceases working at all otherwise),
I not following you ... can you describe problem in more details ?
Yes: downgrading Checkstyle-IDEA is not possible because the
old versions of the plugin won’t work with the current version
of the IDE.
Most helpful comment
No matter - figured it out from the release notes simply remove