This plugin uses the eponym SourceForge project to analyze Java source files or any other text files: HTML, XML, properties, ...
<plugin name="checkstyle"> <attribute name="checkstyle.config" value="etc/checkstyle_el4ant_checks.xml"/> <attribute name="checkstyle.properties" value="etc/checkstyle_el4ant.properties"/> <attribute name="checkstyle.set.list" value="application,tests"/> </plugin>
Warning: checkstyle.config
and checkstyle.properties
attributes are mandatory.
The target checkstyle
generates a report per module set. A module can be
registered in one or many sets thank to the set
attribute. Please read
details about module sets.
For more details about Checkstyle configuration files, please read the tool documentation.
When used with the website
plugin, checkstyle reports are generated in the
website.directory
and a report entry is added in project reports overview.
checkstyle
generates reports for all module sets (checkstyle.set.list
).
checkstyle.set
generates the report for a specific set.
checkstyle.set.list
is the module set list for which the checkstyle
target generates reports by default. Default value is the list of
known module sets.
checkstyle.config
refers to the checkstyle XML configuration file. This
attribute is mandatory. No value by default.
checkstyle.properties
refers to the property file used in the checkstyle
XML configuration file. This attribute is mandatory. No value by default.
checkstyle
and checkstyle.set
targets does not work from another
directory than the project directory if checkstyle configuration or
properties refer to other files relatively (a header for instance).
I think it is a bug of the checkstyle
Ant task: it loads files from the
JVM current directory instead of using Ant relative file resolution.
IllegalArgumentException: can't parse argument number '' et ''
with a language setting in Ant script ANT_OPTS="-Duser.language=en"