运行 SonarQube 分析扫描 - SonarSource build-wrapper

Running SonarQube analysis scan - SonarSource build-wrapper

我是 运行ning SonarQube 扫描的新手,我在 Jenkins 的日志中收到此错误消息:

16:17:39 16:17:36.926 ERROR - The only way to get an accurate analysis of your C/C++/Objective-C project is by using the SonarSource build-wrapper. If for any reason, the use of the build-wrapper is not possible on your project, you can bypass it with the help of the "sonar.cfamily.build-wrapper-output.bypass=true" property. By using that property, you'll switch to an "at best" mode that could result in false-positives and false-negatives.

有人可以告诉我在哪里可以找到和 运行 这个 SonarSource 构建包装器吗?

非常感谢您的帮助!

联系支持人员,发现这是由于在扫描器开始命令中缺少参数 sonar.cfamily。build-wrapper-output。

构建包装器下载:

https://binaries.sonarsource.com/CommercialDistribution/sonar-cpp-plugin/

有关如何运行构建包装器的一些链接:

要解决此问题,请直接从您的 SonarQube 服务器下载 Build Wrapper,使其版本与您的插件版本完美匹配:

可以从 URL

下载 Linux 的构建包装器
http://localhost:9000/static/cpp/build-wrapper-linux-x86.zip

解压下载的Build Wrapper, 在您的 PATH 中配置它,因为它更方便

export PATH=$PATH:/path/where/you/unzip

完成后,运行 下面的命令。

build-wrapper-linux-x86-64 --out-dir <dir-name> <build-command>
build-wrapper-linux-x86-64 --out-dir build_output make clean all

完成所有这些后,您必须使用以下行修改声纳-project.properties 文件。请注意,目录名称与我们在上一个命令中定义的目录相同。

sonar.cfamily.build-wrapper-output=<dir-name>

然后你可以运行声纳扫描仪命令。

sonar-scanner

这将对您的代码进行分析。更多详情,您可以查看此link.