4

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, ...)

Alix Lourme
  • 1,135
  • 1
  • 11
  • 21

1 Answers1

4

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
Community
  • 1
  • 1
Alix Lourme
  • 1,135
  • 1
  • 11
  • 21
  • Alix, I was about to edit your answer but I feel it would be best if you would do it on your own => SonarSource won't support people who do this workaround because this can have multiple impacts now and in the future. Can you please add this notice to your answer? Thanks – Fabrice - SonarSource Team Nov 06 '15 at 10:19
  • @Fabrice-SonarSourceTeam : Done. Sorry. I can delete it or update the disclaimer if not enough precise. – Alix Lourme Nov 06 '15 at 13:38
  • Has somebody tried if this workaround is still working for SonarLint 1.3? I unfortunately can't try it for myself at the moment. – Alex Feb 19 '16 at 09:16
  • 1
    @Alex : Workaround tested with SonarLint 1.3 : **doesn't work**. Mainly because [SLE-24 : Stop depending on update.sonarlint.org](https://jira.sonarsource.com/browse/SLE-24). Only solution : watch & vote for [SLE-26](https://jira.sonarsource.com/browse/SLE-26). – Alix Lourme Feb 21 '16 at 18:55
  • That's sad :( It's going to be useless if quality profiles differ too much. Anyway thank you for testing! – Alex Feb 22 '16 at 06:35