findbugs:findbugs

Note:This goal should be used as a Maven report.

Full name:

org.codehaus.mojo:findbugs-maven-plugin:2.5.4-SNAPSHOT:findbugs

Description:

Generates a FindBugs Report when the site plugin is run. The HTML report is generated for site commands only.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: compile.

Required Parameters

Name Type Since Description
classFilesDirectory File - Directory containing the class files for FindBugs to analyze.
Default value is: ${project.build.outputDirectory}.
findbugsXmlOutputDirectory File 1.2.0 Specifies the directory where the findbugs native xml output will be generated.
Default value is: ${project.build.directory}.
outputDirectory File - Location where generated html will be created.
Default value is: ${project.reporting.outputDirectory}.
testClassFilesDirectory File - Directory containing the test class files for FindBugs to analyze.
Default value is: ${project.build.testOutputDirectory}.
xmlOutputDirectory File 1.0.0 Specifies the directory where the xml output will be generated.
Default value is: ${project.build.directory}.

Optional Parameters

Name Type Since Description
debug Boolean - turn on Findbugs debugging
Default value is: false.
effort String 1.0-beta-1 Effort of the bug finders. Valid values are Min, Default and Max.
Default value is: Default.
excludeBugsFile String 2.4.1

File names of the baseline files. Bugs found in the baseline files won't be reported.

Potential values are a filesystem path, a URL, or a classpath resource.

This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory} directory before being passed to Findbugs as a filter file.

This is a comma-delimited list.
excludeFilterFile String 1.0-beta-1

File name of the exclude filter. Bugs matching the filters are not reported.

Potential values are a filesystem path, a URL, or a classpath resource.

This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory} directory before being passed to Findbugs as a filter file.


failOnError boolean 2.0 Fail the build on an error.
Default value is: true.
findbugsXmlOutput boolean 1.2.0 This has been deprecated and is on by default.
Default value is: true.
fork boolean 2.3.2 Fork a VM for FindBugs analysis. This will allow you to set timeouts and heap size
Default value is: true.
includeFilterFile String 1.0-beta-1

File name of the include filter. Only bugs in matching the filters are reported.

Potential values are a filesystem path, a URL, or a classpath resource.

This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory} directory before being passed to Findbugs as a filter file.


includeTests boolean 2.0 Run Findbugs on the tests.
Default value is: false.
jvmArgs String 2.4.1

the arguments to pass to the forked VM (ignored if fork is disabled).


maxHeap int 2.2 Maximum Java heap size in megabytes (default=512). This only works if the fork parameter is set true.
Default value is: 512.
maxRank int 2.4.1 Maximum bug ranking to record.
nested Boolean 2.3.2 This option enables or disables scanning of nested jar and zip files found in the list of files and directories to be analyzed.
Default value is: false.
omitVisitors String 1.0-beta-1 The visitor list to omit. This is a comma-delimited list.
onlyAnalyze String 1.1 Restrict analysis to the given comma-separated list of classes and packages.
outputEncoding String 2.2 The file encoding to use when creating the HTML reports. If the property project.reporting.outputEncoding is not set, the platform default encoding is used.
Default value is: ${project.reporting.outputEncoding}.
pluginList String 1.0-beta-1

The plugin list to include in the report. This is a comma-delimited list.

Potential values are a filesystem path, a URL, or a classpath resource.

This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory} directory before being passed to Findbugs as a plugin file.


plugins PluginArtifact[] 2.4.1

Collection of PluginArtifact to work on. (PluginArtifact contains groupId, artifactId, version, type.) See Usage for details.


