如何在不使用XML的情况下排除findbugs gradle插件中的类
我试图在gradle设置中从findbugs分析中排除几个类如何在不使用XML的情况下排除findbugs gradle插件中的类,gradle,findbugs,Gradle,Findbugs,我试图在gradle设置中从findbugs分析中排除几个类 apply plugin: 'application' apply plugin: 'findbugs' .... tasks.withType(FindBugs) { def excludeProtobufFiles = 'com/turn/protobufkafka/' classes = classes.filter { !it.path.contains(excludeProtobufFiles) }
apply plugin: 'application'
apply plugin: 'findbugs'
....
tasks.withType(FindBugs) {
def excludeProtobufFiles = 'com/turn/protobufkafka/'
classes = classes.filter {
!it.path.contains(excludeProtobufFiles)
}
// Generate HTML output for findbugs
reports {
xml.enabled = false
html.enabled = true
}
}
通过此更改,gradle build
工作正常,但gradle check
失败:
:findbugsMain FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':findbugsMain'.
> No classes configured for FindBugs analysis.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.58 secs
gradle-check
工作,但是,如果我先运行gradle-build
。是否有一种方法可以排除findbugs的gradle中的文件,gradle检查
可以正常工作
没有排除的类,
gradle check
和gradle build
都可以正常工作 您是否尝试过该插件的excludes
属性@leeor我尝试了排除=['com/turn/protobufkafka/*']
。使用它,gradle check
和gradle build
都可以正常工作,但它不排除findbugs报告中列出的文件。完整的代码可以在上找到。您是否尝试过插件的excludes
属性@leeor我尝试了排除=['com/turn/protobufkafka/*']
。使用它,gradle check
和gradle build
都可以正常工作,但它不排除findbugs报告中列出的文件。完整代码可在