在maven中限制由Findbugs分析的类

时间:2012-11-26 05:44:08

标签: maven findbugs

如何仅针对某些包限制要分析的类。 在一个模块中,我不希望为某些包运行用于Maven的findbugs。我该如何排除它们。是否有任何方法可以指定由Findbugs of Maven消除的包装

1 个答案:

答案 0 :(得分:3)

请参阅 - http://mojo.codehaus.org/findbugs-maven-plugin/usage.html

使用mvn site而不是mvn findbugs:findbugs

您需要在配置标记下使用包含排除过滤器文件或仅使用分析。

<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>

相关问题