Using Ckjm With Ant

First define the ant task in your build.xml file. The ckjm jar file should be in the classpath.
<taskdef name="ckjm" classname="gr.spinellis.ckjm.ant.CkjmTask">
  <classpath>
    <pathelement location="path/to/ckjm1-2.jar"/>
  </classpath>
</taskdef>
Now you can make use of the ckjm task. The attributes of the ckjm task are the following:
format
'plain' or 'xml'. Default is 'plain'
outputfile
Required. Output will be written to outputfile.
classdir
Required (if classjars is not set). Base directory which contains the class files.
classjars
Required (if classdir is not set). Jar files that contains the classes to analyse.
The ckjm task supports the nested elements <include> and <exclude>, which can be used to select the class files and the nested element <extdirs>, which is used to specify other class files participating in the inheritance hierarchy. Please notice that extdirs must point to a directory. All jar files from the directory will be included to classpath (in fact the directory will be appended to java.ext.dirs and the classpaht won't changed). You can use extdirs neither to include class files nor to include one, given by name jar file. The elements support path-like structures. Example usage:
<ckjm outputfile="ckjm.xml" format="xml" classdir="build/classes">
  <include name="**/*.class" />
  <exclude name="**/*Test.class" />
  <extdirs path="lib" />
</ckjm>
Example usage with the classjars attribute:
<ckjm outputfile="ckjm.xml" format="xml" classjars="ant.jar:bcel-5.1.jar">
  <extdirs path="bcel-5.1.jar" />
  <extdirs path="ant.jar" />
</ckjm>
You can use an XSL stylesheet to generate an HTML report from the XML output file. Example:
<xslt in="ckjm.xml" style="path/to/ckjm.xsl" out="ckjm.html" />
The distribution contains in the xsl directory two sample XSL files. Here is a complete example of a build.xml file.
<project name="myproject" default="ckjm">

<target name="compile">
  <!-- your compile instructions -->
</target>

<target name="ckjm" depends="compile">

  <taskdef name="ckjm" classname="gr.spinellis.ckjm.ant.CkjmTask">
    <classpath>
      <pathelement location="path/to/ckjm1-2.jar"/>
    </classpath>
  </taskdef>

  <ckjm outputfile="ckjm.xml" format="xml" classdir="build/classes">
    <include name="**/*.class" />
    <exclude name="**/*Test.class" />
  </ckjm>

  <xslt in="ckjm.xml" style="path/to/ckjm.xsl" out="ckjm.html" />
</target>

</project>

If the analyzed files form part of a class hierarchy of other class files that are not part of the analysis, then the extdirs path-like structure of the ckjm task must be set to point to the directory containing the corresponding jar files. This will internally set the java.ext.dirs property so that ckjm can locate the jar files containing those classes.