relaxed Boolean 1.1 Relaxed reporting mode. For many detectors, this option suppresses the heuristics used to avoid reporting false positives.
Default value is: false.
skip boolean 1.1 Skip entire check.
Default value is: false.
sourceEncoding String 2.2 The file encoding to use when reading the source files. If the property project.build.sourceEncoding is not set, the platform default encoding is used.
Default value is: ${project.build.sourceEncoding}.
threshold String - Threshold of minimum bug severity to report. Valid values are High, Default, Low, Ignore, and Exp (for experimental).
Default value is: Default.
timeout int 2.2 Specifies the amount of time, in milliseconds, that FindBugs may run before it is assumed to be hung and is terminated. The default is 600,000 milliseconds, which is ten minutes. This only works if the fork parameter is set true.
Default value is: 600000.
trace Boolean 2.3.2 Prints a trace of detectors run and classes analyzed to standard output. Useful for troubleshooting unexpected analysis failures.
Default value is: false.
visitors String 1.0-beta-1 The visitor list to run. This is a comma-delimited list.
xmlOutput boolean 1.0.0 Turn on and off xml output of the Findbugs report.
Default value is: false.
xrefLocation File - Location of the Xrefs to link to.
Default value is: ${project.reporting.outputDirectory}/xref.
xrefTestLocation File - Location of the Test Xrefs to link to.
Default value is: ${project.reporting.outputDirectory}/xref-test.

Parameter Details

classFilesDirectory:

Directory containing the class files for FindBugs to analyze.
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.outputDirectory}

debug:

turn on Findbugs debugging
  • Type: java.lang.Boolean
  • Required: No
  • Expression: ${findbugs.debug}
  • Default: false

effort:

Effort of the bug finders. Valid values are Min, Default and Max.
  • Type: java.lang.String
  • Since: 1.0-beta-1
  • Required: No
  • Expression: ${findbugs.effort}
  • Default: Default

excludeBugsFile:

File names of the baseline files. Bugs found in the baseline files won't be reported.

Potential values are a filesystem path, a URL, or a classpath resource.

This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory} directory before being passed to Findbugs as a filter file.

This is a comma-delimited list.
  • Type: java.lang.String
  • Since: 2.4.1
  • Required: No
  • Expression: ${findbugs.excludeBugsFile}

excludeFilterFile:

File name of the exclude filter. Bugs matching the filters are not reported.

Potential values are a filesystem path, a URL, or a classpath resource.

This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory} directory before being passed to Findbugs as a filter file.

  • Type: java.lang.String
  • Since: 1.0-beta-1
  • Required: No
  • Expression: ${findbugs.excludeFilterFile}

failOnError:

Fail the build on an error.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • Expression: ${findbugs.failOnError}
  • Default: true

findbugsXmlOutput:

This has been deprecated and is on by default.
  • Type: boolean
  • Since: 1.2.0
  • Required: No
  • Default: true

findbugsXmlOutputDirectory:

Specifies the directory where the findbugs native xml output will be generated.
  • Type: java.io.File
  • Since: 1.2.0
  • Required: Yes
  • Default: ${project.build.directory}

fork:

Fork a VM for FindBugs analysis. This will allow you to set timeouts and heap size
  • Type: boolean
  • Since: 2.3.2
  • Required: No
  • Expression: ${findbugs.fork}
  • Default: true

includeFilterFile:

File name of the include filter. Only bugs in matching the filters are reported.

Potential values are a filesystem path, a URL, or a classpath resource.

This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory} directory before being passed to Findbugs as a filter file.

  • Type: java.lang.String
  • Since: 1.0-beta-1
  • Required: No
  • Expression: ${findbugs.includeFilterFile}

includeTests:

Run Findbugs on the tests.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • Expression: ${findbugs.includeTests}
  • Default: false

jvmArgs:

the arguments to pass to the forked VM (ignored if fork is disabled).

  • Type: java.lang.String
  • Since: 2.4.1
  • Required: No
  • Expression: ${findbugs.jvmArgs}

maxHeap:

Maximum Java heap size in megabytes (default=512). This only works if the fork parameter is set true.
  • Type: int
  • Since: 2.2
  • Required: No
  • Expression: ${findbugs.maxHeap}
  • Default: 512

maxRank:

Maximum bug ranking to record.
  • Type: int
  • Since: 2.4.1
  • Required: No
  • Expression: ${findbugs.maxRank}

nested:

