我使用SpotBugs Maven Plugin进行静态分析,并且我想从检查中排除一个目录。看看spotbugs:check的goal documentation,似乎是不可能把插件配置成这样的方式的。我还查看了SpotBugs filter file的文档。
在Apache Maven PMD插件中,这可以通过使用excludeRoots参数来完成:
<excludeRoots>
<excludeRoot>target</excludeRoot>
</excludeRoots>是否可以从SpotBugs检查中排除目录?
发布于 2018-09-15 15:30:38
可以使用SpotBugs将目录排除在检查之外,尽管这种方法与您为PMD描述的方法不同。这是一个分两步走的过程:
<excludeFilterFile>设置引用该文件。不幸的是,the documentation for that setting非常简短。举个简单的例子:
<Source>.<excludeFilterFile>名称标签,请参阅Java element name matching一节,以使mydir被SpotBugs忽略:ignore.xml
备注:
<includeFilterFile>标签。请参阅标题为在the usage documentation.Source,SpotBugs提供了其他几种方法来指定哪些代码将被包括或排除在检查之外。有关Package、Class、Method、Local、Field和Type标记,请参阅筛选器文件文档。https://stackoverflow.com/questions/52336795
复制相似问题