|
|||||||||
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(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(Locale locale,
List sourceFiles)
Lists absolute paths of java source files for debugging purposes. |
protected void |
executeReport(Locale locale)
Executes the generation of the report. |
protected Object |
fail(Object msg)
|
protected Object |
fail(Object msg,
Throwable cause)
|
org.apache.maven.artifact.resolver.ArtifactResolver |
getArtifactResolver()
|
edu.umd.cs.findbugs.BugReporter |
getBugReporter()
|
static String |
getBUNDLE_NAME()
|
protected static ResourceBundle |
getBundle(Locale locale)
Returns the resource bundle for a specific locale. |
File |
getClassFilesDirectory()
|
edu.umd.cs.findbugs.ClassScreener |
getClassScreener()
|
protected String |
getCorePlugin(Locale locale)
Retrieve the coreplugin module name |
protected File |
getCorePluginPath(Locale locale)
Get the File reference for the Findbugs core plugin. |
Boolean |
getDebug()
|
static String |
getDESCRIPTION_KEY()
|
String |
getDescription(Locale locale)
Returns the plugins description for the "generated reports" overview page. |
String |
getEffort()
|
protected EffortParameter |
getEffortParameter()
Returns the effort parameter to use. |
String |
getExcludeFilterFile()
|
static String |
getFINDBUGS_COREPLUGIN()
|
boolean |
getFindbugsXmlOutput()
|
File |
getFindbugsXmlOutputDirectory()
|
boolean |
getFindbugsXmlWithMessages()
|
String |
getIncludeFilterFile()
|
static String |
getJAVA_REGEX_PATTERN()
|
static String |
getJAVA_SOURCES_KEY()
|
protected List |
getJavaSources(Locale locale,
File pSourceDirectory)
Collects the java sources from the source roots. |
static String |
getJXR_ARTIFACT_ID_KEY()
|
org.apache.maven.artifact.repository.DefaultArtifactRepository |
getLocalRepository()
|
groovy.lang.MetaClass |
getMetaClass()
|
static String |
getNAME_KEY()
|
String |
getName(Locale locale)
Returns the plugins name for the "generated reports" overview page and the menu. |
String |
getOmitVisitors()
|
String |
getOnlyAnalyze()
|
protected String |
getOutputDirectory()
Returns the report output directory. |
String |
getOutputName()
Returns report output file name, without the extension. |
static String |
getPLUGIN_NAME()
|
ArrayList |
getPluginArtifacts()
|
String |
getPluginList()
|
static boolean |
getPluginLoaded()
|
protected org.apache.maven.project.MavenProject |
getProject()
|
Object |
getProperty(String name)
|
Boolean |
getRelaxed()
|
List |
getRemoteArtifactRepositories()
|
protected org.apache.maven.doxia.siterenderer.Renderer |
getSiteRenderer()
|
boolean |
getSkip()
|
static String |
getSOURCE_ROOT_KEY()
|
String |
getThreshold()
|
protected ThresholdParameter |
getThresholdParameter()
Returns the threshold parameter to use. |
String |
getVisitors()
|
String |
getXmlEncoding()
|
boolean |
getXmlOutput()
|
File |
getXmlOutputDirectory()
|
protected FindBugs2Proxy |
initialiseFindBugs(Locale locale,
List sourceFiles)
Initialise FindBugs. |
protected Reporter |
initialiseReporter(org.apache.maven.doxia.sink.Sink sink,
ResourceBundle bundle,
org.apache.maven.plugin.logging.Log log,
EffortParameter effortParameter)
Initialises a reporter. |
Object |
invokeMethod(String name,
Object args)
|
boolean |
isFindbugsXmlOutput()
|
boolean |
isFindbugsXmlWithMessages()
|
protected boolean |
isJXRPluginEnabled(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(File value)
|
void |
setClassScreener(edu.umd.cs.findbugs.ClassScreener value)
|
void |
setDebug(Boolean value)
|
void |
setEffort(String value)
|
void |
setExcludeFilterFile(String value)
|
protected void |
setFindBugsDebug(FindBugs2Proxy findBugs)
Sets the Debug Level |
void |
setFindbugsXmlOutput(boolean value)
|
void |
setFindbugsXmlOutputDirectory(File value)
|
void |
setFindbugsXmlWithMessages(boolean value)
|
void |
setIncludeFilterFile(String value)
|
void |
setLocalRepository(org.apache.maven.artifact.repository.DefaultArtifactRepository value)
|
void |
setMetaClass(groovy.lang.MetaClass metaClass)
|
void |
setOmitVisitors(String value)
|
void |
setOnlyAnalyze(String value)
|
void |
setOutputDirectory(String value)
|
void |
setPluginArtifacts(ArrayList value)
|
void |
setPluginList(String value)
|
static void |
setPluginLoaded(boolean value)
|
void |
setProject(org.apache.maven.project.MavenProject value)
|
void |
setProperty(String name,
Object value)
|
void |
setRelaxed(Boolean value)
|
void |
setRemoteArtifactRepositories(List value)
|
void |
setSiteRenderer(org.apache.maven.doxia.siterenderer.Renderer value)
|
void |
setSkip(boolean value)
|
void |
setThreshold(String value)
|
void |
setVisitors(String value)
|
void |
setXmlEncoding(String value)
|
void |
setXmlOutput(boolean value)
|
void |
setXmlOutputDirectory(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 String getPLUGIN_NAME()
public static final String getBUNDLE_NAME()
public static final String getNAME_KEY()
public static final String getDESCRIPTION_KEY()
public static final String getSOURCE_ROOT_KEY()
public static final String getJAVA_SOURCES_KEY()
public static final String getJAVA_REGEX_PATTERN()
public static final String getJXR_ARTIFACT_ID_KEY()
public static final String getFINDBUGS_COREPLUGIN()
public void setOutputDirectory(String value)
public boolean getXmlOutput()
public boolean isXmlOutput()
public void setXmlOutput(boolean value)
public File getXmlOutputDirectory()
public void setXmlOutputDirectory(File value)
public boolean getFindbugsXmlOutput()
public boolean isFindbugsXmlOutput()
public void setFindbugsXmlOutput(boolean value)
public File getFindbugsXmlOutputDirectory()
public void setFindbugsXmlOutputDirectory(File value)
public boolean getFindbugsXmlWithMessages()
public boolean isFindbugsXmlWithMessages()
public void setFindbugsXmlWithMessages(boolean value)
public void setSiteRenderer(org.apache.maven.doxia.siterenderer.Renderer value)
public File getClassFilesDirectory()
public void setClassFilesDirectory(File value)
public ArrayList getPluginArtifacts()
public void setPluginArtifacts(ArrayList value)
public org.apache.maven.artifact.repository.DefaultArtifactRepository getLocalRepository()
public void setLocalRepository(org.apache.maven.artifact.repository.DefaultArtifactRepository value)
public List getRemoteArtifactRepositories()
public void setRemoteArtifactRepositories(List value)
public void setProject(org.apache.maven.project.MavenProject value)
public String getXmlEncoding()
public void setXmlEncoding(String value)
public String getThreshold()
public void setThreshold(String value)
public org.apache.maven.artifact.resolver.ArtifactResolver getArtifactResolver()
public void setArtifactResolver(org.apache.maven.artifact.resolver.ArtifactResolver value)
public String getIncludeFilterFile()
public void setIncludeFilterFile(String value)
public String getExcludeFilterFile()
public void setExcludeFilterFile(String value)
public String getEffort()
public void setEffort(String value)
public Boolean getDebug()
public void setDebug(Boolean value)
public Boolean getRelaxed()
public void setRelaxed(Boolean value)
public String getVisitors()
public void setVisitors(String value)
public String getOmitVisitors()
public void setOmitVisitors(String value)
public String getPluginList()
public void setPluginList(String value)
public edu.umd.cs.findbugs.BugReporter getBugReporter()
public void setBugReporter(edu.umd.cs.findbugs.BugReporter value)
public String getOnlyAnalyze()
public void setOnlyAnalyze(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 String getDescription(Locale locale)
locale
- the locale the report should be generated for
MavenReport.getDescription(java.util.Locale)
public String getName(Locale locale)
locale
- the locale the report should be generated for
MavenReport.getName(java.util.Locale)
public 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.
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(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(Locale locale, List sourceFiles)
locale
- The locale to print out the messages.sourceFiles
- List of source files.protected void executeReport(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 String getCorePlugin(Locale locale)
locale
- The locale to print out the messages.
protected File getCorePluginPath(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 List getJavaSources(Locale locale, File pSourceDirectory)
pSourceDirectory
- The source directory to search for java sources.locale
- The locale to print out the messages.
IOException
- If there are problems searching for java sources.protected String getOutputDirectory()
getOutputDirectory
in class org.apache.maven.reporting.AbstractMavenReport
AbstractMavenReport.getOutputDirectory()
protected ThresholdParameter getThresholdParameter()
protected FindBugs2Proxy initialiseFindBugs(Locale locale, 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.
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, 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(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 ResourceBundle getBundle(Locale locale)
locale
- The locale to get the bundle for.
protected Object fail(Object msg)
protected Object fail(Object msg, 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 Object invokeMethod(String name, Object args)
public Object getProperty(String name)
public void setProperty(String name, Object value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |