在多模块项目中使用Null指针异常的声纳运行器退出(一个在C#中,另一个在JavaScript中)

时间:2012-11-22 16:50:03

标签: sonarqube sonar-runner

我正在尝试在声纳中配置一个多模块项目,以涵盖我们应用程序的所有方面(主要是C#和JavaScript部分)

如果我单独在C#部分运行它(不使用多模块架构),它就可以正常运行。如果我运行不同的模块,它会中断。

我选择在不同模块之间拆分配置。 (并将所有配置放在同一个文件中会得到相同的结果)

下面是3配置。

主要的一个:

# Project identification
sonar.projectKey=XXXXX
sonar.projectVersion=XXXXX
sonar.projectName=XXXXXX

# Info required for Sonar 
sonar.sourceEncoding=UTF-8
sonar.sources=.
sonar.modules = csharp, javascript

# C#
csharp.sonar.projectBaseDir=path/to/slnFolder

# JS
javascript.sonar.projectBaseDir=path/to/js/files

用于C#的文件

# C#
sonar.projectName=XXXX CS
sonar.language=cs

#Core C# Settings 
sonar.dotnet.visualstudio.solution.file=MyProject.sln
sonar.dotnet.excludeGeneratedCode=true
sonar.dotnet.version=3.5

#Gendarme
sonar.gendarme.mode=  
# Gallio 
sonar.gallio.mode= skip
# FXCop 
sonar.fxcop.mode=
#StyleCop 
sonar.stylecop.mode=
#NDeps
sonar.ndeps.mode=skip

javascript one:

# JS
sonar.projectName=3DSaphi JS
sonar.language=js

我最终遇到的异常(似乎与dotnet模块有关):

Exception in thread "main" org.sonar.runner.RunnerException: java.lang.NullPoint
erException
        at org.sonar.runner.Runner.delegateExecution(Runner.java:288)
        at org.sonar.runner.Runner.execute(Runner.java:151)
        at org.sonar.runner.Main.execute(Main.java:84)
        at org.sonar.runner.Main.main(Main.java:56)
Caused by: java.lang.NullPointerException
        at org.sonar.plugins.dotnet.api.sensor.AbstractRegularDotNetSensor.assem
bliesFound(AbstractRegularDotNetSensor.java:90)
        at org.sonar.plugins.dotnet.api.sensor.AbstractRegularDotNetSensor.shoul
dExecuteOnProject(AbstractRegularDotNetSensor.java:72)
        at org.sonar.plugins.dotnet.api.sensor.AbstractRuleBasedDotNetSensor.sho
uldExecuteOnProject(AbstractRuleBasedDotNetSensor.java:51)
        at org.sonar.api.batch.BatchExtensionDictionnary.shouldKeep(BatchExtensi
onDictionnary.java:109)
        at org.sonar.api.batch.BatchExtensionDictionnary.getFilteredExtensions(B
atchExtensionDictionnary.java:99)
        at org.sonar.api.batch.BatchExtensionDictionnary.select(BatchExtensionDi
ctionnary.java:57)
        at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:5
7)
        at org.sonar.batch.phases.Phases.execute(Phases.java:97)
        at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:12
8)
        at org.sonar.batch.bootstrap.Module.start(Module.java:83)
        at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:114)
        at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:109)
        at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:104)
        at org.sonar.batch.bootstrap.Module.start(Module.java:83)
        at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.jav
a:121)
        at org.sonar.batch.bootstrap.Module.start(Module.java:83)
        at org.sonar.batch.Batch.execute(Batch.java:104)
        at org.sonar.runner.internal.batch.Launcher.executeBatch(Launcher.java:6
9)
        at org.sonar.runner.internal.batch.Launcher.execute(Launcher.java:61)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonar.runner.Runner.delegateExecution(Runner.java:285)
        ... 3 more

所以我的问题是:

我正在尝试做甚么可能吗? 如果是的话,有什么想法可以解决这个问题吗?

提前致谢。

0 个答案:

没有答案