SonarLint for Eclipse : Configure a custom SonarQube & language profile?

喜你入骨 提交于 2019-12-01 19:10:35

问题


Currently SonarLint for Eclipse uses https://update.sonarlint.org/ as SonarQube instance.

Is there a way to configure a custom SonarQube url (with user authentication) for using your own default language profile ?

Could be very useful when you want more rules or you have configured some exclusions (mainly for external JavaScript libraries like JQuery, ...)


回答1:


Too quick question, same here about IntelliJ, but with Eclipse answer.

This feature will be supported in v2.0 (SLE-26).


However, there is a workaround ...

Disclaimer : This workaround is not supported by SonarSource, this is not a sustainable solution and MUST not deployed on a production environment. This is just a "technical stuff for fun", until feature supported officially by the plugin.


Prerequisite :

  • SonarQube >= 5.2 is required (tested with RC3)
  • Use SonarLint < v1.3 (strictly, see SLE-24)
  • SonarQube instance must not be secured (sonar.forceAuthentication=false)

The SonarLint uses Eclipse preferences for URL loading (See SonarRunnerFacade), so could be overrided with pluginCustomization.

In the eclipse.ini file (beside eclipse.exe), add in first :

-pluginCustomization
myPrefs.ini
-startup
...

With in myPrefs.ini file (beside eclipse.exe/eclipse.ini) :

# SonaQube - SonarLint URL override
org.sonarlint.eclipse.core/server_url=http\://localhost:9000


来源:https://stackoverflow.com/questions/33291974/sonarlint-for-eclipse-configure-a-custom-sonarqube-language-profile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!