Checkstyle SuppressionFilter Module Initialization Error

Hello,

I’m experiencing an issue related to the Checkstyle plugin in both Maven and Gradle projects.

Here’s the context:

  1. In the project’s checkstyle.xml configuration file, I have a module configuration for SuppressionFilter pointing to a custom suppressions file. The config is as follows:
  1. The suppressions.xml file is placed in the same directory as checkstyle.xml.

  2. Here is the Plagin Configuration from SonarQube server

When I run the build, it fails with the error:

Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module SuppressionFilter - Unable to find: ./suppressions.xml

This error occurs in both Maven and Gradle builds

It seems that the Checkstyle plugin is not correctly resolving the ${config_loc} variable or the relative path to suppressions.xml in both cases.

I’ve made sure that the suppressions.xml file exists in the correct location in the filesystem. I’ve also tried changing the file path in the SonarQube configuration, but the error persists.

Note:
When the build is executed with SonarQube Server (Prod) version 6.7.3, it completes successfully. However, when using SonarQube Dev Server (version 7.9), the build fails.

Any guidance on how to resolve this issue would be greatly appreciated.

Hi,

You’ll need to contact the Checkstyle community for this.

 
HTH,
Ann