Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#554 Problem invoking Checkstyle with Ant

release_5.0
closed
Oliver Burn
ANT Task (45)
7
2012-10-10
2009-04-15
Nitin Bhardwaj
No

Hi Friends,

This is with reference to my previous artifact 2764425 which has been closed, so I was unable to further follow up on that.
The addition that I will like to make in that is:
In the build file that I attached with that artifact(I've attached the same here also) we already have the following entry:

<fileset dir="C:\\nitCheckStyle\\checkstyle-5.0-beta2">
<include name="*.jar"/>
</fileset>

<taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath"/>

Just a clarification needed on above: Do I need to do anything apart from this also while writing a taskdef for checkstyle?

Thanks & Regards,
Nitin Bhardwaj

Previously posted:
Hi Friends,
The versions used: Ant 1.7.1, Checkstyle 5.0 beta 2, JDK 1.4.
I included checkstyle-5.0-beta2.jar in the classpath.
After this I tried to run the ant for the java files which were contained
in a package. However, it showed me the following error:

C:\nitCheckStyle\StyleTest\CheckstyleBuild>call ant -buildfile buildNew.xml
1>logs/runCheckStyleBuild.log

BUILD FAILED
C:\nitCheckStyle\StyleTest\CheckstyleBuild\buildNew.xml:9: The following
error occurred while executing this line:
C:\nitCheckStyle\StyleTest\CheckstyleBuild\buildNew.xml:21: Problem: failed
to create task or type checkstyle
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken
place.

Total time: 0 seconds

The build file that I used, has been attached for your ready reference.
Request you to please help me out.

Thanks & Regards,
Nitin Bhardwaj

Comment by oburn: You are not calling <taskdef/> to setup the Checkstyle task. See
http://checkstyle.sourceforge.net/anttask.html for correct usage.

Discussion

  • Nitin Bhardwaj
    Nitin Bhardwaj
    2009-04-15

    Build file used

     
    Attachments
  • Nitin Bhardwaj
    Nitin Bhardwaj
    2009-04-15

    It is a follow-up post on previous post num: 2764425

     
  • Oliver Burn
    Oliver Burn
    2009-04-15

    I cannot see how your build script is calling <taskdef/>. I suggest emailing to the Checkstyle User mailing list. This is not a bug.