You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否重新推送SonarQube分析结果至服务器?避免重跑2小时分析

How to Resubmit SonarQube Analysis Results Without Re-Running the Full Scan (LTS 6.7.2)

Got it, let's cut straight to the chase—you don't need to re-run that 2-hour analysis just to resubmit the results. Here's how to reuse the already-generated local report:

Step 1: Locate the Local Analysis Report

When SonarScanner finishes a successful analysis, it stores the report file locally, usually in the .scannerwork directory of your project. To find the exact path:

  • Open the file .scannerwork/report-task.txt (this is generated automatically after analysis)
  • Look for the reportPath line—it will point to the actual report file (typically named sonar-report.json)

Step 2: Resubmit the Report Using SonarScanner

Use the sonar-scanner command with parameters to skip analysis and send the existing report directly to your server. Replace the placeholders with your project details:

sonar-scanner \
  -Dsonar.skipAnalysis=true \
  -Dsonar.report.path=/full/path/to/your/sonar-report.json \
  -Dsonar.projectKey=your-project-key \
  -Dsonar.host.url=http://your-sonar-server-url \
  -Dsonar.login=your-auth-token-or-username:password

Breakdown of Key Parameters:

  • sonar.skipAnalysis=true: Tells SonarScanner to skip running the code analysis entirely and just focus on sending the report.
  • sonar.report.path: Absolute path to the local report file you found in Step 1.
  • The other parameters (projectKey, host.url, login) should match exactly what you used for the original analysis.

Pro Tip for Future Runs

To avoid this hassle next time, add the following parameter to your original analysis command to export a copy of the report to a location you can easily access:

-Dsonar.report.export.path=./sonar-report-backup.json

This saves a standalone copy of the report outside the .scannerwork directory (which might get cleaned up by build tools).

Notes to Keep in Mind

  • Make sure the report file is compatible with your SonarQube server version (since you're using 6.7.2 LTS for both, this won't be an issue).
  • Your authentication credentials need to have permission to submit analysis results for the target project.

Give this a try—you’ll save that 2-hour wait in no time!

内容的提问来源于stack exchange,提问作者pavan krishna

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 06:56:52