Checkstyle SuppressionFilter Module Initialization Error

37 views
Skip to first unread message

Zura Pantskhava

unread,
May 18, 2023, 2:08:27 AM5/18/23
to checkstyle

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.

Roman Ivanov

unread,
May 18, 2023, 9:01:21 AM5/18/23
to Zura Pantskhava, checkstyle
Hi Zura,

You need to ask this question at plugin forums. They define what is current folder and how variables are evaluated.

You can search in web examples of suppression file usage and it might help you as you will see what others do to make it work.

--
You received this message because you are subscribed to the Google Groups "checkstyle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to checkstyle+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/checkstyle/5b1891bf-01e5-44c0-8d19-aa0c4f78eb1dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages