【发布时间】:2022-06-28 04:10:43
【问题描述】:
我正在 Jenkins 中对我的 Node.js 项目进行 SonarQube 分析。声纳分析使用结果创建 report-task.txt 文件。不幸的是,node_modules 文件夹中的一些模块还包含它们的 report-task.txt 文件,这会导致 Jenkins 出现警告:
WARN: Found multiple 'report-task.txt' in the workspace. Taking the first one.
/jenkins/workspace/.scannerwork/report-task.txt
/jenkins/workspace/node_modules/some_module/.scannerwork/report-task.txt
/jenkins/workspace/node_modules/some_other_module/.scannerwork/report-task.txt
在我的项目的声纳分析失败之前一切都很好:然后 Jenkins 作为声纳分析的结果从 node_modules 中的模块获取不同的 report-task.txt 文件:
WARN: Found multiple 'report-task.txt' in the workspace. Taking the first one.
/jenkins/workspace/node_modules/some_module/.scannerwork/report-task.txt <- wrong file
/jenkins/workspace/node_modules/some_other_module/.scannerwork/report-task.txt
有没有办法指定 /jenkins/workspace/.scannerwork/report-task.txt 是唯一正确的结果文件,而 Jenkins 应该忽略所有其他文件?最好使用 Jenkins Pipelines
【问题讨论】:
标签: jenkins jenkins-pipeline sonarqube jenkins-plugins sonarqube-scan