如何根据单个 Findbugs 检测器的结果使构建失败?
如果您使用 Findbugs 进行编译代码检查,是否有可能根据结果导致构建失败单个探测器或探测器类别?
例如,我想确保没有任何与空指针相关的检测(此列表)任何优先级。同样,我们真的不希望出现任何等待不在循环中的情况。也就是说,我不一定希望基于国际化检测的构建失败,因为这些对我们的应用程序并不立即至关重要。
期望的最终状态是一个我们可以针对从 IDE 级别(Eclipse 和 Netbeans)到发布级别(使用 CruiseControl 生成构建)的各种开发阶段进行调整的过程。
注意:我知道 Eclipse 和 Netbeans 都有类似的内置检测方法,但这是 FindBugs 的特定问题。
If you are using Findbugs for compiled code inspection, is it possible to fail a build based on the result of a single detector or category of detectors?
For example, I would like to ensure that I don't have any null pointer-related detections (prefix of "NP" in this list) of any priority. Likewise, we really don't want to have any wait not in loop situations. That said, I don't necessarily want to fail a build based on internationalization detections as those aren't immediately critical to our application.
The desired end-state would be a process that we could tune for a variety of development phases ranging from the IDE level (Eclipse and Netbeans) to the release level (builds are generated using CruiseControl).
NOTE: I am aware that Eclipse and Netbeans both have similar detection methods built-in but this is a FindBugs specific question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从使用 Ant 任务查找 Bug 部分:
从第 8 章开始:
和
因此,我会假设以下内容:
在您的包含过滤器中,并且
将是您正在寻找的内容。
path/to /includeFilter
(或excludeFilter
)可以是根据另一个属性的值设置的属性,该属性可以默认为dev
之类的值code> 用于常规构建,test
用于 CI 构建,deploy
用于部署构建,并指定您希望在每个阶段看到或不希望看到的特定警告。希望有帮助。
From the FindBugs Using the Ant Task section:
From Chapter 8:
and
So I would assume something along the lines of:
In your include filter and
Would be what you're looking for.
The
path/to /includeFilter
(orexcludeFilter
) could be a property that gets set based on the value of another property which could default to something likedev
for regular builds,test
for CI builds, anddeploy
for deployment builds and specify which specific warnings you want to see or don't want to see at each stage.Hope that helps.