Issue with SonarScanner Execution Failure Due to UnusedPrivateFieldCheck

Hello Sonar Community,

I’ve encountered an execution failure when merging branches in Bitbucket Cloud Pipelines using SonarCloud for code analysis. The process fails during the SonarScanner execution, specifically with an error related to the UnusedPrivateFieldCheck. Here’s the relevant portion of the log:

vbnetCopy code

ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The field 'ignoreAnnotations' does not exist or is not annotated with @RuleProperty in the class

This suggests there might be an issue with the configuration or compatibility of this specific rule within our project setup. We are using Bitbucket Cloud Pipelines and the analysis is being run on SonarCloud, with all configurations defaulting as expected. The error seems to point to a problem with the ignoreAnnotations field, which, according to the error, either doesn’t exist or is not properly annotated.

Additional context that might be relevant:

  • We are using the latest versions of all related tools and plugins as far as we are aware.
  • The error occurs when attempting to merge a branch into the master.
  • Our project utilizes multiple languages, but this seems to be related specifically to Java analysis.

I’m reaching out to the community for guidance on how to address or work around this issue. Has anyone encountered a similar problem, or does anyone have suggestions on how to resolve this? Any advice on checking compatibility or updating configurations that might mitigate this issue would be greatly appreciated.

Thank you for your time and assistance.

I encountered this problem when I was setting up sonar.exclusions property in build.gradle of my project.
Problem was in invalid pattern of exclusion string:
"**/somePackage/**" - invalid
"**/full/path/to/somePackage/**" - valid

Maybe it’ll help

Hi all,

We are experience the same issue when executing Main Branch Analysis on the source code of our project:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project etu_parent: The field 'ignoreAnnotations' does not exist or is not annotated with @RuleProperty in the class -> [Help 1]

We have defined Source File Exclusions in the pom.xml file as follows:

<sonar.exclusions>**/webapp/**, **/src/main/java/ie/etu/analytics/**, **/**/*.xml, **/**/*.js, **/**/*.css, **/etu_commons/src/main/java/ie/etu/simulation/trial/entity/** </sonar.exclusions>

According to the sonarcloud documentation, wildcard patterns are valid and shouldn’t case any issue…

We use the same configuration for quite some time now and this is issue has just manifested recently. It is also not consistent as manually triggering a new analysis completed without errors.

Any idea what might be going on?

Thanks. regards


We had a brief disruption earlier today, which has been remediated.

Are you still experiencing this problem?


Thank you for the update. I noticed the issue resolved itself without any changes on my part. I’m not entirely sure if this was directly related to the remediation efforts on your side, but I’m glad to report everything is now functioning as expected.

1 Like