0
我想將FindBugsExtension設置爲Gradle。它可以工作,但我無法用excludeFilter
選項排除特定模式。FindBugs不排除使用Gradle的過濾模式
我有以下gradle這個FindBugs的定義:
findbugs {
toolVersion = "2.0.1"
reportsDir = file("$project.buildDir/findbugsReports")
effort = "max"
reportLevel = "high"
excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml")
}
在excludeFilter.xml
我有以下排除定義:
<FindBugsFilter>
<Match>
<Bug pattern="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE"/>
</Match>
</FindBugsFilter>
但是當我運行gradle findBugsMain
它,因爲它可以找到FindBugs的錯誤失敗:
<BugCollection version="2.0.1" sequence="0" timestamp="1348055542169" analysisTimestamp="1348055545581" release="">
<!-- ... -->
<BugInstance type="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE" priority="2" abbrev="NP" category="STYLE">
<!-- ... -->
這是一個已知問題,在[1.2發行說明]記錄(http://www.gradle.org/docs/current/release -notes#configuration-options-for-findbugs-plugin),並且在即將發佈的1.3版本中已經修復。 –
@PeterNiederwieser謝謝,我已經更新了我的答案。 –