簡體   English   中英

從聲納的“新代碼覆蓋率”中排除 javascript 文件

[英]Exclude javascript files from sonar's “Coverage on new code”

SonarQube ,“新代碼覆蓋率”考慮了我的 Java Web 應用程序的javajs文件。 是否可以從中排除js文件?

我正在使用:

  • SonarQube-6.7.1社區版。
  • Jacoco maven 插件,用於 Java 代碼的代碼覆蓋。

對於 jacoco maven 插件,只需添加配置以排除以下文件:

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.7.9</version>
    <extensions>true</extensions>
    <configuration>
        <excludes>
            <exclude>org/yates/webapp/web/config/*.class</exclude>
        </excludes>
    </configuration>
</plugin>

對於 SonarQube 您可以設置sonar.exclusions屬性

sonar.exclusions=src/main/java/org/sonar/*

請參閱以下文檔: https : //docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreFiles

更新:

對於 SONAR 覆蓋排除:

<properties>
    <sonar.coverage.exclusions>foo/**/*,**/bar/*</sonar.coverage.exclusions>
</properties>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM