3

我正在尝试在声纳中配置一个多模块项目以覆盖我们应用程序的所有方面(主要是 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 之一:

# 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

所以我的问题是:

我想要做的甚至可能吗?如果是的话,知道我能做些什么来解决这个问题吗?

提前致谢。

4

0 回答 0