NPE when analysing project in Eclipse (SonarQube 5

2019-06-18 14:55发布

问题:

I updated from SonarQube 5.1.2 to 5.2.

In Eclipse I start analysis with SonarQube with the latest plugin version. But a dialog pops up saying there is a NPE. The Eclipse error log displays:

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:55)

What is the problem? How can I make analysis in Eclipse work with SonarQube 5.2?

回答1:

You cannot use Eclipse SonarQube Plugin with SonarQube 5.2 or newer.


From SonarQube Wiki:

The SonarQube Eclipse plugin is deprecated

The SonarQube Eclipse plugin does not work with SonarQube 5.2+. It is replaced by SonarLint for Eclipse.

Note that SonarLint for Eclipse 1.x series do not cover yet all the features of SonarQube Eclipse plugin, but versions 2.x will definitely cover this gap.