项目场景:使用sonar无法生成PDF报告
执行"sonar-scanner"指令后提示
ERROR Problem generating PDF file.
ERROR PDF file not found in local filesystem. Report could not be sent to server.
问题描述
ERROR Problem generating PDF file.
org.sonar.report.pdf.entity.exception.ReportException: Can’t get Compute Engine task status.
at org.sonar.report.pdf.PDFReporter.waitCeTask(PDFReporter.java:226)
at org.sonar.report.pdf.PDFReporter.getProject(PDFReporter.java:182)
at org.sonar.report.pdf.PDFReporter.getReport(PDFReporter.java:101)
at org.sonar.report.pdf.batch.PDFGenerator.execute(PDFGenerator.java:114)
at org.sonar.report.pdf.batch.PDFPostJob.execute(PDFPostJob.java:100)
at org.sonar.scanner.postjob.PostJobWrapper.execute(PostJobWrapper.java:49)
at org.sonar.scanner.postjob.PostJobsExecutor.execute(PostJobsExecutor.java:48)
at org.sonar.scanner.postjob.PostJobsExecutor.execute(PostJobsExecutor.java:39)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:351)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:144)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:149)
at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:66)
at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:52)
ERROR PDF file not found in local filesystem. Report could not be sent to server.
原因分析
服务器和本地指令上传未附带密钥。
解决方案
- 服务器端配置密钥,如下:
- 指令端,如下:
sonar-scanner -Dsonar.projectKey=User_project -Dsonar.sources=. -Dsonar.host.url=http://192.168.43.152:9000 -Dsonar.token=sqp_3484b024ee31bd935e84bb6dfa2c6310818433a3 -Dsonar.pdf.username=admin -Dsonar.pdf.password=SonarQube123*
主要是加入了(-Dsonar.pdf.username=admin -Dsonar.pdf.password=SonarQube123)
至此就可以生成PDF报告了。
标签:java,scanner,生成,org,sonar,PDF,pdf,SpringComponentContainer From: https://blog.csdn.net/hk_kmkk/article/details/144672821