简体   繁体   中英

findbugs command line for src

I'm trying integrate hudson and findbugs by command line. 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? How to include java files in that directory and subdirectorys?

You should specify build directory with class or jar files instead of src dir. FindBugs analyzes bytecode not source files.

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). You can instruct these to use the desired Source directory for your code base.

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. Read more on the plugin @ http://wiki.hudson-ci.org/display/HUDSON/FindBugs+Plugin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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