我正在尝试将SonarQube 5.2集成到我的Visual Studio Online版本中。
构建在我自己的服务器上的远程代理上运行。我已将SonarQube端点设置为直接与SonarQube服务器通信(即没有反向代理)。
当SonarQubePostTest运行时,它会失败,并显示以下错误:
2015-11-12T22:41:59.0293414Z 09:41:58.938 INFO - Analysis reports generated in 117288ms, dir size=37 MB
2015-11-12T22:45:28.0567728Z 09:45:26.238 INFO - Analysis reports compressed in 207298ms, zip size=12 MB
2015-11-12T22:47:55.3928880Z INFO: ------------------------------------------------------------------------
2015-11-12T22:47:55.3940296Z INFO: EXECUTION FAILURE
2015-11-12T22:47:55.3951554Z INFO: ------------------------------------------------------------------------
2015-11-12T22:47:55.3962719Z Total time: 51:43.279s
2015-11-12T22:48:08.4514340Z Final Memory: 13M/558M
2015-11-12T22:48:08.4525453Z INFO: ------------------------------------------------------------------------
2015-11-12T22:48:09.3082945Z ##[error]ERROR: Error during Sonar runner execution
2015-11-12T22:48:09.3094208Z ##[error]org.sonar.runner.impl.RunnerException: Unable to execute Sonar
2015-11-12T22:48:09.3417383Z ##[error]at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
2015-11-12T22:48:09.3428745Z ##[error]at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
2015-11-12T22:48:09.3440122Z ##[error]at java.security.AccessController.doPrivileged(Native Method)
2015-11-12T22:48:09.3450211Z ##[error]at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
2015-11-12T22:48:09.3635183Z ##[error]at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
2015-11-12T22:48:09.3646212Z ##[error]at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
2015-11-12T22:48:09.3657888Z ##[error]at org.sonar.runner.api.Runner.execute(Runner.java:100)
2015-11-12T22:48:09.3677948Z ##[error]at org.sonar.runner.Main.executeTask(Main.java:70)
2015-11-12T22:48:09.3689593Z ##[error]at org.sonar.runner.Main.execute(Main.java:59)
2015-11-12T22:48:09.3711490Z ##[error]at org.sonar.runner.Main.main(Main.java:53)
2015-11-12T22:48:09.3732565Z ##[error]Caused by: com.github.kevinsawicki.http.HttpRequest$HttpRequestException: java.io.IOException: Error writing to server
2015-11-12T22:48:09.3743874Z ##[error]at com.github.kevinsawicki.http.HttpRequest.code(HttpRequest.java:1483)
2015-11-12T22:48:09.3755288Z ##[error]at com.github.kevinsawicki.http.HttpRequest.ok(HttpRequest.java:1508)
2015-11-12T22:48:09.3766696Z ##[error]at org.sonar.batch.report.ReportPublisher.uploadMultiPartReport(ReportPublisher.java:173)
2015-11-12T22:48:09.3777774Z ##[error]at org.sonar.batch.report.ReportPublisher.sendOrDumpReport(ReportPublisher.java:151)
2015-11-12T22:48:09.3789096Z ##[error]at org.sonar.batch.report.ReportPublisher.execute(ReportPublisher.java:115)
2015-11-12T22:48:09.3800619Z ##[error]at org.sonar.batch.phases.PhaseExecutor.publishReportJob(PhaseExecutor.java:116)
2015-11-12T22:48:09.3812026Z ##[error]at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:106)
2015-11-12T22:48:09.3823514Z ##[error]at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
2015-11-12T22:48:09.3833631Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
2015-11-12T22:48:09.3855032Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
2015-11-12T22:48:09.4254651Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258)
2015-11-12T22:48:09.4264623Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253)
2015-11-12T22:48:09.4276010Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243)
2015-11-12T22:48:09.4287306Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
2015-11-12T22:48:09.4298674Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
2015-11-12T22:48:09.4498418Z ##[error]at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
2015-11-12T22:48:09.4509786Z ##[error]at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
2015-11-12T22:48:09.4519848Z ##[error]at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76)
2015-11-12T22:48:09.4529835Z ##[error]at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
2015-11-12T22:48:09.4541133Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2015-11-12T22:48:09.4642751Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2015-11-12T22:48:09.4663858Z ##[error]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2015-11-12T22:48:09.4673875Z ##[error]at java.lang.reflect.Method.invoke(Method.java:606)
2015-11-12T22:48:09.4684992Z ##[error]at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
2015-11-12T22:48:09.4695058Z ##[error]... 9 more
2015-11-12T22:48:09.4766608Z ##[error]Caused by: java.io.IOException: Error writing to server
2015-11-12T22:48:09.4777939Z ##[error]at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:625)
2015-11-12T22:48:09.4789268Z ##[error]at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:637)
2015-11-12T22:48:09.4809326Z ##[error]at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1321)
2015-11-12T22:48:09.4820645Z ##[error]at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
2015-11-12T22:48:09.4831212Z ##[error]at com.github.kevinsawicki.http.HttpRequest.code(HttpRequest.java:1481)
2015-11-12T22:48:09.4832031Z ##[error]... 32 more
2015-11-12T22:48:09.4843472Z ##[error]ERROR:
2015-11-12T22:48:09.4998605Z ##[error]ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
2015-11-12T22:48:10.4319112Z ##[error]The sonar-runner did not complete successfully
2015-11-12T22:48:10.6357627Z 09:48:10.569 Creating a summary markdown file...
2015-11-12T22:48:10.8388856Z ##[error]Post-processing failed. Exit code: 1
2015-11-12T22:48:16.2303447Z ##[error]Unexpected exit code received from batch file: 1
我使用以下命令在构建服务器上手动运行SonarQube Runner:
cd "C:\vso-agent\_work\1\s\"
"C:\vso-agent\tasks\SonarQubePreBuild\1.0.29\MSBuild.SonarQube.Runner-1.0.1\MSBuild.SonarQube.Runner.exe" begin /k:MYPROJ /n:MyProject /v:1.0 /d:sonar.host.url=http://sonarqube.mydomain.com.au:9000
"C:\Program Files (x86)\MSBuild\14.0\bin\amd64\msbuild.exe" MyProject.sln /p:platform="Any CPU" /p:configuration="Release" /p:VisualStudioVersion="14.0"
"C:\vso-agent\tasks\SonarQubePreBuild\1.0.29\MSBuild.SonarQube.Runner-1.0.1\MSBuild.SonarQube.Runner.exe" end
结果是一样的。