簡體   English   中英

限制 Maven 中 Findbugs 要分析的類

[英]Limit classes to be analyzed by Findbugs in maven

如何限制僅對某些包進行分析的類。 在模塊中,我不希望為某些包運行 Maven 的 findbugs。 我怎樣才能排除它們。 有沒有辦法指定Maven的Findbugs要消除的包

請參考 - http://mojo.codehaus.org/findbugs-maven-plugin/usage.html

使用mvn site而不是 mvn findbugs:findbugs

您需要在配置標簽或 onlyAnalyze 下使用包含排除過濾器文件。

<reporting>
<plugins>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>findbugs-maven-plugin</artifactId>
    <version>2.5.2</version>
    <configuration>
      <excludeFilterFile>src/main/resources/findbugs-exclude.xml</excludeFilterFile>
      <includeFilterFile>src/main/resources/findbugs-include.xml</includeFilterFile>
      <onlyAnalyze>com.packagename.*</onlyAnalyze>
    </configuration>
  </plugin>
</plugins>

示例過濾器文件

<FindBugsFilter>
<Match>
    <Package name="~com\.ly\..*"/>
</Match>

暫無
暫無

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

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