[DependencyCheck] [ERROR] NodeAuditAnalyzer failed on xxx/package-lock.json - yarn.lock was found; if package-lock.json was generated using synp, it may not be in the correct format.
[DependencyCheck] [ERROR] Unable to read yarn audit output.
Build step ‘Invoke Dependency-Check’ changed build result to FAILURE
在执行DependencyCheck之前,先执行npm install && npm run build
[DependencyCheck] [ERROR] Unable to read pnpm audit output.
Build step ‘Invoke Dependency-Check’ changed build result to FAILURE
在dependencyCheck 扫描参数中添加配置 --disablePnpmAudit
dependencyCheck完整的配置如下:
--project $projectName --scan $WORKSPACE --format HTML --format XML --format JUNIT --disableYarnAudit --disablePnpmAudit --disableMSBuild --out $WORKSPACE
SonarQube插件配置为:
sonar.projectKey=$projectName
sonar.projectName=$projectName
sonar.projectVersion=$branch
sonar.language=js
sonar.sourceEncoding=UTF-8
sonar.sources=./src
sonar.dependencyCheck.htmlReportPath=${WORKSPACE}/dependency-check-report.html