Class DefaultCheckstyleExecutor
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.plugins.checkstyle.exec.DefaultCheckstyleExecutor
- All Implemented Interfaces:
CheckstyleExecutor,org.codehaus.plexus.logging.LogEnabled
@Component(role=CheckstyleExecutor.class,
hint="default",
instantiationStrategy="per-lookup")
public class DefaultCheckstyleExecutor
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements CheckstyleExecutor
- Since:
- 2.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.codehaus.plexus.resource.ResourceManagerprivate org.codehaus.plexus.resource.ResourceManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddAttributeIfNotExists(com.puppycrawl.tools.checkstyle.DefaultConfiguration config, String name, String value) private voidaddFilesToProcess(CheckstyleExecutorRequest request, Collection<File> sourceDirectories, List<org.apache.maven.model.Resource> resources, List<org.apache.maven.model.Resource> testResources, Collection<File> files, Collection<File> testSourceDirectories) private voidaddResourceFilesToProcess(CheckstyleExecutorRequest request, List<org.apache.maven.model.Resource> resources, Collection<File> files) protected voidaddSourceDirectory(CheckstyleCheckerListener sinkListener, Collection<File> sourceDirectories, Collection<File> testSourceDirectories, List<org.apache.maven.model.Resource> resources, CheckstyleExecutorRequest request) private booleananyDirectoryExists(Collection<File> files) private voidconfigureResourceLocator(org.codehaus.plexus.resource.ResourceManager resourceManager, CheckstyleExecutorRequest request, List<org.apache.maven.artifact.Artifact> additionalArtifacts) Configures search paths in the resource locator.private StringGet the effective Checkstyle version at runtime.private StringgetConfigFile(CheckstyleExecutorRequest request) com.puppycrawl.tools.checkstyle.api.Configurationprivate Propertiesprivate Stringprivate com.puppycrawl.tools.checkstyle.api.FilterSetgetSuppressionsFilterSet(String suppressionsFilePath) private voidprepareCheckstylePaths(CheckstyleExecutorRequest request, org.apache.maven.project.MavenProject project, List<String> classPathStrings, List<String> outputDirectories, Collection<File> sourceDirectories, Collection<File> testSourceDirectories) Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
locator
@Requirement(hint="default") private org.codehaus.plexus.resource.ResourceManager locator -
licenseLocator
@Requirement(hint="license") private org.codehaus.plexus.resource.ResourceManager licenseLocator
-
-
Constructor Details
-
DefaultCheckstyleExecutor
public DefaultCheckstyleExecutor()
-
-
Method Details
-
executeCheckstyle
public CheckstyleResults executeCheckstyle(CheckstyleExecutorRequest request) throws CheckstyleExecutorException, com.puppycrawl.tools.checkstyle.api.CheckstyleException - Specified by:
executeCheckstylein interfaceCheckstyleExecutor- Parameters:
request-CheckstyleExecutorRequest- Returns:
CheckstyleResults- Throws:
CheckstyleExecutorException- in case of an error during plugin execution.com.puppycrawl.tools.checkstyle.api.CheckstyleException- in case of an error raised by Checkstyle.
-
addSourceDirectory
protected void addSourceDirectory(CheckstyleCheckerListener sinkListener, Collection<File> sourceDirectories, Collection<File> testSourceDirectories, List<org.apache.maven.model.Resource> resources, CheckstyleExecutorRequest request) -
getConfiguration
public com.puppycrawl.tools.checkstyle.api.Configuration getConfiguration(CheckstyleExecutorRequest request) throws CheckstyleExecutorException - Specified by:
getConfigurationin interfaceCheckstyleExecutor- Throws:
CheckstyleExecutorException
-
addAttributeIfNotExists
-
prepareCheckstylePaths
private void prepareCheckstylePaths(CheckstyleExecutorRequest request, org.apache.maven.project.MavenProject project, List<String> classPathStrings, List<String> outputDirectories, Collection<File> sourceDirectories, Collection<File> testSourceDirectories) throws CheckstyleExecutorException - Throws:
CheckstyleExecutorException
-
anyDirectoryExists
-
getCheckstyleVersion
Get the effective Checkstyle version at runtime.- Returns:
- the MANIFEST implementation version of Checkstyle API package (can be
null)
-
getOverridingProperties
private Properties getOverridingProperties(CheckstyleExecutorRequest request) throws CheckstyleExecutorException - Throws:
CheckstyleExecutorException
-
getFilesToProcess
- Throws:
IOException
-
addFilesToProcess
private void addFilesToProcess(CheckstyleExecutorRequest request, Collection<File> sourceDirectories, List<org.apache.maven.model.Resource> resources, List<org.apache.maven.model.Resource> testResources, Collection<File> files, Collection<File> testSourceDirectories) throws IOException - Throws:
IOException
-
addResourceFilesToProcess
private void addResourceFilesToProcess(CheckstyleExecutorRequest request, List<org.apache.maven.model.Resource> resources, Collection<File> files) throws IOException - Throws:
IOException
-
getSuppressionsFilterSet
private com.puppycrawl.tools.checkstyle.api.FilterSet getSuppressionsFilterSet(String suppressionsFilePath) throws CheckstyleExecutorException - Throws:
CheckstyleExecutorException
-
getSuppressionsFilePath
private String getSuppressionsFilePath(CheckstyleExecutorRequest request) throws CheckstyleExecutorException - Throws:
CheckstyleExecutorException
-
getConfigFile
- Throws:
CheckstyleExecutorException
-
configureResourceLocator
private void configureResourceLocator(org.codehaus.plexus.resource.ResourceManager resourceManager, CheckstyleExecutorRequest request, List<org.apache.maven.artifact.Artifact> additionalArtifacts) Configures search paths in the resource locator. This method should only be called once per execution.- Parameters:
request- executor request data.
-