简体   繁体   English

src的findbugs命令行

[英]findbugs command line for src

I'm trying integrate hudson and findbugs by command line. 我正在尝试通过命令行集成hudson和findbugs。 I'm using command line script. 我正在使用命令行脚本。

./findbugs -textui -xml -outputFile report.xml src/

When trying to run this I get error 当我试图运行这个时,我得到了错误

Exception in thread "main" edu.umd.cs.findbugs.NoClassesFoundToAnalyzeException: No classes found to analyze in

Can I run findbugs for .java files? 我可以为.java文件运行findbugs吗? How to include java files in that directory and subdirectorys? 如何在该目录和子目录中包含java文件?

You should specify build directory with class or jar files instead of src dir. 您应该使用类或jar文件而不是src dir指定构建目录。 FindBugs analyzes bytecode not source files. FindBugs分析字节码而不是源文件。

Your best bet is to use Ant Findbugs or Maven Findbugs plugin to generate the findbugs XML report (perhaps DAILY using a Hudson Job), based on what build mechanism you use (ant or maven). 最好的办法是使用Ant FindbugsMaven Findbugs插件根据您使用的构建机制(ant或maven)生成findbugs XML报告(可能是使用Hudson作业的DAILY)。 You can instruct these to use the desired Source directory for your code base. 您可以指示这些代码库使用所需的Source目录。

In the same job, if you have the Findbugs plugin enabled, you can configure it with Hudson by specifying the findbugs result XML location (generated by the ANT or MAVEN task) and Hudson will prepare the report. 在同一项工作中,如果启用了Findbugs插件,则可以通过指定findbugs结果XML位置(由ANT或MAVEN任务生成)使用Hudson对其进行配置,Hudson将准备报告。 Read more on the plugin @ http://wiki.hudson-ci.org/display/HUDSON/FindBugs+Plugin 阅读有关插件的更多信息@ http://wiki.hudson-ci.org/display/HUDSON/FindBugs+Plugin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM