声纳/ maven上下文:Gallio执行失败。搜索原因:?

时间:2011-12-01 08:23:21

标签: .net maven sonarqube gallio

我有一个服务器2008持续集成框,我想在其上使用Gallio,以便为我的Sonar仪表板执行我的MSTests和PartCover。

我安装了Gallio 3.3.1 x64和PartCover,依此类推。

Gallio通过Icarus在我的测试程序集上工作(感谢this回答)

然而,通过声纳,我有这个令人费解的日志痕迹(见下文)。尽管我的测试程序集被认定为测试项目,但Gallio的错误消息是

'Embedded error: Gallio execution failed.
No test assembly was found. Please check your project's Gallio plugin configuration.'

有关如何跟踪和解决此问题的任何想法吗?

谢谢,

注意:由于某些原因,我无法在Gallio用户群上发布此问题,所以我尝试了。

[INFO] Execute: org.codehaus.sonar:sonar-maven-plugin:2.11:sonar
[INFO] [sonar:sonar {execution: default-sonar}]
[INFO]  Database dialect class org.sonar.jpa.dialect.Derby
[INFO]  Initializing Hibernate
[INFO]  The following 'sln' file has been found and will be used: D:\toto.sln
[INFO]  The project 'toto.Test' has been qualified as a test project.
[INFO]  The project 'titi.Test' has been qualified as a test project.

[INFO]  -------------  Analyzing toto
[INFO]  Selected quality profile : [name=Sonar C# Way,language=cs]
[INFO]  Configure maven plugins...
[INFO]  Compare to previous analysis (2011-11-30)
[INFO]  Compare over 5 days (2011-11-25, analysis of 2011-11-29 10:52:11.443)
[INFO]  Compare over 30 days (2011-10-31, analysis of 2011-11-29 10:52:11.443)
[INFO]  Initializer CSharpProjectInitializer...
[INFO]  Initializer CSharpProjectInitializer done: 6 ms
[INFO]  Skipping the non generated assembly of project : toto
[INFO]  No assembly to check with Gendarme
[INFO]  Skipping the non generated assembly of project : toto
[INFO]  No assembly to check with FxCop
[INFO]  Sensor org.sonar.plugins.csharp.core.CSharpSourceImporter@1acc1c2...
[INFO]  Sensor org.sonar.plugins.csharp.core.CSharpSourceImporter@1acc1c2 done: 116 ms
[INFO]  Sensor com.sonar.plugins.csharp.squid.C@caf6e7...
[INFO]  Sensor com.sonar.plugins.csharp.squid.C@caf6e7 done: 233 ms
[INFO]  Sensor org.sonar.plugins.csharp.gallio.GallioSensor@1b4bc2a...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar

Embedded error: Gallio execution failed.
No test assembly was found. Please check your project's Gallio 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 ...

如果需要,这是POM:

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>totoGroup</groupId>
  <artifactId>toto</artifactId>
  <name>TOTO</name>
  <version>0.0.1-SNAPSHOT</version>
   <packaging>netpack</packaging>

    <profiles> 
 <profile>
      <id>sonar-dotnet</id>
      <activation>
        <!-- Optional activation by default -->
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <!-- Location of the the .Net installations (pick the one you need) -->
        <dotnet.4.0.sdk.directory>C:/Windows/Microsoft.NET/Framework/v4.0.30319</dotnet.4.0.sdk.directory>
        <fxcop.directory>C:/Program Files (x86)/Microsoft Fxcop 10.0</fxcop.directory>
        <partcover.directory>C:\Program Files (x86)\PartCover\PartCover .NET 4.0</partcover.directory>
        <sourcemonitor.directory>C:/Program Files (x86)/SourceMonitor</sourcemonitor.directory>
        <stylecop.directory>C:\Program Files (x86)\StyleCop 4.6</stylecop.directory>

        <sonar.host.url>http://10.101.99.198:20000</sonar.host.url>

      </properties>
   </profile>

   </profiles>

  <properties>
        <sonar.dotnet.visualstudio.solution.file>toto.sln</sonar.dotnet.visualstudio.solution.file>
    <sonar.dotnet.version>4.0</sonar.dotnet.version>
    <sonar.language>cs</sonar.language>
    <sonar.sourceEncoding>UTF-8</sonar.sourceEncoding>
  </properties>

  <build>
    <plugins>

      <plugin>
        <groupId>org.codehaus.sonar-plugins.dotnet</groupId>
        <artifactId>maven-dotnet-plugin</artifactId>
        <version>1.1</version>
        <extensions>true</extensions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <configuration>
          <language>cs</language>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

1 个答案:

答案 0 :(得分:9)

为他自己说的话(感谢sunr_user邮件列表上的Fabrice Bellingard):

  

好的,您正在使用“Release”构建构建项目   配置,以便在Jenkins日志中看到,编译好了   程序集最终位于“bin / release”文件夹中。但是,你运行   使用默认参数进行声纳分析,以及C#插件的外观   进入“bin / Debug”文件夹以查找程序集。

     

所以你有2个解决方案:•要么用。编译项目   “Debug”构建配置•或者指定以下属性   对于声纳分析:“sonar.dotnet.buildConfigurations = Release”   (请参阅Wiki上该属性的文档)