org.codehaus.mojo.findbugs
Class FindbugsViolationCheckMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.groovy.maven.mojo.GroovyMojo
          extended by org.codehaus.mojo.findbugs.FindbugsViolationCheckMojo
All Implemented Interfaces:
groovy.lang.GroovyObject, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class FindbugsViolationCheckMojo
extends org.codehaus.groovy.maven.mojo.GroovyMojo

Fail the build if there were any FindBugs violations in the source code. An XML report is put out by default in the target directory with the errors. To see more documentation about FindBugs' options, please see the FindBugs Manual.

Since:
2.0
Version:
$Id: FindbugsViolationCheckMojo.groovy gleclaire $
Author:
Garvin LeClaire

Field Summary
 
Fields inherited from class org.codehaus.groovy.maven.mojo.GroovyMojo
__timeStamp, __timeStamp__239_neverHappen1218741132868, sanitizeErrors
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
FindbugsViolationCheckMojo()
           
 
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(edu.umd.cs.findbugs.FindBugs2 findBugs)
          Adds the specified plugins to findbugs.
protected  void addFiltersToFindBugs(edu.umd.cs.findbugs.FindBugs2 findBugs)
          Adds the specified filters of the project to the findbugs.
protected  void addPluginsToFindBugs()
          Adds the specified plugins to findbugs.
protected  void addVisitorsToFindBugs(edu.umd.cs.findbugs.config.UserPreferences preferences)
          Adds the specified visitors to findbugs.
 void execute()
           
static java.lang.String getBUNDLE_NAME()
           
 java.util.ResourceBundle getBundle()
           
 java.io.File getClassFilesDirectory()
           
 java.lang.Boolean getDebug()
           
 java.lang.String getEffort()
           
protected  EffortParameter getEffortParameter()
          Returns the effort parameter to use.
 java.lang.String getExcludeFilterFile()
           
 boolean getFailOnError()
           
static java.lang.String getFINDBUGS_COREPLUGIN()
           
 java.io.File getFindbugsCheckOutputDirectory()
           
 java.lang.String getIncludeFilterFile()
           
static java.lang.String getJAVA_REGEX_PATTERN()
           
 groovy.lang.MetaClass getMetaClass()
           
 java.lang.String getOmitVisitors()
           
 java.lang.String getOnlyAnalyze()
           
 java.util.ArrayList getPluginArtifacts()
           
 java.lang.String getPluginList()
           
static boolean getPluginLoaded()
           
 org.apache.maven.project.MavenProject getProject()
           
 java.lang.Object getProperty(java.lang.String name)
           
 java.lang.Boolean getRelaxed()
           
 org.codehaus.plexus.resource.ResourceManager getResourceManager()
           
 boolean getSkip()
           
 java.lang.String getThreshold()
           
protected  ThresholdParameter getThresholdParameter()
          Returns the threshold parameter to use.
 java.lang.String getVisitors()
           
 java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
           
 boolean isFailOnError()
           
static boolean isPluginLoaded()
           
 boolean isSkip()
           
 void setBundle(java.util.ResourceBundle value)
           
 void setClassFilesDirectory(java.io.File value)
           
 void setDebug(java.lang.Boolean value)
           
 void setEffort(java.lang.String value)
           
 void setExcludeFilterFile(java.lang.String value)
           
 void setFailOnError(boolean value)
           
 void setFindbugsCheckOutputDirectory(java.io.File value)
           
