本文介绍了NDepend SonarQube集成生成java.lang.NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

当尝试将NDepend集成到SonarQube中时,会生成NullPointerException,说明必须将属性"sonar.cs.ndepend.projectPath"设置为绝对路径"

When trying to integrate NDepend into SonarQube, a NullPointerException is generated saying that "The property "sonar.cs.ndepend.projectPath" must be set (to an absolute path)"

我遵循了说明,但是现在我很茫然.有任何想法吗?

I followed the instructions but right now I'm at a loss. Any ideas, anyone?

NDepend版本:6.3.0 ProfessionalSonarQube版本:6.0

NDepend version: 6.3.0 ProfessionalSonarQube version: 6.0

完整异常堆栈跟踪:

    ERROR: Error during SonarQube Scanner execution
java.lang.NullPointerException: The property "sonar.cs.ndepend.projectPath" must be set (to an absolute path).
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
    at org.sonar.plugins.ndepend.NDependConfiguration.checkAbsolutePath(NDependConfiguration.java:56)
    at org.sonar.plugins.ndepend.NDependConfiguration.ndependProjectPath(NDependConfiguration.java:47)
    at org.sonar.plugins.ndepend.NDependSensor.analyze(NDependSensor.java:84)
    at org.sonar.plugins.ndepend.NDependSensor.analyse(NDependSensor.java:78)
    at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
    at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
    at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:184)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234)
    at org.sonar.scanner.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.scanner.task.ScanTask.execute(ScanTask.java:47)
    at org.sonar.scanner.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.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118)
    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)

推荐答案

像这样执行MSBuild.SonarQube.Runner.exe时,是否指定了sonar.cs.ndepend.projectPath变量:

Do you specified the sonar.cs.ndepend.projectPath variable when executing the MSBuild.SonarQube.Runner.exe like this:

MSBuild.SonarQube.Runner.exe开始/key:{SonarQube项目密钥}/名称:{SQ项目名称}/版本:{SQ项目版本} /d:sonar.cs.ndepend.projectPath= { ndproj的路径}

MSBuild.SonarQube.Runner.exe begin /key:{SonarQube project key} /name:{SQ project name} /version:{SQ project version} /d:sonar.cs.ndepend.projectPath={the path of ndproj}

还是您使用sonar-runner命令启动分析?

Or do you launch the analysis using the sonar-runner command?

这篇关于NDepend SonarQube集成生成java.lang.NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 14:59