2012-02-15 81 views
0

安裝Jenkins(帶聲納插件)和聲納(帶cxx插件)。有一個構建步驟來創建「......./gcovr-reports/gcovr-result-test.xml」文件。問題是覆蓋率結果不顯示ob Snar儀表板。但是看起來sonar.runner正在刪除......但是成績單並未顯示CxxGcovrSensor正在運行。試圖讓聲納CXX插件工作

回答

0

你會得到什麼錯誤消息? 嘗試使用maven導入您的項目以獲取有關錯誤的更多詳細信息。

我有類似的問題,因爲我的pom.xml被打破。下面是一個工作。 確保您的文件夾結構是這樣的:

(你需要cd到基地)

基地= /一些/文件夾/ myProject的/ < - 把這裏

的pom.xml

SRC_FOLDER = /一些/文件夾/ myProject的/ src目錄

reports_folder = /一些/文件夾/ myProject的/報告(與所有的子目錄報表)

也確保您的報告被命名爲LIK:的xUnit對結果的.xml

cd到/一些/文件夾/ myProject的和MVN聲納:聲納 (MVN -X聲納:聲納調試模式)

(順便說一句。如果你得到奇怪的錯誤嘗試刪除聲納/外部/插件,所有無關的插件(剛剛離開CXX有)

不要忘記設置JAVA_PATH聲納 轉到basefolder

<?xml version="1.0" encoding="UTF-8"?> 
<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/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>NETICOA</groupId> 
    <artifactId>MYPROJECT</artifactId> 
    <version>5.3.10-myversion</version> 
    <packaging>pom</packaging> 
    <name>myProject</name> 

    <description>php svn code</description> 

    <!-- pom.xml extract --> 
    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>cxx-maven-plugin</artifactId> 
     <version>0.0.5-SNAPSHOT</version> 
     <configuration> 
      <sourceDirs> 
      <sourceDir>${basedir}/src</sourceDir> 
      </sourceDirs> 
      <!-- All of the sub configuration nodes following are needed by sonar-cxx plugin --> 
      <!-- This sample provided values are default values. --> 
      <!-- So you can simple remove all of it if you provide reports in the right places --> 
      <xunit> 
      <directory>${basedir}/reports/xunit-reports</directory> 
      <includes> 
       <include>**/xunit-result-*.xml</include> 
      </includes> 
      </xunit> 
      <gcovr> 
      <directory>${basedir}/reports/gcovr-reports</directory> 
      <includes> 
       <include>**/gcovr-reports-*.xml</include> 
      </includes> 
      </gcovr> 
      <cppcheck> 
      <directory>${basedir}/reports/cppcheck-reports</directory> 
      <includes> 
       <include>**/cppcheck-result-*.xml</include> 
      </includes> 
      <reportsIncludeSourcePath> 
       <include>..</include> 
      </reportsIncludeSourcePath> 
      </cppcheck> 
      <cppncss> 
      <directory>${basedir}/reports/cppncss-reports</directory> 
      <includes> 
       <include>**/cppncss-result-*.xml</include> 
      </includes> 
      <reportsIncludeSourcePath> 
       <include>..</include> 
      </reportsIncludeSourcePath> 
      </cppncss> 
      <veraxx> 
      <directory>${basedir}/reports/vera++-reports</directory> 
      <includes> 
       <include>**/vera++-result-*.xml</include> 
      </includes> 
      <reportsIncludeSourcePath> 
       <include>..</include> 
      </reportsIncludeSourcePath> 
      </veraxx> 
      <valgrind> 
      <directory>${basedir}/reports/valgrind-reports</directory> 
      <includes> 
       <include>**/valgrind-result-*.xml</include> 
      </includes> 
      <reportsIncludeSourcePath> 
       <include>..</include> 
      </reportsIncludeSourcePath> 
      </valgrind> 
     </configuration> 
     </plugin> 
    </plugins> 
    <!-- We have our own <configuration><sourceDirs> node inside cxx plugin configuration --> 
    <!-- <sourceDirectory>${basedir}/sources</sourceDirectory> --> 
    </build> 
    <properties> 
    <sonar.language>c++</sonar.language> 
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis> 
    </properties> 
</project>