protected  void setFindBugsDebug(edu.umd.cs.findbugs.FindBugs2 findBugs)
          Sets the Debug Level
 void setIncludeFilterFile(java.lang.String value)
           
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setOmitVisitors(java.lang.String value)
           
 void setOnlyAnalyze(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 setResourceManager(org.codehaus.plexus.resource.ResourceManager value)
           
 void setSkip(boolean value)
           
 void setThreshold(java.lang.String value)
           
 void setVisitors(java.lang.String value)
           
 
Methods inherited from class org.codehaus.groovy.maven.mojo.GroovyMojo
afterExecute, beforeExecute, fail, fail, getAnt
 
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

FindbugsViolationCheckMojo

public FindbugsViolationCheckMojo()
Method Detail

getBUNDLE_NAME

public static final java.lang.String getBUNDLE_NAME()

getFINDBUGS_COREPLUGIN

public static final java.lang.String getFINDBUGS_COREPLUGIN()

getJAVA_REGEX_PATTERN

public static final java.lang.String getJAVA_REGEX_PATTERN()

getClassFilesDirectory

public java.io.File getClassFilesDirectory()

setClassFilesDirectory

public void setClassFilesDirectory(java.io.File value)

getDebug

public java.lang.Boolean getDebug()

setDebug

public void setDebug(java.lang.Boolean value)

getVisitors

public java.lang.String getVisitors()

setVisitors

public void setVisitors(java.lang.String value)

getOmitVisitors

public java.lang.String getOmitVisitors()

setOmitVisitors

public void setOmitVisitors(java.lang.String value)

getPluginArtifacts

public java.util.ArrayList getPluginArtifacts()

setPluginArtifacts

public void setPluginArtifacts(java.util.ArrayList value)

getEffort

public java.lang.String getEffort()

setEffort

public void setEffort(java.lang.String value)

getFindbugsCheckOutputDirectory

public java.io.File getFindbugsCheckOutputDirectory()

setFindbugsCheckOutputDirectory

public void setFindbugsCheckOutputDirectory(java.io.File value)

getOnlyAnalyze

public java.lang.String getOnlyAnalyze()

setOnlyAnalyze

public void setOnlyAnalyze(java.lang.String value)

getPluginList

public java.lang.String getPluginList()

setPluginList

public void setPluginList(java.lang.String value)

getPluginLoaded

public static boolean getPluginLoaded()

isPluginLoaded

public static boolean isPluginLoaded()

setPluginLoaded

public static void setPluginLoaded(boolean value)

getProject

public org.apache.maven.project.MavenProject getProject()

setProject

public void setProject(org.apache.maven.project.MavenProject value)

getRelaxed

public java.lang.Boolean getRelaxed()

setRelaxed

public void setRelaxed(java.lang.Boolean value)

getSkip

public boolean getSkip()

isSkip

public boolean isSkip()

setSkip

public void setSkip(boolean value)

getFailOnError

public boolean getFailOnError()

isFailOnError

public boolean isFailOnError()

setFailOnError

public void setFailOnError(boolean value)

getThreshold

public java.lang.String getThreshold()

setThreshold

public void setThreshold(java.lang.String value)

getIncludeFilterFile

public java.lang.String getIncludeFilterFile()

setIncludeFilterFile

public void setIncludeFilterFile(java.lang.String value)

getExcludeFilterFile

public java.lang.String getExcludeFilterFile()

setExcludeFilterFile

public void setExcludeFilterFile(java.lang.String value)

getBundle

public java.util.ResourceBundle getBundle()

setBundle

public void setBundle(java.util.ResourceBundle value)

getResourceManager

public org.codehaus.plexus.resource.ResourceManager getResourceManager()

setResourceManager

public void setResourceManager(org.codehaus.plexus.resource.ResourceManager value)

execute

public void execute()

getEffortParameter

protected EffortParameter getEffortParameter()
Returns the effort parameter to use.

Returns:
A valid effort parameter.

addClasspathEntriesToFindBugsProject

protected void addClasspathEntriesToFindBugsProject(edu.umd.cs.findbugs.Project findBugsProject)
Adds the dependend libraries of the project to the findbugs aux classpath.

Parameters:
findBugsProject - The find bugs project to add the aux classpath entries.

addPluginsToFindBugs

protected void addPluginsToFindBugs()
Adds the specified plugins to findbugs. The coreplugin is always added first.


getThresholdParameter

protected ThresholdParameter getThresholdParameter()
Returns the threshold parameter to use.

Returns:
A valid threshold parameter.

addVisitorsToFindBugs

protected void addVisitorsToFindBugs(edu.umd.cs.findbugs.config.UserPreferences preferences)
Adds the specified visitors to findbugs.

Parameters:
preferences - The find bugs UserPreferences.

setFindBugsDebug

protected void setFindBugsDebug(edu.umd.cs.findbugs.FindBugs2 findBugs)
Sets the Debug Level

Parameters:
findBugs - The find bugs to add debug level information.

addFiltersToFindBugs

protected void addFiltersToFindBugs(edu.umd.cs.findbugs.FindBugs2 findBugs)
Adds the specified filters of the project to the findbugs.

Parameters:
findBugs - The find bugs to add the filters.

addClassScreenerToFindBugs

protected void addClassScreenerToFindBugs(edu.umd.cs.findbugs.FindBugs2 findBugs)
Adds the specified plugins to findbugs. The coreplugin is always added first.


getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject
Overrides:
getMetaClass in class org.codehaus.groovy.maven.mojo.GroovyMojo

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject
Overrides:
setMetaClass in class org.codehaus.groovy.maven.mojo.GroovyMojo

invokeMethod

public java.lang.Object invokeMethod(java.lang.String name,
                                     java.lang.Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject
Overrides:
invokeMethod in class org.codehaus.groovy.maven.mojo.GroovyMojo

getProperty

public java.lang.Object getProperty(java.lang.String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject
Overrides:
getProperty in class org.codehaus.groovy.maven.mojo.GroovyMojo

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject
Overrides:
setProperty in class org.codehaus.groovy.maven.mojo.GroovyMojo


Copyright © 2005-2009 Codehaus. All Rights Reserved.