Note: This Mojo should be used as a Maven report.
Full name:
org.apache.maven.plugins:maven-checkstyle-plugin:2.2:checkstyle
Description:
Perform a Checkstyle analysis, and generate a report on violations.
Attributes:
compile.| Name | Type | Since | Description |
|---|---|---|---|
| includes | String |
- |
Specifies the names filter of the source files to be used for
Checkstyle. Default value is: **/*.java. |
| outputDirectory | File |
- |
The output directory for the report. Note that this parameter is
only evaluated if the goal is run directly from the command line.
If the goal is run indirectly as part of a site generation, the
output directory configured in Maven Site Plugin is used instead. Default value is: ${project.reporting.outputDirectory}. |
| sourceDirectory | File |
- |
Specifies the location of the source directory to be used for
Checkstyle. Default value is: ${project.build.sourceDirectory}. |
| Name | Type | Since | Description |
|---|---|---|---|
| cacheFile | String |
- |
Specifies the cache file used to speed up Checkstyle on successive
runs. Default value is: ${project.build.directory}/checkstyle-cachefile. |
| configLocation | String |
- |
Specifies the location of the XML configuration to use. Potential values are a filesystem path, a URL, or a classpath resource. This parameter expects that the contents of the location conform to the xml format (Checkstyle Checker module ) configuration of rulesets. This parameter is resolved as resource, URL, then file. If
successfully resolved, the contents of the configuration is copied
into the
There are 4 predefined rulesets.
config/sun_checks.xml. |
| consoleOutput | boolean |
- |
Output errors to console. Default value is: false. |
| enableFilesSummary | boolean |
- |
Specifies if the Files summary should be enabled or not. Default value is: true. |
| enableRSS | boolean |
- |
Specifies if the RSS should be enabled or not. Default value is: true. |
| enableRulesSummary | boolean |
- |
Specifies if the Rules summary should be enabled or not. Default value is: true. |
| enableSeveritySummary | boolean |
- |
Specifies if the Severity summary should be enabled or not. Default value is: true. |
| encoding | String |
2.2 |
The file encoding to use when reading the source files. If the
property project.build.sourceEncoding is not set, the
platform default encoding is used. Note: This
parameter always overrides the property charset from
Checkstyle's TreeWalker module. Default value is: ${project.build.sourceEncoding}. |
| excludes | String |
- |
Specifies the names filter of the source files to be excluded for Checkstyle. |
| failsOnError | boolean |
- |
Specifies if the build should fail upon a violation. Default value is: false. |
| format | String |
- |
Deprecated. Specifies what predefined check set to use. Available sets are
"sun" (for the Sun coding conventions), "turbine", and "avalon". Default value is: sun. |
| headerFile | File |
- |
Deprecated. Specifies the location of the License file (a.k.a. the header file) that is used by Checkstyle to verify that source code has the correct license header. |
| headerLocation | String |
2.0-beta-2 |
Specifies the location of the License file (a.k.a. the header file) that can be used by Checkstyle to verify that source code has the correct license header. You need to use ${checkstyle.header.file} in your Checkstyle xml configuration to reference the name of this header file. For instance:
LICENSE.txt. |
| includeTestSourceDirectory | boolean |
2.2 |
Include or not the test source directory to be used for Checkstyle. Default value is: ${false}. |
| linkXRef | boolean |
2.1 |
Link the violation line numbers to the source xref. Will link
automatically if Maven JXR plugin is being used. Default value is: true. |
| outputFile | File |
- |
Specifies the path and filename to save the checkstyle output. The
format of the output file is determined by the
outputFileFormat parameter. Default value is: ${project.build.directory}/checkstyle-result.xml. |
| outputFileFormat | String |
- |
Specifies the format of the output to be used when writing to the
output file. Valid values are "plain" and "xml". Default value is: xml. |
| packageNamesFile | String |
- |
Deprecated. Specifies the location of the package names XML to be used to configure Checkstyle. |
| packageNamesLocation | String |
2.0-beta-2 |
Specifies the location of the package names XML to be used to configure the Checkstyle Packages . This parameter is resolved as resource, URL, then file. If
resolved to a resource, or a URL, the contents of the package names
XML is copied into the
|
| propertiesFile | File |
- |
Deprecated. Specifies the location of the Checkstyle properties file that will be used to check the source. |
| propertiesLocation | String |
2.0-beta-2 |
Specifies the location of the properties file. This parameter is resolved as URL, File then resource. If
successfully resolved, the contents of the properties location is
copied into the
The contents of the |
| propertiesURL | URL |
- |
Deprecated. Specifies the URL of the Checkstyle properties that will be used to check the source. |
| propertyExpansion | String |
- |
Allows for specifying raw property expansion information. |
| skip | boolean |
2.2 |
Skip entire check. Default value is: false. |
| suppressionsFile | String |
- |
Deprecated. Specifies the location of the suppressions XML file to use. The
plugin defines a Checkstyle property named
checkstyle.suppressions.file with the value of this
property. This allows using the Checkstyle property in your own
custom checkstyle configuration file when specifying a suppressions
file. |
| suppressionsFileExpression | String |
2.1 |
The key to be used in the properties for the suppressions file. Default value is: checkstyle.suppressions.file. |
| suppressionsLocation | String |
2.0-beta-2 |
Specifies the location of the suppressions XML file to use. This parameter is resolved as resource, URL, then file. If
successfully resolved, the contents of the suppressions XML is
copied into the
See |
| testSourceDirectory | File |
2.2 |
Specifies the location of the test source directory to be used for
Checkstyle. Default value is: ${project.build.testSourceDirectory}. |
| useFile | File |
- |
If null, the Checkstyle plugin will display violations
on stdout. Otherwise, a text file will be created with the
violations. |
| xrefLocation | File |
- |
Location of the Xrefs to link to. Default value is: ${project.reporting.outputDirectory}/xref. |
Specifies the cache file used to speed up Checkstyle on successive runs.
java.lang.StringNo${project.build.directory}/checkstyle-cachefileSpecifies the location of the XML configuration to use.
Potential values are a filesystem path, a URL, or a classpath resource. This parameter expects that the contents of the location conform to the xml format (Checkstyle Checker module ) configuration of rulesets.
This parameter is resolved as resource, URL, then file. If
successfully resolved, the contents of the configuration is copied
into the
${project.build.directory}/checkstyle-configuration.xml
file before being passed to Checkstyle as a configuration.
There are 4 predefined rulesets.
config/sun_checks.xml: Sun Checks.config/turbine_checks.xml: Turbine Checks.config/avalon_checks.xml: Avalon Checks.config/maven_checks.xml: Maven Source Checks.java.lang.StringNo${checkstyle.config.location}config/sun_checks.xmlOutput errors to console.
booleanNofalseSpecifies if the Files summary should be enabled or not.
booleanNo${checkstyle.enable.files.summary}trueSpecifies if the RSS should be enabled or not.
booleanNo${checkstyle.enable.rss}trueSpecifies if the Rules summary should be enabled or not.
booleanNo${checkstyle.enable.rules.summary}trueSpecifies if the Severity summary should be enabled or not.
booleanNo${checkstyle.enable.severity.summary}trueencoding :
The file encoding to use when reading the source files. If the
property project.build.sourceEncoding is not set, the
platform default encoding is used. Note: This
parameter always overrides the property charset from
Checkstyle's TreeWalker module.
java.lang.String2.2No${encoding}${project.build.sourceEncoding}excludes :
Specifies the names filter of the source files to be excluded for Checkstyle.
java.lang.StringNo${checkstyle.excludes}Specifies if the build should fail upon a violation.
booleanNofalseformat :
Specifies what predefined check set to use. Available sets are "sun" (for the Sun coding conventions), "turbine", and "avalon".
Use configLocation instead.java.lang.StringNosunSpecifies the location of the License file (a.k.a. the header file) that is used by Checkstyle to verify that source code has the correct license header.
Use headerLocation instead.java.io.FileNo${basedir}/LICENSE.txtSpecifies the location of the License file (a.k.a. the header file) that can be used by Checkstyle to verify that source code has the correct license header.
You need to use ${checkstyle.header.file} in your Checkstyle xml configuration to reference the name of this header file.
For instance:
<module name="RegexpHeader"> <property
name="headerFile" value="${checkstyle.header.file}"/>
</module>
java.lang.String2.0-beta-2No${checkstyle.header.file}LICENSE.txtInclude or not the test source directory to be used for Checkstyle.
boolean2.2No${false}includes :
Specifies the names filter of the source files to be used for Checkstyle.
java.lang.StringYes${checkstyle.includes}**/*.javalinkXRef :
Link the violation line numbers to the source xref. Will link automatically if Maven JXR plugin is being used.
boolean2.1No${linkXRef}trueThe output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in Maven Site Plugin is used instead.
java.io.FileYes${project.reporting.outputDirectory}Specifies the path and filename to save the checkstyle output. The
format of the output file is determined by the
outputFileFormat parameter.
java.io.FileNo${checkstyle.output.file}${project.build.directory}/checkstyle-result.xmlSpecifies the format of the output to be used when writing to the output file. Valid values are "plain" and "xml".
java.lang.StringNo${checkstyle.output.format}xmlSpecifies the location of the package names XML to be used to configure Checkstyle.
Use packageNamesLocation instead.java.lang.StringNoSpecifies the location of the package names XML to be used to configure the Checkstyle Packages .
This parameter is resolved as resource, URL, then file. If
resolved to a resource, or a URL, the contents of the package names
XML is copied into the
${project.build.directory}/checkstyle-packagenames.xml
file before being passed to Checkstyle for loading.
java.lang.String2.0-beta-2NoSpecifies the location of the Checkstyle properties file that will be used to check the source.
Use propertiesLocation instead.java.io.FileNoSpecifies the location of the properties file.
This parameter is resolved as URL, File then resource. If
successfully resolved, the contents of the properties location is
copied into the
${project.build.directory}/checkstyle-checker.properties
file before being passed to Checkstyle for loading.
The contents of the propertiesLocation will be made
available to Checkstyle for specifying values for parameters within
the xml configuration (specified in the configLocation
parameter).
java.lang.String2.0-beta-2No${checkstyle.properties.location}Specifies the URL of the Checkstyle properties that will be used to check the source.
Use propertiesLocation instead.java.net.URLNoAllows for specifying raw property expansion information.
java.lang.StringNoskip :
Skip entire check.
boolean2.2No${checkstyle.skip}falseSpecifies the location of the source directory to be used for Checkstyle.
java.io.FileYes${project.build.sourceDirectory}Specifies the location of the suppressions XML file to use. The
plugin defines a Checkstyle property named
checkstyle.suppressions.file with the value of this
property. This allows using the Checkstyle property in your own
custom checkstyle configuration file when specifying a suppressions
file.
Use suppressionsLocation instead.java.lang.StringNoThe key to be used in the properties for the suppressions file.
java.lang.String2.1No${checkstyle.suppression.expression}checkstyle.suppressions.fileSpecifies the location of the suppressions XML file to use.
This parameter is resolved as resource, URL, then file. If
successfully resolved, the contents of the suppressions XML is
copied into the
${project.build.directory}/checkstyle-supressions.xml
file before being passed to Checkstyle for loading.
See suppressionsFileExpression for the property
that will be made available to your checkstyle configuration.
java.lang.String2.0-beta-2No${checkstyle.suppressions.location}Specifies the location of the test source directory to be used for Checkstyle.
java.io.File2.2No${project.build.testSourceDirectory}useFile :
If null, the Checkstyle plugin will display violations
on stdout. Otherwise, a text file will be created with the
violations.
java.io.FileNoLocation of the Xrefs to link to.
java.io.FileNo${project.reporting.outputDirectory}/xref