声纳配置
我在 Eclipse 上安装了 Sonar 插件(我运行了服务器 .../StartSonar.bat),当我在 LocalHost:9000 上测试连接时,一切正常(连接成功)。现在我应该怎么做才能将我的项目与声纳关联起来?我有点迷失了。我是菜鸟。
I installed Sonar Plugin on my eclipse, (i ran the server .../StartSonar.bat) and when I do test connection on LocalHost:9000 its okay (Connection Sucessfull). Now What should I do to associate my projects with sonar? I'm kind lost. I'm rookie.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的项目是使用 maven 构建的,那么您所需要做的就是在项目根文件夹(您的 pom.xml 所在的位置)上运行 mvn sonar:sonar 并生成报告将被推送到您的声纳实例。
您还需要在 settings.xml 中设置声纳配置文件。以下示例:
此处了解更多信息。
If your projects are built with maven then all you need to do is run
mvn sonar:sonar
on your project root folder (where yourpom.xml
is located) and the report will get pushed to your sonar instance.And also you need to have the sonar profile set up in your settings.xml. Example below:
Read more here.
要在 Eclipse SonarQube 中使用该插件,您必须安装 sonarQube 实例(服务器),有关如何操作的文档可以在以下链接中找到
一旦你对代码进行了初步分析,无论是 maven 所说的 Tomasz 还是 sonar-runner,(http://docs.sonarqube.org/display/SONAR/Analyzing+Source+Code)您可以使用 Eclipse 的 sonarqube 插件,在常规首选项 Eclipse 窗口中设置对服务器的引用 -> ;首选项->声纳Qube ->服务器和项目级别应该“链接”或参考位于您的服务器中的第一个分析。
执行此操作后,每次使用 Eclipse 中的 SonarQube 分析代码时,它将连接到服务器,将带来现有证据,并根据远程分析中收集的信息对代码进行增量分析。
To use the plugin in Eclipse SonarQube you must have a sonarQube instance (server) installed, documentation on how to do can be found at the following link http://docs.sonarqube.org/display/SONAR/Setup+and+Upgrade.
Once you have performed an initial analysis of your code, either as maven says Tomasz or sonar-runner, (http://docs.sonarqube.org/display/SONAR/Analyzing+Source+Code) you can, with sonarqube plugin for Eclipse, set a reference to the server in the General preferences Eclipse Window -> Preferences -> SonarQube -> Servers and project level should "link" or refer to said first analysis located in your server.
Once you do this, every time you make an analysis of your code with SonarQube from Eclipse, it will connect to the server, the existing evidences will be brought and will do an incremental analysis of your code with respect to information collected on the remote analysis.