Ant Task

Description

This task runs Checkstyle over specified Java files. The task has been tested using ANT 1.5. The latest version of checkstyle can be found at http://checkstyle.sourceforge.net/. This task is included in the checkstyle distribution.

Installation

The easiest way is to include checkstyle-all-4.4.jar in the classpath. This contains all the classes required to run Checkstyle. Alternatively, you must include the following in the classpath:

  1. checkstyle-4.4.jar
  2. ANTLR 2.7.2 classes. antlr.jar is included in the distribution.
  3. Jakarta Commons Beanutils classes. commons-beanutils.jar is included in the distribution.
  4. Jakarta Commons Collections classes. commons-collections.jar is included in the distribution.
  5. Jakarta Commons Logging classes. commons-logging.jar is included in the distribution.
  6. A JAXP compliant XML parser implementation. You already have it on your system if you run ANT or JDK 1.4.

To use the task in a build file, you will need the following taskdef declaration:

<taskdef resource="checkstyletask.properties"
         classpath="/path/to/checkstyle-all-4.4.jar"/>

Or, assuming that Checkstyle is in the global classpath (not recommended), then you will need the following taskdef declaration:

<taskdef resource="checkstyletask.properties"/>

Or if you use Ant 1.6 and later and assuming that Checkstyle is in the library search path, then you may use antlib feature of Ant (see http://ant.apache.org/manual/CoreTypes/antlib.html for more details). For example:

<project name="foo" ...
         xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
...
  <cs:checkstyle>
  ...
  </cs:checkstyle>
...
</project>

Parameters

Attribute Description Required
file File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run checkstyle ont File to run