user257980
user257980

Reputation: 1089

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?

Upvotes: 5

Views: 6407

Answers (2)

Andrei N
Andrei N

Reputation: 4846

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

Upvotes: 3

Saket
Saket

Reputation: 46127

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

Upvotes: 2

Related Questions