Custom rules plugin working on 8.9 LTS, 9.9 LTS but not on 10.5.1 (NOT LTS)

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 10.5.1, maven-sonar-plugin for scanning 4.0.0.4121
  • how is SonarQube deployed: ZIP
  • what are you trying to achieve: Get the custom rules plugin working with 10.5.1 which worked on 8.9 LTS and 9.9 LTS
  • what have you tried so far to achieve this: Upgraded the sonar-plugin-api, sonar-java-plugin and maven-sonar-plugin

I see the rules in dashboard and activated but after scan the rules’ issue is not marked in code on sonarqube while sonarlint on eclipse marks the issue.

NOTE: The rules are visible on dashboard and are activated on the default profile.

Hi,

You’ll probably find this thread helpful.

 
Ann

No the link you provided did not help.
I am also seeing " Incomplete Semantic, method invocation" in the logs.

The 2 issues I mentioned are the reason for my custom plugin not working.

Hello,
We solved the issue by using mvn-copy-dependencies plugin and copying the dependencies to target/lib directory that way the scanner is able to find the Types in the lib and reporting the issue on scan.

I still somehow feel this is not a proper solution. Please let me know if I can solve this issue more graciously.

Hi,

The thread I linked to discusses some changes in the API and how to deal with them by declaring the languages your plugin handles. That is the proper solution.

 
HTH,
Ann

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SQ 10.5.1
  • how is SonarQube deployed: zip
  • what are you trying to achieve: Get custom rules that were working on SQ 8.9 to work on 10.5.1
  • what have you tried so far to achieve this: I have added maven shade plugin which seems to be working i.e. I see the custom rules being reported.

I see multiple “Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.”
This warning definitely has to do with the false negatives but I do not know how to get this working without maven shade.

NOTE: The custom rules used to work with SQ 8.9 without maven-shade-plugin. Moreover the shading is causing the builds to be slow and heavy.

Hi,

I consolidated your new post here since it asks the same question already posed in this thread.

You may find this additional resource helpful:

 
Ann