Link 到 Jenkins 作业上的 SonarQube 不可用

Link to SonarQube on Jenkins job not available

在 Jenkins 作业的主页上,我看到了 SonarQube 图标,它应该是 link,但它只是文本:

我用...

浏览了jenkins sonarqube-plugin的源码,发现SonarUtils.extractSonarProjectURLFromLogs()好像坏了。它解析正则表达式“ANALYSIS SUCCESSFUL, you can browse (.*)”的控制台输出。 我的控制台输出从不打印这一行。它只是打印“ANALYSIS SUCCESSFUL”。

这是一个已知问题吗?

根据我在你的日志中看到的,你是 运行 "preview" 模式下的分析:

... -Dsonar.analysis.mode=preview ...

您可以在 documentation 上阅读有关预览模式的内容:

The source code is analyzed but the measures and issues are not pushed to the SonarQube database. Therefore, they cannot be browsed through the web interface.

所以这很正常,您只收到一条 ANALYSIS SUCCESSFUL 消息而没有相关的 SQ URL(因为结果不会在预览模式下推送到服务器)。