我已经使用 Jenkins 的 SonarQube 插件成功地集成了 SonarQube 和 Jenkins。声纳分析似乎成功,但我在声纳仪表板上看不到结果。这是堆栈跟踪:
INFO: Sensor SCM Sensor
INFO: SCM provider for this project is: git
INFO: 6 files to be analyzed
INFO: 6/6 files analyzed
INFO: Sensor SCM Sensor (done) | time=343ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=12ms
INFO: Sensor Code Colorizer Sensor
INFO: Sensor Code Colorizer Sensor (done) | time=1ms
INFO: Sensor CPD Block Indexer
INFO: JavaCpdBlockIndexer is used for java
INFO: Sensor CPD Block Indexer (done) | time=20ms
INFO: Calculating CPD for 6 files
INFO: CPD calculation finished
INFO: Analysis report generated in 65ms, dir size=39 KB
INFO: Analysis reports compressed in 187ms, zip size=23 KB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 4.083s
INFO: Final Memory: 50M/385M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
org.sonarqube.ws.client.HttpException: Error 500 on http://localhost:9000/api/ce/submit?projectKey=helloworld&projectName=Simple%20Java%20project%20analyzed%20with%20the%20SonarQube%20Runner
at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:34)
at org.sonar.batch.bootstrap.BatchWsClient.failIfUnauthorized(BatchWsClient.java:99)
at org.sonar.batch.bootstrap.BatchWsClient.call(BatchWsClient.java:69)
at org.sonar.batch.report.ReportPublisher.upload(ReportPublisher.java:172)
at org.sonar.batch.report.ReportPublisher.execute(ReportPublisher.java:127)
at org.sonar.batch.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:64)
at org.sonar.batch.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:51)
at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:86)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
at org.sonarsource.scanner.cli.Main.execute(Main.java:72)
at org.sonarsource.scanner.cli.Main.main(Main.java:60)
当我点击链接时,它说
{"errors":[{"msg":"HTTP method POST is required"}]}
我认为解决方案是重新配置 SQ,使其直接使用目标 URL,但我该怎么做呢?