在 Eclipse 中使用 SonarQube
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7975429/
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
Using SonarQube in Eclipse
提问by akram
I just installed SonarQube in Eclipse, but I don't know how to use it :
我刚刚在 Eclipse 中安装了 SonarQube,但我不知道如何使用它:
HereIt said: Link projects to Sonar server
这里说:将项目链接到声纳服务器
What is the server? Should we create another project somewhere else with the same name as the project in Eclipse?
服务器是什么?我们应该在其他地方创建另一个与 Eclipse 中的项目同名的项目吗?
It's really confusing, I will appreciate if someone could help by a small example.
这真的很令人困惑,如果有人可以通过一个小例子提供帮助,我将不胜感激。
采纳答案by Fabrice - SonarSource Team
To be able to use Sonar Eclipse, you first need to install a Sonar server 5.1 or older as described here: http://docs.sonarqube.org/display/SONAR/SonarQube+in+Eclipse
为了能够使用 Sonar Eclipse,您首先需要按照此处所述安装 5.1 或更低版本的 Sonar 服务器:http: //docs.sonarqube.org/display/SONAR/SonarQube+in+Eclipse
Then, you will have to run a first analysis (out of Eclipse) of your project to have it referenced in the Sonar server. See http://docs.sonarqube.org/display/SONAR/Analyzing+Source+Code
然后,您必须对您的项目运行第一次分析(在 Eclipse 之外),以便在 Sonar 服务器中引用它。请参阅http://docs.sonarqube.org/display/SONAR/Analyzing+Source+Code
After those 2 steps, then you'll be able to run analyses directly within Eclipse once you have associated your local project with the Sonar server.
在这两个步骤之后,一旦您将本地项目与 Sonar 服务器相关联,您就可以直接在 Eclipse 中运行分析。
UPDATE: Sonar 5.2+ is no longer supporting sonar eclipse plugin in favor of sonarlint. Unfortunately sonarlint has no customization options.
更新:Sonar 5.2+ 不再支持 sonar eclipse 插件,而支持 sonarlint。不幸的是 sonarlint没有自定义选项。
We will make this feature available in upcoming versions, probably by requiring to "connect" SonarLint with an existing SonarQube server instance.
我们将在即将推出的版本中提供此功能,可能需要将 SonarLint 与现有的 SonarQube 服务器实例“连接”。
回答by Shirishkumar Bari
Sonar can be run now localy to analyse the java project
现在可以在本地运行声纳来分析 java 项目
for more information visit sonar eclipse
欲了解更多信息,请访问声纳日食
Also you can visit DZONEfor step by step installation procedure
您也可以访问DZONE一步一步的安装过程