This option enables or disables scanning of nested jar and zip files found in the list of files and directories to be analyzed.
  • Type: java.lang.Boolean
  • Since: 2.3.2
  • Required: No
  • Expression: ${findbugs.nested}
  • Default: false

omitVisitors:

The visitor list to omit. This is a comma-delimited list.
  • Type: java.lang.String
  • Since: 1.0-beta-1
  • Required: No
  • Expression: ${findbugs.omitVisitors}

onlyAnalyze:

Restrict analysis to the given comma-separated list of classes and packages.
  • Type: java.lang.String
  • Since: 1.1
  • Required: No
  • Expression: ${findbugs.onlyAnalyze}

outputDirectory:

Location where generated html will be created.
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.reporting.outputDirectory}

outputEncoding:

The file encoding to use when creating the HTML reports. If the property project.reporting.outputEncoding is not set, the platform default encoding is used.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Expression: ${outputEncoding}
  • Default: ${project.reporting.outputEncoding}

pluginList:

The plugin list to include in the report. This is a comma-delimited list.

Potential values are a filesystem path, a URL, or a classpath resource.

This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory} directory before being passed to Findbugs as a plugin file.

  • Type: java.lang.String
  • Since: 1.0-beta-1
  • Required: No
  • Expression: ${findbugs.pluginList}

plugins:

Collection of PluginArtifact to work on. (PluginArtifact contains groupId, artifactId, version, type.) See Usage for details.

  • Type: org.codehaus.mojo.findbugs.PluginArtifact[]
  • Since: 2.4.1
  • Required: No

relaxed:

Relaxed reporting mode. For many detectors, this option suppresses the heuristics used to avoid reporting false positives.
  • Type: java.lang.Boolean
  • Since: 1.1
  • Required: No
  • Expression: ${findbugs.relaxed}
  • Default: false

skip:

Skip entire check.
  • Type: boolean
  • Since: 1.1
  • Required: No
  • Expression: ${findbugs.skip}
  • Default: false

sourceEncoding:

The file encoding to use when reading the source files. If the property project.build.sourceEncoding is not set, the platform default encoding is used.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Expression: ${encoding}
  • Default: ${project.build.sourceEncoding}

testClassFilesDirectory:

Directory containing the test class files for FindBugs to analyze.
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.testOutputDirectory}

threshold:

Threshold of minimum bug severity to report. Valid values are High, Default, Low, Ignore, and Exp (for experimental).
  • Type: java.lang.String
  • Required: No
  • Expression: ${findbugs.threshold}
  • Default: Default

timeout:

Specifies the amount of time, in milliseconds, that FindBugs may run before it is assumed to be hung and is terminated. The default is 600,000 milliseconds, which is ten minutes. This only works if the fork parameter is set true.
  • Type: int
  • Since: 2.2
  • Required: No
  • Expression: ${findbugs.timeout}
  • Default: 600000

trace:

Prints a trace of detectors run and classes analyzed to standard output. Useful for troubleshooting unexpected analysis failures.
  • Type: java.lang.Boolean
  • Since: 2.3.2
  • Required: No
  • Expression: ${findbugs.trace}
  • Default: false

visitors:

The visitor list to run. This is a comma-delimited list.
  • Type: java.lang.String
  • Since: 1.0-beta-1
  • Required: No
  • Expression: ${findbugs.visitors}

xmlOutput:

Turn on and off xml output of the Findbugs report.
  • Type: boolean
  • Since: 1.0.0
  • Required: No
  • Expression: ${findbugs.xmlOutput}
  • Default: false

xmlOutputDirectory:

Specifies the directory where the xml output will be generated.
  • Type: java.io.File
  • Since: 1.0.0
  • Required: Yes
  • Default: ${project.build.directory}

xrefLocation:

Location of the Xrefs to link to.
  • Type: java.io.File
  • Required: No
  • Default: ${project.reporting.outputDirectory}/xref

xrefTestLocation:

Location of the Test Xrefs to link to.
  • Type: java.io.File
  • Required: No
  • Default: ${project.reporting.outputDirectory}/xref-test