首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >正在尝试使Sonar CXX插件工作

正在尝试使Sonar CXX插件工作
EN

Stack Overflow用户
提问于 2012-02-16 03:32:13
回答 1查看 2K关注 0票数 0

设置Jenkins (带有声纳插件)和声纳(带有cxx插件)。有一个构建步骤来创建“......./gcovr-report/gcovr-result-test.xml”文件。问题是覆盖结果没有显示在ob Snar仪表板上。但看起来sonar.runner正在执行...但文字记录没有显示CxxGcovrSensor正在运行。

EN

回答 1

Stack Overflow用户

发布于 2012-03-09 06:19:21

你得到了什么错误信息?尝试使用maven导入您的项目,以了解有关错误消息的更多详细信息。

我也有类似的问题,因为我的pom.xml坏了。下面是一个有效的方法。确保您的文件夹结构如下所示:

(您需要cd to base)

base=/some/folder/myProject/ <--将pom.xml放在这里

src_folder=/some/folder/myProject/src

reports_folder=/some/folder/myProject/reports (包含报表的所有子目录)

还要确保将报告命名为lik: xunit-result-.xml

cd到/some/folder/myProject和mvn sonar:sonar (mvn -X sonar:用于调试模式的sonar)

(顺便说一下。如果你得到奇怪的错误,试着从声纳/外部/插件中删除所有不相关的插件(只需留下cxx )

别忘了将声纳的JAVA_PATH设置到基本文件夹

代码语言:javascript
运行
复制
<?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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9299991

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档