0

我有一份 Jenkins 工作,在 sonarscanner 的帮助下分析 java、css、heml 和 js 代码。我成功地分析了 java 代码,但是当涉及到 UI 代码时,Soanrqube 失败并出现以下错误:

java.lang.NullPointerException

05:28:00.442 INFO: Java Main Files AST scan (done) | time=45894ms
05:28:00.442 INFO: Java Test Files AST scan
05:28:00.445 INFO: 0 source files to be analyzed
05:28:00.448 INFO: Java Test Files AST scan (done) | time=6ms
05:28:00.448 INFO: Sensor JavaSquidSensor [java] (done) | time=56448ms
05:28:00.448 INFO: Sensor SonarCSS Metrics [cssfamily]
05:28:00.489 WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.
05:28:00.758 INFO: 0/0 source files have been analyzed
05:28:04.585 INFO: Sensor SonarCSS Metrics [cssfamily] (done) | time=4137ms
05:28:04.585 INFO: Sensor SonarCSS Rules [cssfamily]
05:28:04.585 DEBUG: Checking node version
05:28:04.671 DEBUG: Using Node.js v6.10.3
05:28:04.673 DEBUG: Deploying bundle to X:\AEMBD\PBCOM_BUILD\.scannerwork
05:32:15.661 INFO: ------------------------------------------------------------------------
05:32:15.661 INFO: EXECUTION FAILURE
05:32:15.661 INFO: ------------------------------------------------------------------------
05:32:15.661 INFO: Total time: 5:30.750s
05:32:15.825 INFO: Final Memory: 40M/1608M
05:32:15.825 INFO: ------------------------------------------------------------------------
05:32:15.826 ERROR: Error during SonarScanner execution
java.lang.NullPointerException
    at org.sonar.css.plugin.CssRuleSensor.saveIssues(CssRuleSensor.java:165)
    at org.sonar.css.plugin.CssRuleSensor.execute(CssRuleSensor.java:97)
    at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45)
    at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)
    at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:62)
    at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:166)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:300)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:295)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:269)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
    at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
    at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
    at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)
    at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
    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:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
05:32:15.827 ERROR: 
05:32:15.828 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded?
ERROR: SonarQube scanner exited with non-zero code: 1

您可以在上面的代码片段中看到它能够检测到节点版本,然后在部署捆绑包时它失败了,不确定问题的原因。

4

0 回答 0