简体   繁体   English

使用声纳蚂蚁任务和詹金斯分析蚂蚁项目

[英]Analyzing ant project with sonar ant task and jenkins

I am using the sonar ant task jar for sonar analysis so I setup it in the project-properties.xml and create an Ant build step in jenkins. 我正在使用声纳蚂蚁任务罐进行声纳分析,因此我在project-properties.xml中进行了设置,并在jenkins中创建了一个Ant构建步骤。 When I build the job, the analysis works fine and I am able to see the results in the sonarqube server, but in jenkins no link to SonarQube is visible. 当我完成这项工作时,分析工作正常,并且可以在sonarqube服务器中看到结果,但是在jenkins中,看不到与SonarQube的链接。

Do I really need to install the SonarQube plugin for the link to be visible for the job? 我真的需要安装SonarQube插件以使该链接在工作中可见吗?

See also how to publish sonar result in jenkins server, or do we have sonar-report jenkins plugin 另请参阅如何在jenkins服务器中发布声纳结果,或者我们是否有声纳报告jenkins插件

Normally you let SonarQube handle the code analysis on it's own and not by the Ant task (in the Jenkins job). 通常,您让SonarQube自己处理代码分析,而不是由Ant任务处理(在Jenkins工作中)。

The Jenkins plug-in is there to trigger Sonar, to get latest sources (from the SCM) and run the analysis. 詹金斯(Jenkins)插件在那里触发Sonar,以获取最新消息(来自SCM)并运行分析。

The results, are then made available on Sonar, but the Jenkins project, will provide a link to the results. 结果将在Sonar上提供,但是Jenkins项目将提供结果的链接。

Workaround 解决方法

There is (for as far as I know) no way to add a link, to an external generated report. (据我所知)没有办法将链接添加到外部生成的报告中。 What could be done, is add a simple HTML page, with a link to the Sonar server, to the project. 可以做的是添加一个简单的HTML页面,该页面带有指向Sonar服务器和项目的链接。 And publish that simple HTML page, with the HTML Publisher Plugin . 并使用HTML Publisher插件发布该简单的HTML页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM