1

I have created a custom rule for sonarqube in Java. The rule is created and i can see that in the sonarqube UI.

Now the problem is when i try to check that rule from eclipse. I am getting error: :Synchronization issue, has encountered some problem". enter image description here

When I checked log from eclipse, i have this:

!ENTRY org.sonar.ide.eclipse.core 4 4 2016-04-18 10:02:36.641
!MESSAGE 
!STACK 0
java.lang.NullPointerException
    at org.sonar.ide.eclipse.wsclient.internal.SonarWSClientFacade.getUnresolvedRemoteIssuesRecursively(SonarWSClientFacade.java:170)
    at org.sonar.ide.eclipse.core.internal.remote.RemoteSourceCode.getRemoteIssuesRecursively(RemoteSourceCode.java:107)
    at org.sonar.ide.eclipse.core.internal.jobs.SynchronizeAllIssuesJob.doRefreshIssues(SynchronizeAllIssuesJob.java:131)
    at org.sonar.ide.eclipse.core.internal.jobs.SynchronizeAllIssuesJob.fetchRemoteIssues(SynchronizeAllIssuesJob.java:120)
    at org.sonar.ide.eclipse.core.internal.jobs.SynchronizeAllIssuesJob.run(SynchronizeAllIssuesJob.java:76)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

I would appreciate any help. Also I would like to know if there is a way to suppress my custom rule for some of the java file. I have seen the options like //nosonar and @supress(). Please let me know the way to suppress my custom rule for some java files.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • Which version of Eclipse ? of SonarQube Plugin for Eclipse ? and of SonarQube ? – Nicolas B. Apr 18 '16 at 12:08
  • Sonarqube server version : 5.4, sonarlint version : 2.0, Eclipse(release 2(4.4.2)) – user1682132 Apr 18 '16 at 23:54
  • Now it is working after switching from sonarqube eclipse plugin to sonarlint 2.0 plugin. I want to ask that, i created a java rule and the rule result i am able to see in the sonarqube UI, but that i am not able to see in my eclipse after analysis. javaFileScannerContext.addIssue(importTree, this, "Avoid imports (3rd party imports)"); – user1682132 Apr 19 '16 at 00:24
  • does sonarlint works with custom rules: https://jira.sonarsource.com/browse/MMF-248 – user1682132 Apr 19 '16 at 09:54

1 Answers1

1

It Seems that this is a version issue. sonarqube eclipse plugin does not work with sonarqube 5.4 server. If you are using sonarqube 5.2+ server. you have to use sonarlint eclipse plugin for the analysis.

  • FYI, requirement for SonarQube server 5.2+ (for connected mode) is [known and documented](http://www.sonarlint.org/eclipse/index.html) (so is [SonarQube Eclipse Plugin depreciation](http://docs.sonarqube.org/display/SONAR/Installing+SonarQube+in+Eclipse)). – Nicolas B. Apr 19 '16 at 10:02