SonarQube sacanner和jacoco.exec文件

时间:2017-02-01 13:45:09

标签: jenkins sonarqube

当我使用带有SonarQube扫描仪的jenkins分析我的项目(java 1.8)时,我遇到了错误。 当它尝试读取jacoco.exec报告时,作业失败并设置了以下错误:

错误:SonarQube扫描程序执行期间出错 java.lang.UnsupportedOperationException:传感器不应计算度量标准'overall_lines_to_cover'     at org.sonar.scanner.sensor.DefaultSensorStorage.saveMeasure(DefaultSensorStorage.java:240)     at org.sonar.scanner.index.DefaultIndex.addMeasure(DefaultIndex.java:231)     at org.sonar.scanner.deprecated.DeprecatedSensorContext.saveMeasure(DeprecatedSensorContext.java:131)     在org.sonar.plugins.jacoco.JaCoCoOverallSensor $ OverallAnalyzer.saveMeasures(JaCoCoOverallSensor.java:101)     在org.sonar.plugins.jacoco.AbstractAnalyzer.readExecutionData(AbstractAnalyzer.java:150)     在org.sonar.plugins.jacoco.AbstractAnalyzer.analyse(AbstractAnalyzer.java:114)     在org.sonar.plugins.jacoco.JaCoCoOverallSensor.analyse(JaCoCoOverallSensor.java:80)     在org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)     在org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)     在org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)     在org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)     在org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)     在org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)     在org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:247)     在org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:242)     在org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:240)     在org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:232)     在org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)     在org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)     在org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)     在org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)     在org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)     在org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)     在org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)     在org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:116)     在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)     在java.lang.reflect.Method.invoke(Method.java:497)     在org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)     在com.sun.proxy。$ Proxy0.execute(未知来源)     在org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)     在org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)     在org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)     在org.sonarsource.scanner.cli.Main.execute(Main.java:74)     在org.sonarsource.scanner.cli.Main.main(Main.java:61)

我使用SonarQube扫描仪2.8和Sonar 6.2版本以及3.10 java插件。

自从我将Sonar服务器从5.3升级到6.2后,问题似乎已经出现了......

任何人都可以帮我解决这个问题吗?

我为我的近似英语道歉。

1 个答案:

答案 0 :(得分:1)

我们已经看到了同样的问题" Metric' overall_lines_to_cover'不应该由传感器"这里。

Java插件的版本是3.14。

更新到4.4.0.8066后,问题就消失了。

感谢你指出@ G.Ann。