|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
org.apache.maven.reporting.AbstractMavenReport
org.codehaus.mojo.findbugs.FindBugsMojo
public class FindBugsMojo
Generates a FindBugs Report when the site plugin is run. The HTML report is generated for site commands only. The optional report formats are generated for both the site and findbugs:findbugs commands.
Field Summary |
---|
Fields inherited from interface org.apache.maven.reporting.MavenReport |
---|
CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLE |
Fields inherited from interface org.apache.maven.plugin.Mojo |
---|
ROLE |
Constructor Summary | |
---|---|
FindBugsMojo()
|
Method Summary | |
---|---|
protected void |
addClasspathEntriesToFindBugsProject(edu.umd.cs.findbugs.Project findBugsProject)
Adds the dependend libraries of the project to the findbugs aux classpath. |
protected void |
addClassScreenerToFindBugs(FindBugs2Proxy findBugs)
Adds the specified plugins to findbugs. |
protected void |
addFiltersToFindBugs(FindBugs2Proxy findBugs)
Adds the specified filters of the project to the findbugs. |
protected void |
addPluginsToFindBugs(java.util.Locale locale)
Adds the specified plugins to findbugs. |
protected void |
addVisitorsToFindBugs(edu.umd.cs.findbugs.config.UserPreferences preferences)
Adds the specified visitors to findbugs. |
boolean |
canGenerateReport()
Checks whether prerequisites for generating this report are given. |
protected void |
debugJavaSources(java.util.Locale locale,
java.util.List sourceFiles)
Lists absolute paths of java source files for debugging purposes. |
protected void |
executeReport(java.util.Locale locale)
Executes the generation of the report. |
protected java.lang.Object |
fail(java.lang.Object msg)
|
protected java.lang.Object |
fail(java.lang.Object msg,
java.lang.Throwable cause)
|
org.apache.maven.artifact.resolver.ArtifactResolver |
getArtifactResolver()
|
edu.umd.cs.findbugs.BugReporter |
getBugReporter()
|
static java.lang.String |
getBUNDLE_NAME()
|
protected static java.util.ResourceBundle |
getBundle(java.util.Locale locale)
Returns the resource bundle for a specific locale. |
java.io.File |
getClassFilesDirectory()
|
edu.umd.cs.findbugs.ClassScreener |
getClassScreener()
|
protected java.lang.String |
getCorePlugin(java.util.Locale locale)
Retrieve the coreplugin module name |
protected java.io.File |
getCorePluginPath(java.util.Locale locale)
Get the File reference for the Findbugs core plugin. |
java.lang.Boolean |
getDebug()
|
static java.lang.String |
getDESCRIPTION_KEY()
|
java.lang.String |
getDescription(java.util.Locale locale)
Returns the plugins description for the "generated reports" overview page. |
java.lang.String |
getEffort()
|
protected EffortParameter |
getEffortParameter()
Returns the effort parameter to use. |
java.lang.String |
getExcludeFilterFile()
|
static java.lang.String |
getFINDBUGS_COREPLUGIN()
|
boolean |
getFindbugsXmlOutput()
|
java.io.File |
getFindbugsXmlOutputDirectory()
|
boolean |
getFindbugsXmlWithMessages()
|
java.lang.String |
getIncludeFilterFile()
|
static java.lang.String |
getJAVA_REGEX_PATTERN()
|
static java.lang.String |
getJAVA_SOURCES_KEY()
|
protected java.util.List |
getJavaSources(java.util.Locale locale,
java.io.File pSourceDirectory)
Collects the java sources from the source roots. |
static java.lang.String |
getJXR_ARTIFACT_ID_KEY()
|
org.apache.maven.artifact.repository.DefaultArtifactRepository |
getLocalRepository()
|
groovy.lang.MetaClass |
getMetaClass()
|
static java.lang.String |
getNAME_KEY()
|
java.lang.String |
getName(java.util.Locale locale)
Returns the plugins name for the "generated reports" overview page and the menu. |
java.lang.String |
getOmitVisitors()
|
java.lang.String |
getOnlyAnalyze()
|
protected java.lang.String |
getOutputDirectory()
Returns the report output directory. |
java.lang.String |
getOutputName()
Returns report output file name, without the extension. |
static java.lang.String |
getPLUGIN_NAME()
|
java.util.ArrayList |
getPluginArtifacts()
|
java.lang.String |
getPluginList()
|
static boolean |
getPluginLoaded()
|
protected org.apache.maven.project.MavenProject |
getProject()
|
java.lang.Object |
getProperty(java.lang.String name)
|
java.lang.Boolean |
getRelaxed()
|
java.util.List |
getRemoteArtifactRepositories()
|
protected org.apache.maven.doxia.siterenderer.Renderer |
getSiteRenderer()
|
boolean |
getSkip()
|
static java.lang.String |
getSOURCE_ROOT_KEY()
|
java.lang.String |
getThreshold()
|
protected ThresholdParameter |
getThresholdParameter()
Returns the threshold parameter to use. |
java.lang.String |
getVisitors()
|
java.lang.String |
getXmlEncoding()
|
boolean |
getXmlOutput()
|
java.io.File |
getXmlOutputDirectory()
|
protected FindBugs2Proxy |
initialiseFindBugs(java.util.Locale locale,
java.util.List sourceFiles)
Initialise FindBugs. |
protected Reporter |
initialiseReporter(org.apache.maven.doxia.sink.Sink sink,
java.util.ResourceBundle bundle,
org.apache.maven.plugin.logging.Log log,
EffortParameter effortParameter)
Initialises a reporter. |
java.lang.Object |
invokeMethod(java.lang.String name,
java.lang.Object args)
|
boolean |
isFindbugsXmlOutput()
|
boolean |
isFindbugsXmlWithMessages()
|
protected boolean |
isJXRPluginEnabled(java.util.ResourceBundle bundle)
Determines if the JXR-Plugin is included in the report section of the POM. |
static boolean |
isPluginLoaded()
|
boolean |
isSkip()
|
boolean |
isXmlOutput()
|
void |
setArtifactResolver(org.apache.maven.artifact.resolver.ArtifactResolver value)
|
void |
setBugReporter(edu.umd.cs.findbugs.BugReporter value)
|
void |
setClassFilesDirectory(java.io.File value)
|
void |
setClassScreener(edu.umd.cs.findbugs.ClassScreener value)
|
void |
setDebug(java.lang.Boolean value)
|
void |
setEffort(java.lang.String value)
|
void |
setExcludeFilterFile(java.lang.String value)
|
protected void |
setFindBugsDebug(FindBugs2Proxy findBugs)
Sets the Debug Level |
void |
setFindbugsXmlOutput(boolean value)
|
void |
setFindbugsXmlOutputDirectory(java.io.File value)
|
void |
setFindbugsXmlWithMessages(boolean value)
|
void |
setIncludeFilterFile(java.lang.String value)
|
void |
setLocalRepository(org.apache.maven.artifact.repository.DefaultArtifactRepository value)
|
void |
setMetaClass(groovy.lang.MetaClass metaClass)
|
void |
setOmitVisitors(java.lang.String value)
|
void |
setOnlyAnalyze(java.lang.String value)
|
void |
setOutputDirectory(java.lang.String value)
|
void |
setPluginArtifacts(java.util.ArrayList value)
|
void |
setPluginList(java.lang.String value)
|
static void |
setPluginLoaded(boolean value)
|
void |
setProject(org.apache.maven.project.MavenProject value)
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
|
void |
setRelaxed(java.lang.Boolean value)
|
void |
setRemoteArtifactRepositories(java.util.List value)
|
void |
setSiteRenderer(org.apache.maven.doxia.siterenderer.Renderer value)
|
void |
setSkip(boolean value)
|
void |
setThreshold(java.lang.String value)
|
void |
setVisitors(java.lang.String value)
|
void |
setXmlEncoding(java.lang.String value)
|
void |
setXmlOutput(boolean value)
|
void |
setXmlOutputDirectory(java.io.File value)
|
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport |
---|
closeReport, execute, generate, generate, generate, getCategoryName, getReportOutputDirectory, getSink, getSinkFactory, isExternalReport, setReportOutputDirectory |
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
---|
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FindBugsMojo()
Method Detail |
---|
public static final java.lang.String getPLUGIN_NAME()
public static final java.lang.String getBUNDLE_NAME()
public static final java.lang.String getNAME_KEY()
public static final java.lang.String getDESCRIPTION_KEY()
public static final java.lang.String getSOURCE_ROOT_KEY()
public static final java.lang.String getJAVA_SOURCES_KEY()
public static final java.lang.String getJAVA_REGEX_PATTERN()
public static final java.lang.String getJXR_ARTIFACT_ID_KEY()
public static final java.lang.String getFINDBUGS_COREPLUGIN()
public void setOutputDirectory(java.lang.String value)
public boolean getXmlOutput()
public boolean isXmlOutput()
public void setXmlOutput(boolean value)
public java.io.File getXmlOutputDirectory()
public void setXmlOutputDirectory(java.io.File value)
public boolean getFindbugsXmlOutput()
public boolean isFindbugsXmlOutput()
public void setFindbugsXmlOutput(boolean value)
public java.io.File getFindbugsXmlOutputDirectory()
public void setFindbugsXmlOutputDirectory(java.io.File value)
public boolean getFindbugsXmlWithMessages()
public boolean isFindbugsXmlWithMessages()
public void setFindbugsXmlWithMessages(boolean value)
public void setSiteRenderer(org.apache.maven.doxia.siterenderer.Renderer value)
public java.io.File getClassFilesDirectory()
public void setClassFilesDirectory(java.io.File value)
public java.util.ArrayList getPluginArtifacts()
public void setPluginArtifacts(java.util.ArrayList value)
public org.apache.maven.artifact.repository.DefaultArtifactRepository getLocalRepository()
public void setLocalRepository(org.apache.maven.artifact.repository.DefaultArtifactRepository value)
public java.util.List getRemoteArtifactRepositories()
public void setRemoteArtifactRepositories(java.util.List value)
public void setProject(org.apache.maven.project.MavenProject value)
public java.lang.String getXmlEncoding()
public void setXmlEncoding(java.lang.String value)
public java.lang.String getThreshold()
public void setThreshold(java.lang.String value)
public org.apache.maven.artifact.resolver.ArtifactResolver getArtifactResolver()
public void setArtifactResolver(org.apache.maven.artifact.resolver.ArtifactResolver value)
public java.lang.String getIncludeFilterFile()
public void setIncludeFilterFile(java.lang.String value)
public java.lang.String getExcludeFilterFile()
public void setExcludeFilterFile(java.lang.String value)
public java.lang.String getEffort()
public void setEffort(java.lang.String value)
public java.lang.Boolean getDebug()
public void setDebug(java.lang.Boolean value)
public java.lang.Boolean getRelaxed()
public void setRelaxed(java.lang.Boolean value)
public java.lang.String getVisitors()
public void setVisitors(java.lang.String value)
public java.lang.String getOmitVisitors()
public void setOmitVisitors(java.lang.String value)
public java.lang.String getPluginList()
public void setPluginList(java.lang.String value)
public edu.umd.cs.findbugs.BugReporter getBugReporter()
public void setBugReporter(edu.umd.cs.findbugs.BugReporter value)
public java.lang.String getOnlyAnalyze()
public void setOnlyAnalyze(java.lang.String value)
public edu.umd.cs.findbugs.ClassScreener getClassScreener()
public void setClassScreener(edu.umd.cs.findbugs.ClassScreener value)
public static boolean getPluginLoaded()
public static boolean isPluginLoaded()
public static void setPluginLoaded(boolean value)
public boolean getSkip()
public boolean isSkip()
public void setSkip(boolean value)
public boolean canGenerateReport()
canGenerateReport
in interface org.apache.maven.reporting.MavenReport
canGenerateReport
in class org.apache.maven.reporting.AbstractMavenReport
MavenReport.canGenerateReport()
public java.lang.String getDescription(java.util.Locale locale)
locale
- the locale the report should be generated for
MavenReport.getDescription(java.util.Locale)
public java.lang.String getName(java.util.Locale locale)
locale
- the locale the report should be generated for
MavenReport.getName(java.util.Locale)
public java.lang.String getOutputName()
MavenReport.getOutputName()
protected void addClasspathEntriesToFindBugsProject(edu.umd.cs.findbugs.Project findBugsProject)
findBugsProject
- The find bugs project to add the aux classpath entries.
org.apache.maven.artifact.DependencyResolutionRequiredException
- Exception that occurs when an artifact file is used, but has not been resolved.protected void addFiltersToFindBugs(FindBugs2Proxy findBugs)
findBugs
- The find bugs to add the filters.
java.io.IOException
- If filter file could not be read.
edu.umd.cs.findbugs.filter.FilterException
- If filter file was invalid.protected void addClassScreenerToFindBugs(FindBugs2Proxy findBugs)
locale
- The locale to print out the messages. Used here to get the nameof the coreplugin from the properties.
org.apache.maven.artifact.resolver.ArtifactNotFoundException
- If the coreplugin could not be found.
org.apache.maven.artifact.resolver.ArtifactResolutionException
- If the coreplugin could not be resolved.
MavenReportException
- If the findBugs plugins URL could not be resolved.protected void addPluginsToFindBugs(java.util.Locale locale)
locale
- The locale to print out the messages. Used here to get the nameof the coreplugin from the properties.
org.apache.maven.artifact.resolver.ArtifactNotFoundException
- If the coreplugin could not be found.
org.apache.maven.artifact.resolver.ArtifactResolutionException
- If the coreplugin could not be resolved.
MavenReportException
- If the findBugs plugins URL could not be resolved.protected void addVisitorsToFindBugs(edu.umd.cs.findbugs.config.UserPreferences preferences)
preferences
- The find bugs UserPreferences.protected void debugJavaSources(java.util.Locale locale, java.util.List sourceFiles)
locale
- The locale to print out the messages.sourceFiles
- List of source files.protected void executeReport(java.util.Locale locale)
executeReport
in class org.apache.maven.reporting.AbstractMavenReport
locale
- the locale the report should be generated for
MavenReportException
- if anything goes wrong#executeReport(java.util.Locale)
protected java.lang.String getCorePlugin(java.util.Locale locale)
locale
- The locale to print out the messages.
protected java.io.File getCorePluginPath(java.util.Locale locale)
locale
- The locale of the messages.
org.apache.maven.artifact.resolver.ArtifactNotFoundException
- If the coreplugin could not be found.
org.apache.maven.artifact.resolver.ArtifactResolutionException
- If the coreplugin could not be resolved.protected EffortParameter getEffortParameter()
protected java.util.List getJavaSources(java.util.Locale locale, java.io.File pSourceDirectory)
pSourceDirectory
- The source directory to search for java sources.locale
- The locale to print out the messages.
java.io.IOException
- If there are problems searching for java sources.protected java.lang.String getOutputDirectory()
getOutputDirectory
in class org.apache.maven.reporting.AbstractMavenReport
AbstractMavenReport.getOutputDirectory()
protected ThresholdParameter getThresholdParameter()
protected FindBugs2Proxy initialiseFindBugs(java.util.Locale locale, java.util.List sourceFiles)
locale
- The locale.sourceFiles
- The source files FindBugs should analyse.
org.apache.maven.artifact.DependencyResolutionRequiredException
- Exception that occurs when an artifact file is used, but has not been resolved.
java.io.IOException
- If filter file could not be read.
edu.umd.cs.findbugs.filter.FilterException
- If filter file was invalid.
org.apache.maven.artifact.resolver.ArtifactNotFoundException
- If the coreplugin could not be found.
org.apache.maven.artifact.resolver.ArtifactResolutionException
- If the coreplugin could not be resolved.
MavenReportException
- If the findBugs plugins cannot be initializedprotected Reporter initialiseReporter(org.apache.maven.doxia.sink.Sink sink, java.util.ResourceBundle bundle, org.apache.maven.plugin.logging.Log log, EffortParameter effortParameter)
sink
- The sink to write the report to.bundle
- The bundle to get messages from.log
- The logger to write logs to.effortParameter
- The effort to use.
protected boolean isJXRPluginEnabled(java.util.ResourceBundle bundle)
bundle
- The bundle to load the artifactIf of the jxr plugin.
protected void setFindBugsDebug(FindBugs2Proxy findBugs)
findBugs
- The find bugs to add debug level information.protected static java.util.ResourceBundle getBundle(java.util.Locale locale)
locale
- The locale to get the bundle for.
protected java.lang.Object fail(java.lang.Object msg)
protected java.lang.Object fail(java.lang.Object msg, java.lang.Throwable cause)
protected org.apache.maven.project.MavenProject getProject()
getProject
in class org.apache.maven.reporting.AbstractMavenReport
protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
getSiteRenderer
in class org.apache.maven.reporting.AbstractMavenReport
public groovy.lang.MetaClass getMetaClass()
public void setMetaClass(groovy.lang.MetaClass metaClass)
public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
public java.lang.Object getProperty(java.lang.String name)
public void setProperty(java.lang.String name, java.lang.Object value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |