Csharp 代码质量分析期间出错
通过“mvn sonar:sonar”命令启动质量分析时出现以下错误。
一些信息可能对您有帮助。
- 声纳版本:2.9
- 在 .sln 文件所在的同一目录中创建了 POM.xml
- .sln 文件具有我想要对其进行质量分析的 Csharp 代码。
- Sonar 正在使用默认的 derby
异常信息
[INFO] Excluded sources : [**/Reference.cs, **/*.designer.cs, **/*.Designer.cs]
[INFO] Selected quality profile : [name=Sonar C# Way,language=cs]
[INFO] Loading i18n bundles
[INFO] Compare to previous analysis (2011-09-08)
[INFO] Compare over 5 days (2011-09-08, analysis of 2011-09-08 19:02:00.235)
[INFO] Compare over 30 days (2011-08-14, analysis of 2011-09-08 19:02:00.235)
[INFO] Gallio won't execute as there are no test projects.
[INFO] Configure maven plugins...
[INFO] Sensor AsynchronousMeasuresSensor...
[INFO] Sensor AsynchronousMeasuresSensor done: 16 ms
[INFO] Sensor org.sonar.plugins.csharp.core.CSharpSourceImporter@1125a40...
[INFO] Sensor org.sonar.plugins.csharp.core.CSharpSourceImporter@1125a40 done:
188 ms
[INFO] Sensor com.sonar.plugins.csharp.squid.C@155aa19...
[INFO] Sensor com.sonar.plugins.csharp.squid.C@155aa19 done: 1609 ms
[INFO] Sensor org.sonar.plugins.csharp.gendarme.GendarmeSensor@1df3bec...
[INFO] Gendarme executable not found: 'C:\Program Files\gendarme-2.10-bin\genda
rme.exe'. The embedded version (2.10) will be used instead.
[INFO] Skipping the non generated assembly of project : BusinessLogic
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: No assembly to scan. Please check your project's Gendarme plugin
configuration.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: java.lang.IllegalStateException: No assembly to scan. Please check your project's Gendarme plugin configuration.
at org.sonar.dotnet.tools.gendarme.GendarmeCommandBuilder.validate(GendarmeCommandBuilder.java:263)
at org.sonar.dotnet.tools.gendarme.GendarmeCommandBuilder.toCommand(GendarmeCommandBuilder.java:177)
at org.sonar.dotnet.tools.gendarme.GendarmeRunner.execute(GendarmeRunner.java:133)
at org.sonar.plugins.csharp.gendarme.GendarmeSensor.launchGendarme(GendarmeSensor.java:149)
at org.sonar.plugins.csharp.gendarme.GendarmeSensor.analyse(GendarmeSensor.java:115)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:63)
at org.sonar.batch.phases.Phases.execute(Phases.java:93)
at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:145)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:106)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:101)
at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:96)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:96)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.Batch.execute(Batch.java:74)
at org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:154)
at org.sonar.maven.SonarMojo.execute(SonarMojo.java:143)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Tue Sep 13 10:52:39 IST 2011
[INFO] Final Memory: 15M/34M
I am getting following error while launching quality analysis via "mvn sonar:sonar" command.
Few info which might be helpful to you.
- Sonar Version:2.9
- Created POM.xml at the same dir where .sln file resides
- .sln file has Csharp code for which i want to do quality analysis.
- Sonar is using default derby
Exception information
[INFO] Excluded sources : [**/Reference.cs, **/*.designer.cs, **/*.Designer.cs]
[INFO] Selected quality profile : [name=Sonar C# Way,language=cs]
[INFO] Loading i18n bundles
[INFO] Compare to previous analysis (2011-09-08)
[INFO] Compare over 5 days (2011-09-08, analysis of 2011-09-08 19:02:00.235)
[INFO] Compare over 30 days (2011-08-14, analysis of 2011-09-08 19:02:00.235)
[INFO] Gallio won't execute as there are no test projects.
[INFO] Configure maven plugins...
[INFO] Sensor AsynchronousMeasuresSensor...
[INFO] Sensor AsynchronousMeasuresSensor done: 16 ms
[INFO] Sensor org.sonar.plugins.csharp.core.CSharpSourceImporter@1125a40...
[INFO] Sensor org.sonar.plugins.csharp.core.CSharpSourceImporter@1125a40 done:
188 ms
[INFO] Sensor com.sonar.plugins.csharp.squid.C@155aa19...
[INFO] Sensor com.sonar.plugins.csharp.squid.C@155aa19 done: 1609 ms
[INFO] Sensor org.sonar.plugins.csharp.gendarme.GendarmeSensor@1df3bec...
[INFO] Gendarme executable not found: 'C:\Program Files\gendarme-2.10-bin\genda
rme.exe'. The embedded version (2.10) will be used instead.
[INFO] Skipping the non generated assembly of project : BusinessLogic
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: No assembly to scan. Please check your project's Gendarme plugin
configuration.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: java.lang.IllegalStateException: No assembly to scan. Please check your project's Gendarme plugin configuration.
at org.sonar.dotnet.tools.gendarme.GendarmeCommandBuilder.validate(GendarmeCommandBuilder.java:263)
at org.sonar.dotnet.tools.gendarme.GendarmeCommandBuilder.toCommand(GendarmeCommandBuilder.java:177)
at org.sonar.dotnet.tools.gendarme.GendarmeRunner.execute(GendarmeRunner.java:133)
at org.sonar.plugins.csharp.gendarme.GendarmeSensor.launchGendarme(GendarmeSensor.java:149)
at org.sonar.plugins.csharp.gendarme.GendarmeSensor.analyse(GendarmeSensor.java:115)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:63)
at org.sonar.batch.phases.Phases.execute(Phases.java:93)
at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:145)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:106)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:101)
at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:96)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:96)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.Batch.execute(Batch.java:74)
at org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:154)
at org.sonar.maven.SonarMojo.execute(SonarMojo.java:143)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Tue Sep 13 10:52:39 IST 2011
[INFO] Final Memory: 15M/34M
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的第一个猜测是,您的解决方案从未在声纳分析之前构建过。使用您觉得合适的任何工具(例如 msbuild)构建您的解决方案,然后重试 mvn sonar:sonar。
如果这不起作用,请向用户邮件列表寻求帮助:http://www.sonarsource.org /支持/支持/
My first guess is that your solution has never been build prior tot he sonar analysis. Build your solution with whatever tool you feel comfortable, msbuild for example then retry mvn sonar:sonar.
If that does not work, ask for help to the user mailing list : http://www.sonarsource.org/support/support/