2013-11-15 105 views
0

我正在嘗試使用聲吶分析我的解決方案(C#.NET)。無法運行聲吶

14:53:19.646 DEBUG - Release semaphore on project : [email protected][id=3169,key=com.exigenservices:cm,qualifier=TRK], with key batch-com.exigenservices:cm 
INFO: ------------------------------------------------------------------------ 
INFO: EXECUTION FAILURE 
INFO: ------------------------------------------------------------------------ 
Total time: 2:12.629s 
Final Memory: 13M/405M 
ERROR: Error during Sonar runner execution 
INFO: ------------------------------------------------------------------------ 
org.sonar.runner.impl.RunnerException: Unable to execute Sonar 
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91) 
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) 
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) 
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) 
    at org.sonar.runner.api.Runner.execute(Runner.java:90) 
    at org.sonar.runner.Main.executeTask(Main.java:70) 
    at org.sonar.runner.Main.execute(Main.java:59) 
    at org.sonar.runner.Main.main(Main.java:41) 
Caused by: java.util.NoSuchElementException 
    at java.util.HashMap$HashIterator.nextEntry(HashMap.java:929) 
    at java.util.HashMap$ValueIterator.next(HashMap.java:954) 
    at org.sonar.dotnet.tools.commons.visualstudio.VisualStudioProject.getArtifactDirectory(VisualStudioProject.java:178) 
    at org.sonar.dotnet.tools.commons.visualstudio.VisualStudioProject.getArtifact(VisualStudioProject.java:195) 
    at org.sonar.dotnet.tools.commons.visualstudio.VisualStudioProject.getGeneratedAssemblies(VisualStudioProject.java:209) 
    at org.sonar.plugins.csharp.api.sensor.AbstractRegularCSharpSensor.assembliesFound(AbstractRegularCSharpSensor.java:101) 
    at org.sonar.plugins.csharp.api.sensor.AbstractRegularCSharpSensor.shouldExecuteOnProject(AbstractRegularCSharpSensor.java:81) 
    at org.sonar.plugins.csharp.api.sensor.AbstractRuleBasedCSharpSensor.shouldExecuteOnProject(AbstractRuleBasedCSharpSensor.java:48) 
    at org.sonar.batch.bootstrap.BatchExtensionDictionnary.shouldKeep(BatchExtensionDictionnary.java:62) 
    at org.sonar.batch.bootstrap.BatchExtensionDictionnary.getFilteredExtensions(BatchExtensionDictionnary.java:52) 
    at org.sonar.batch.bootstrap.BatchExtensionDictionnary.select(BatchExtensionDictionnary.java:42) 
    at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:63) 
    at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114) 
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:150) 

其實在聲納緩存(.sonar)目錄提出以下插件:後不幸的是插件加載它與下面的堆棧跟蹤失敗

checkstyle 
core 
cpd 
csharp 
csharpfxcop 
csharpgallio 
csharpgendarme 
csharpndeps 
csharpsquid 
csharpstylecop 
dbcleaner 
design 
emailnotifications 
findbugs 
jacoco 
java 
l10nen 
mavenbatch 
pmd 
squidjava 
surefire 

不幸的是我沒有任何想法熱修復它,在哪裏由於聲納調試信息不​​佳而導致的問題。

回答

0

這意味着您的項目的CSPROJ文件不正確,並且缺少有關生成程序集的工件目錄的一些信息。

+0

謝謝你的提示,但也許你可以解釋聲納期望從csproj文件得到哪些xpath(以及在哪個命名空間中)?我想弄清楚問題在哪裏。我的項目文件具有OutputPath,具有XML標題,其根元素看起來像「'。它還有'PropertyGroup'內的'OutputPath',條件爲'Condition =''$(Configuration)| $(Platform)'=='Debug | AnyCPU'「'。 –

+0

你能編輯你的問題並複製粘貼CSPROJ文件的開頭嗎? (列出所有房產) –

1

Visual Studio項目解析器SonarQube的.Net插件期望找到使用此XPath輸出文件:

"/vst:Project/vst:PropertyGroup[contains(@Condition,'" + config + "')]/vst:OutputPath" 

其中config是它決定了它應該使用的構建配置。

從我可以告訴看current source code和您提供的異常堆棧跟蹤(不完全一致),異常是越來越在這條線拋出:

if (artifactDirectory == null) { 
    // just take the first one found... 
    artifactDirectory = buildConfOutputDirMap.values().iterator().next(); 

這意味着它無法爲您的項目找到任何構建輸出。

如果您發現csproj文件的OutputPath位置不同,請提交一份到SonarQube user mailing list的錯誤報告,以便將來修復它。