Error during Quality analysis of Csharp code
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.e开发者_如何转开发xecute(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
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/
精彩评论