|
|||||||||
| 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 final class FindBugsMojo
Generates a FindBugs report.
| 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 pFindBugsProject)
Adds the dependend libraries of the project to the findbugs aux classpath. |
protected void |
addFiltersToFindBugs(edu.umd.cs.findbugs.FindBugs pFindBugs)
Adds the specified filters of the project to the findbugs. |
protected void |
addJavaSourcesToFindBugsProject(List pSourceFiles,
edu.umd.cs.findbugs.Project pFindBugsProject)
Adds the source files to the find bugs project. |
protected void |
addPluginsToFindBugs(Locale pLocale)
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 pLocale,
List pSourceFiles)
Lists absolute paths of java source files for denugging purposes. |
protected void |
debugSourceDirectory(Locale pLocale,
File pSourceDirectory)
Prints out the source roots to the logger with severity debug. |
protected void |
executeReport(Locale pLocale)
Executes the generation of the report. |
protected static ResourceBundle |
getBundle(Locale pLocale)
Returns the resource bundle for a specific locale. |
protected String |
getCorePlugin(Locale pLocale)
Retrieve the coreplugin module name |
protected File |
getCorePluginPath(Locale pLocale)
Get the File reference for the Findbugs core plugin. |
String |
getDescription(Locale pLocale)
Returns the plugins description for the "generated reports" overview page. |
protected EffortParameter |
getEffortParameter()
Returns the effort parameter to use. |
protected List |
getJavaSources(Locale pLocale,
File pSourceDirectory)
Collects the java sources from the source roots. |
String |
getName(Locale pLocale)
Returns the plugins name for the "generated reports" overview page and the menu. |
protected String |
getOutputDirectory()
Returns the report output directory. |
String |
getOutputName()
Returns report output file name, without the extension. |
protected org.apache.maven.project.MavenProject |
getProject()
Returns the maven project. |
protected org.codehaus.doxia.site.renderer.SiteRenderer |
getSiteRenderer()
Returns the doxia site renderer. |
protected edu.umd.cs.findbugs.FindBugs |
initialiseFindBugs(Locale pLocale,
List pSourceFiles)
Initialise FindBugs. |
protected Reporter |
initialiseReporter(org.codehaus.doxia.sink.Sink pSink,
ResourceBundle pBundle,
org.apache.maven.plugin.logging.Log pLog,
EffortParameter pEffortParameter)
Initialises a reporter. |
protected boolean |
isJXRPluginEnabled(ResourceBundle pBundle)
Determines if the JXR-Plugin is included in the report section of the POM. |
| Methods inherited from class org.apache.maven.reporting.AbstractMavenReport |
|---|
closeReport, execute, generate, getCategoryName, getReportOutputDirectory, getSink, 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 String getOutputName()
MavenReport.getOutputName()public String getName(Locale pLocale)
pLocale - the locale the report should be generated for
MavenReport.getName(java.util.Locale)public String getDescription(Locale pLocale)
pLocale - the locale the report should be generated for
MavenReport.getDescription(java.util.Locale)protected String getOutputDirectory()
getOutputDirectory in class org.apache.maven.reporting.AbstractMavenReportAbstractMavenReport.getOutputDirectory()public boolean canGenerateReport()
canGenerateReport in interface org.apache.maven.reporting.MavenReportcanGenerateReport in class org.apache.maven.reporting.AbstractMavenReportMavenReport.canGenerateReport()protected org.codehaus.doxia.site.renderer.SiteRenderer getSiteRenderer()
getSiteRenderer in class org.apache.maven.reporting.AbstractMavenReportAbstractMavenReport.getSiteRenderer()
protected void executeReport(Locale pLocale)
throws org.apache.maven.reporting.MavenReportException
executeReport in class org.apache.maven.reporting.AbstractMavenReportpLocale - the locale the report should be generated for
org.apache.maven.reporting.MavenReportException - if anything goes wrong#executeReport(java.util.Locale)
protected edu.umd.cs.findbugs.FindBugs initialiseFindBugs(Locale pLocale,
List pSourceFiles)
throws org.apache.maven.artifact.DependencyResolutionRequiredException,
IOException,
edu.umd.cs.findbugs.filter.FilterException,
org.apache.maven.artifact.resolver.ArtifactNotFoundException,
org.apache.maven.artifact.resolver.ArtifactResolutionException
pLocale - The locale.pSourceFiles - 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.
protected Reporter initialiseReporter(org.codehaus.doxia.sink.Sink pSink,
ResourceBundle pBundle,
org.apache.maven.plugin.logging.Log pLog,
EffortParameter pEffortParameter)
pSink - The sink to write the report to.pBundle - The bundle to get messages from.pLog - The logger to write logs to.pEffortParameter - The effort to use.
protected List getJavaSources(Locale pLocale,
File pSourceDirectory)
throws IOException
pSourceDirectory - The source directory to search for java sources.pLocale - The locale to print out the messages.
IOException - If there are problems searching for java sources.
protected void addJavaSourcesToFindBugsProject(List pSourceFiles,
edu.umd.cs.findbugs.Project pFindBugsProject)
addFile is omited, because we are not
interested if the java source is already added.
pSourceFiles - The java sources (Type java.io.File) to add to
the project.pFindBugsProject - The find bugs project to add the java source to.
protected void addClasspathEntriesToFindBugsProject(edu.umd.cs.findbugs.Project pFindBugsProject)
throws org.apache.maven.artifact.DependencyResolutionRequiredException
pFindBugsProject - 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(edu.umd.cs.findbugs.FindBugs pFindBugs)
throws IOException,
edu.umd.cs.findbugs.filter.FilterException
pFindBugs - 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 addPluginsToFindBugs(Locale pLocale)
throws org.apache.maven.artifact.resolver.ArtifactNotFoundException,
org.apache.maven.artifact.resolver.ArtifactResolutionException
pLocale - 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.
protected File getCorePluginPath(Locale pLocale)
throws org.apache.maven.artifact.resolver.ArtifactNotFoundException,
org.apache.maven.artifact.resolver.ArtifactResolutionException
pLocale - 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 String getCorePlugin(Locale pLocale)
pLocale - The locale to print out the messages.
protected void addVisitorsToFindBugs(edu.umd.cs.findbugs.config.UserPreferences preferences)
preferences - The find bugs UserPreferences.protected org.apache.maven.project.MavenProject getProject()
getProject in class org.apache.maven.reporting.AbstractMavenReportAbstractMavenReport.getProject()protected static ResourceBundle getBundle(Locale pLocale)
pLocale - The locale to get the bundle for.
protected EffortParameter getEffortParameter()
protected void debugSourceDirectory(Locale pLocale,
File pSourceDirectory)
pLocale - The locale to print out the messages.pSourceDirectory - The source directory to print.
protected void debugJavaSources(Locale pLocale,
List pSourceFiles)
pLocale - The locale to print out the messages.pSourceFiles - List of source files.protected boolean isJXRPluginEnabled(ResourceBundle pBundle)
pBundle - The bundle to load the artifactIf of the jxr plugin.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||