@org.apache.maven.plugins.annotations.Mojo(name = "findbugs", requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true, threadSafe = true) class FindBugsMojo extends org.apache.maven.reporting.AbstractMavenReport
Generates a FindBugs Report when the site plugin is run. The HTML report is generated for site commands only.
Fields inherited from class | Fields |
---|---|
class org.apache.maven.reporting.AbstractMavenReport |
ROLE, CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLE |
class org.apache.maven.plugin.AbstractMojo |
ROLE |
Type | Name and description |
---|---|
org.apache.maven.artifact.resolver.ArtifactResolver |
artifactResolver Artifact resolver, needed to download the coreplugin jar. |
int |
bugCount |
java.util.ResourceBundle |
bundle |
java.io.File |
classFilesDirectory Directory containing the class files for FindBugs to analyze. |
java.util.List |
compileSourceRoots The directories containing the sources to be compiled. |
java.lang.Boolean |
debug turn on Findbugs debugging |
java.lang.String |
effort Effort of the bug finders. |
int |
errorCount |
java.lang.String |
excludeBugsFile |
java.lang.String |
excludeFilterFile |
org.apache.maven.artifact.factory.ArtifactFactory |
factory Used to look up Artifacts in the remote repository. |
boolean |
failOnError Fail the build on an error. |
boolean |
findbugsXmlOutput This has been deprecated and is on by default. |
java.io.File |
findbugsXmlOutputDirectory Specifies the directory where the findbugs native xml output will be generated. |
boolean |
fork Fork a VM for FindBugs analysis. |
java.lang.String |
includeFilterFile |
boolean |
includeTests Run Findbugs on the tests. |
java.lang.String |
jvmArgs |
org.apache.maven.artifact.repository.ArtifactRepository |
localRepository The local repository, needed to download the coreplugin jar. |
int |
maxHeap Maximum Java heap size in megabytes (default=512). |
int |
maxRank Maximum bug ranking to record. |
java.lang.Boolean |
nested This option enables or disables scanning of nested jar and zip files found in the list of files and directories to be analyzed. |
java.lang.String |
omitVisitors The visitor list to omit. |
java.lang.String |
onlyAnalyze Restrict analysis to the given comma-separated list of classes and packages. |
java.io.File |
outputDirectory Location where generated html will be created. |
java.lang.String |
outputEncoding The file encoding to use when creating the HTML reports. |
java.io.File |
outputFindbugsFile |
java.util.List |
pluginArtifacts List of artifacts this plugin depends on. |
java.lang.String |
pluginList |
PluginArtifact[] |
plugins |
org.apache.maven.project.MavenProject |
project Maven Project |
java.lang.Boolean |
relaxed Relaxed reporting mode. |
java.util.List |
remoteArtifactRepositories Remote repositories which will be searched for the coreplugin jar. |
java.util.List |
remoteRepositories List of Remote Repositories used by the resolver |
org.codehaus.plexus.resource.ResourceManager |
resourceManager @since 2.0 |
org.apache.maven.doxia.siterenderer.Renderer |
siteRenderer Doxia Site Renderer. |
org.apache.maven.doxia.tools.SiteTool |
siteTool SiteTool. |
boolean |
skip Skip entire check. |
boolean |
skipEmptyReport Skip the FindBugs HTML report generation if there are no violations found. |
java.lang.String |
sourceEncoding The file encoding to use when reading the source files. |
java.io.File |
testClassFilesDirectory Directory containing the test class files for FindBugs to analyze. |
java.util.List |
testSourceRoots The directories containing the test-sources to be compiled. |
java.lang.String |
threshold Threshold of minimum bug severity to report. |
int |
timeout Specifies the amount of time, in milliseconds, that FindBugs may run before it is assumed to be hung and is terminated. |
java.lang.Boolean |
trace Prints a trace of detectors run and classes analyzed to standard output. |
java.lang.String |
userPrefs Set the path of the user preferences file to use. |
java.lang.String |
visitors The visitor list to run. |
java.lang.String |
xmlEncoding Encoding used for xml files. |
boolean |
xmlOutput Turn on and off xml output of the Findbugs report. |
java.io.File |
xmlOutputDirectory Specifies the directory where the xml output will be generated. |
java.io.File |
xrefLocation Location of the Xrefs to link to. |
java.io.File |
xrefTestLocation Location of the Test Xrefs to link to. |
Constructor and description |
---|
FindBugsMojo
() |
Type Params | Return Type | Name and description |
---|---|---|
|
boolean |
canGenerateReport() Checks whether prerequisites for generating this report are given. |
|
void |
execute() |
|
private void |
executeCheck(java.util.Locale locale) |
|
private void |
executeFindbugs(java.io.File outputFile) Set up and run the Findbugs engine. |
|
void |
executeReport(java.util.Locale locale) Executes the generation of the report. |
|
private void |
generateXDoc(java.util.Locale locale) |
|
java.util.ResourceBundle |
getBundle(java.lang.Object locale) |
|
java.lang.String |
getDescription(java.util.Locale locale) Returns the plugins description for the "generated reports" overview page. |
|
private java.util.ArrayList<java.lang.String> |
getFindbugsArgs(java.io.File tempFile) Get the Findbugs command line arguments. |
|
private java.lang.String |
getFindbugsAuxClasspath() Get the Findbugs AuxClasspath. |
|
protected java.util.List |
getJavaSources(java.util.Locale locale) Collects the java sources from the source roots. |
|
java.lang.String |
getName(java.util.Locale locale) Returns the plugins name for the "generated reports" overview page and the menu. |
|
protected java.lang.String |
getOutputDirectory() Returns the report output directory. |
|
java.lang.String |
getOutputName() Returns report output file name, without the extension. |
|
protected org.apache.maven.project.MavenProject |
getProject() Return the project. |
|
protected org.apache.maven.doxia.siterenderer.Renderer |
getSiteRenderer() Return the Site Renderer. |
|
protected java.lang.String |
getThresholdParameter() Returns the threshold parameter to use. |
|
protected boolean |
isJxrPluginEnabled() Determines if the JXR-Plugin is included in the report section of the POM. |
|
void |
setReportOutputDirectory(java.io.File reportOutputDirectory) @see org.apache.maven.reporting.AbstractMavenReport#setReportOutputDirectory(java.io.File) |
Methods inherited from class | Name |
---|---|
class org.apache.maven.reporting.AbstractMavenReport |
org.apache.maven.reporting.AbstractMavenReport#execute(), org.apache.maven.reporting.AbstractMavenReport#getSink(), org.apache.maven.reporting.AbstractMavenReport#canGenerateReport(), org.apache.maven.reporting.AbstractMavenReport#getCategoryName(), org.apache.maven.reporting.AbstractMavenReport#getReportOutputDirectory(), org.apache.maven.reporting.AbstractMavenReport#setReportOutputDirectory(java.io.File), org.apache.maven.reporting.AbstractMavenReport#getSinkFactory(), org.apache.maven.reporting.AbstractMavenReport#isExternalReport(), org.apache.maven.reporting.AbstractMavenReport#generate(org.codehaus.doxia.sink.Sink, java.util.Locale), org.apache.maven.reporting.AbstractMavenReport#generate(org.apache.maven.doxia.sink.Sink, org.apache.maven.doxia.sink.SinkFactory, java.util.Locale), org.apache.maven.reporting.AbstractMavenReport#generate(org.apache.maven.doxia.sink.Sink, java.util.Locale), org.apache.maven.reporting.AbstractMavenReport#getPluginContext(), org.apache.maven.reporting.AbstractMavenReport#setPluginContext(java.util.Map), org.apache.maven.reporting.AbstractMavenReport#setLog(org.apache.maven.plugin.logging.Log), org.apache.maven.reporting.AbstractMavenReport#getLog(), org.apache.maven.reporting.AbstractMavenReport#wait(long, int), org.apache.maven.reporting.AbstractMavenReport#wait(long), org.apache.maven.reporting.AbstractMavenReport#wait(), org.apache.maven.reporting.AbstractMavenReport#equals(java.lang.Object), org.apache.maven.reporting.AbstractMavenReport#toString(), org.apache.maven.reporting.AbstractMavenReport#hashCode(), org.apache.maven.reporting.AbstractMavenReport#getClass(), org.apache.maven.reporting.AbstractMavenReport#notify(), org.apache.maven.reporting.AbstractMavenReport#notifyAll(), org.apache.maven.reporting.AbstractMavenReport#getName(java.util.Locale), org.apache.maven.reporting.AbstractMavenReport#getOutputName(), org.apache.maven.reporting.AbstractMavenReport#getDescription(java.util.Locale) |
class org.apache.maven.plugin.AbstractMojo |
org.apache.maven.plugin.AbstractMojo#getPluginContext(), org.apache.maven.plugin.AbstractMojo#setPluginContext(java.util.Map), org.apache.maven.plugin.AbstractMojo#setLog(org.apache.maven.plugin.logging.Log), org.apache.maven.plugin.AbstractMojo#getLog(), org.apache.maven.plugin.AbstractMojo#wait(long, int), org.apache.maven.plugin.AbstractMojo#wait(long), org.apache.maven.plugin.AbstractMojo#wait(), org.apache.maven.plugin.AbstractMojo#equals(java.lang.Object), org.apache.maven.plugin.AbstractMojo#toString(), org.apache.maven.plugin.AbstractMojo#hashCode(), org.apache.maven.plugin.AbstractMojo#getClass(), org.apache.maven.plugin.AbstractMojo#notify(), org.apache.maven.plugin.AbstractMojo#notifyAll(), org.apache.maven.plugin.AbstractMojo#execute() |
Artifact resolver, needed to download the coreplugin jar.
Directory containing the class files for FindBugs to analyze.
The directories containing the sources to be compiled.
turn on Findbugs debugging
Effort of the bug finders. Valid values are Min, Default and Max.
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.
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.
It supports multiple files separated by a comma
Used to look up Artifacts in the remote repository.
Fail the build on an error.
This has been deprecated and is on by default.
Specifies the directory where the findbugs native xml output will be generated.
Fork a VM for FindBugs analysis. This will allow you to set timeouts and heap size
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.
It supports multiple files separated by a comma
Run Findbugs on the tests.
the arguments to pass to the forked VM (ignored if fork is disabled).
The local repository, needed to download the coreplugin jar.
Maximum Java heap size in megabytes (default=512). This only works if the fork parameter is set true.
Maximum bug ranking to record.
This option enables or disables scanning of nested jar and zip files found in the list of files and directories to be analyzed.
The visitor list to omit. This is a comma-delimited list.
Restrict analysis to the given comma-separated list of classes and packages.
Location where generated html will be created.
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.
List of artifacts this plugin depends on. Used for resolving the Findbugs coreplugin.
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.
Collection of PluginArtifact to work on. (PluginArtifact contains groupId, artifactId, version, type.) See Usage for details.
Maven Project
Relaxed reporting mode. For many detectors, this option suppresses the heuristics used to avoid reporting false positives.
Remote repositories which will be searched for the coreplugin jar.
List of Remote Repositories used by the resolver
Doxia Site Renderer.
SiteTool.
Skip entire check.
Skip the FindBugs HTML report generation if there are no violations found. Defaults to
false
.
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.
Directory containing the test class files for FindBugs to analyze.
The directories containing the test-sources to be compiled.
Threshold of minimum bug severity to report. Valid values are High, Default, Low, Ignore, and Exp (for experimental).
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.
Prints a trace of detectors run and classes analyzed to standard output. Useful for troubleshooting unexpected analysis failures.
Set the path of the user preferences file to use. Will try to read the path as a resource before treating it as a local path. This will read in a configuration file to set up Findbugs. The parameters in the POM file will override anything in the config file
The visitor list to run. This is a comma-delimited list.
Encoding used for xml files. Default value is UTF-8.
Turn on and off xml output of the Findbugs report.
Specifies the directory where the xml output will be generated.
Location of the Xrefs to link to.
Location of the Test Xrefs to link to.
Checks whether prerequisites for generating this report are given.
Set up and run the Findbugs engine.
locale
- the locale the report should be generated forExecutes the generation of the report. Callback from Maven Site Plugin.
locale
- he wanted locale to generate the report, could be null.Returns the plugins description for the "generated reports" overview page.
locale
- the locale the report should be generated forGet the Findbugs command line arguments.
Findbugs
- temp output fileGet the Findbugs AuxClasspath.
Collects the java sources from the source roots.
Returns the plugins name for the "generated reports" overview page and the menu.
locale
- the locale the report should be generated forReturns the report output directory. Called by AbstractMavenReport.execute() for creating the sink.
Returns report output file name, without the extension. Called by AbstractMavenReport.execute() for creating the sink.
Return the project.
Return the Site Renderer.
Returns the threshold parameter to use.
Determines if the JXR-Plugin is included in the report section of the POM.
bundle
- The bundle to load the artifactIf of the jxr plugin.
Groovy Documentation