Eclipse 的 SonarLint:配置自定义 SonarQube 和语言配置文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33291974/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SonarLint for Eclipse : Configure a custom SonarQube & language profile?
提问by Alix Lourme
Currently SonarLint for Eclipseuses https://update.sonarlint.org/as SonarQube instance.
目前用于 Eclipse 的 SonarLint使用https://update.sonarlint.org/作为 SonarQube 实例。
Is there a way to configure a custom SonarQube url (with user authentication) for using your own default language profile ?
有没有办法配置自定义 SonarQube url(使用用户身份验证)以使用您自己的默认语言配置文件?
Could be very useful when you want more rules or you have configured some exclusions (mainly for external JavaScript libraries like JQuery, ...)
当您需要更多规则或配置了一些排除项时(主要用于 JQuery 等外部 JavaScript 库,...)
采纳答案by Alix Lourme
Too quick question, same hereabout IntelliJ, but with Eclipse answer.
问题太快了,这里也有关于 IntelliJ 的问题,但有 Eclipse 的答案。
This feature will be supported in v2.0(SLE-26).
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 notdeployed on a production environment. This is just a "technical stuff for fun", until feature supported officially by the plugin.
免责声明:此解决方法不受 SonarSource 支持,这不是可持续的解决方案,不得部署在生产环境中。这只是一个“有趣的技术内容”,直到插件正式支持该功能。
Prerequisite:
先决条件:
- SonarQube >= 5.2is required (tested with RC3)
- Use SonarLint < v1.3(strictly, see SLE-24)
- SonarQube instance must not be secured (
sonar.forceAuthentication=false
)
- 需要 SonarQube >= 5.2(使用 RC3 测试)
- 使用 SonarLint < v1.3(严格来说,请参阅SLE-24)
- 不得保护 SonarQube 实例 (
sonar.forceAuthentication=false
)
The SonarLint uses Eclipse preferences for URL loading (See SonarRunnerFacade), so could be overrided with pluginCustomization.
SonarLint 使用 Eclipse 首选项进行 URL 加载(请参阅SonarRunnerFacade),因此可以使用pluginCustomization覆盖。
In the eclipse.ini
file (beside eclipse.exe), add in first :
在eclipse.ini
文件中(在eclipse.exe旁边),首先添加:
-pluginCustomization
myPrefs.ini
-startup
...
With in myPrefs.ini
file (beside eclipse.exe/eclipse.ini) :
在myPrefs.ini
文件中(在eclipse.exe/eclipse.ini旁边):
# SonaQube - SonarLint URL override
org.sonarlint.eclipse.core/server_url=http\://localhost:9000