Finds (potential) bugs in Java programs using FindBugs, an open-source tool provided by The University of Maryland. More...
| Release-level Ant targets: | |
|---|---|
| findbugs |
Tries to find bugs in all modules of the release.
Generates a release-level findbugs report in
the ${antmod.findbugs.release.dest} directory,
like this one.
Events fired: findbugs-pre, findbugs-post.
|
| Module-level Ant targets: | |
|---|---|
| findbugs |
Tries to find bugs in the Java code of this module.
Generates a module-level findbugs report in
the ${antmod.findbugs.module.dest} directory.
Events fired: findbugs-pre, findbugs-post.
|
| Configurable properties: [...] | |
|---|---|
| antmod.findbugs.module.dest | The module-level destination directory where the findbugs report is created. Defaults to ${antmod.module.dirs.build}/findbugs. |
| antmod.findbugs.release.dest | The release-level destination directory for the single findbugs report for the whole release. Defaults to ${antmod.release.dirs.build}/findbugs. |
| antmod.findbugs.debug | If set to true, FindBugs prints diagnostic information about which classes are being analyzed,
and which bug pattern detectors are being run. Defaults to false. |
| antmod.findbugs.effort | Set the analysis effort level to "min", "default", or "max".
Minimum effort decreases precision and memory consumption.
Maximum effort increases precision and finds more bugs, but may require more memory and take more time to complete.
Defaults to default. |
| antmod.findbugs.jvmargs | Specifies any arguments that should be passed to the Java virtual machine used to run FindBugs. You may need to use this attribute to specify flags to increase the amount of memory the JVM may use if you are analyzing a very large program. Defaults to empty. |
| antmod.findbugs.output.format | The output format of the findbugs report; valid values are "html", "xml", "text" and "emacs". Defaults to html. |
| antmod.findbugs.reportlevel | Specifies whether "low", "medium", or "high" priority bugs should be listed. Defaults to medium. |
The FindBugs plugin uses the FindBugs Ant task to do static code analysis on the Java source code in the current release.
The release-level "findbugs" target runs FindBugs across all modules of the release in one go, by doing the following:
The module-level "findbugs" target depends on the "build" target, and requires that the Antmod Jar Plugin has generated a JAR for the current module as part of the "build" target: FindBugs assumes there is a JAR file "${antmod.jar.destdir}/${antmod.jar.prefix}${antmod.module.name}.jar" in the module against which FindBugs is invoked.
The end result is that this plugin can generate a single report for the whole release, and one for each module if the module-level "findbugs" target is executed.
A sample FindBugs report can be found here.