ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <>
Subject RE: Checkstyle task
Date Mon, 28 Feb 2005 16:08:05 GMT
> From: Frank W. Zammetti []
> I'm having a heck of a time trying to get a CheckStyle task up and
> running... I'm using Ant 1.6.2 and CheckStyle 3.4.  Here's what I have
> my build.xml:
>   <target name="static_analysis">
>     <echo message="Performing static code analysis..." />
>     <taskdef resource="" />

No classpath here, where it matters.

>     <checkstyle config="docs/sun_checks.xml">
>       <fileset dir="${toa_base_dir}/WEB-INF/classes"
> includes="**/*.java"/>
>       <formatter type="plain" />
>       <formatter type="xml"
> toFile="${toa_base_dir}/source/static_analysis_checkstyle.xml" />
>     </checkstyle>
>     <echo message="Done" />
>   </target>
> I'm trying to run the analysis on all the classes generated by a
> compile step, which was done into a standard webapp directory
> I'd like the output to go to the console as well as an XML report
> The property toa_base_dir is properly defined.  I know this because
> the other tasks in the build work fine using it.
> I'm getting:
> static_analysis:
>      [echo] Performing static code analysis...
>   [taskdef] Could not load definitions from resource
> It could not be found.
> I have a classpath definition which includes:
>     <pathelement
> location="${toa_base_dir}/source/libutils/checkstyle-all-3.4.jar" />

Where is this path defined?

> I've verified the JAR is there and is spelled accurately here.  There
> a number of other JARs in that directory, all of which are added to
> path as expected, so I know the basic path construction works.
> I've read that there may or may not be some compatibility issues with
> version of CheckStyle and Ant about 1.5, but I haven't found any
> answers to what to do about it.  Can anyone help?  Thanks very much!

Here's an example use. --DD

  <!-- ====================================================
       Inspects source code for Javadocs errors
  <target name="checkstyle"
          description="Inspects source code for Javadocs errors">

    <taskdef resource="">
        <fileset dir="${buildtools}/checkstyle" includes="*.jar" />

    <checkstyle config="${buildtools}/config/javadocs-checks.xml"
      <fileset dir="src">
        <include name="**/*.java" />
        <exclude name="**/test/**" />
        <exclude name="**/examples/**" />
    <echo>Checkstyle done without error</echo>


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message